Screensave while in landscape mode

Search This thread

Renate

Recognized Contributor / Inactive Recognized Dev
If you use applications in landscape mode, you may have noticed this already.
When your Nook sleeps or is sent to sleep your normal portrait screensaver appears rotated, squished and with black borders.
Clearly, the Nook developers never anticipated that people would be using landscape mode.

I have a mod to /system/framework/services.jar to fix this.
If the graphic is either 600 x 800 or 800 x 600 it will put it in the orientation that fits.
If the graphic is 800 x 800 it will put it in the current orientation, centered at a scale of 1:1.

Since a lot of people seem to use a moded system.jar already it would have to be integrated in.

Is there interest in this?
 

mrWax

Senior Member
Jan 31, 2012
147
24
sounds great! but still I would prefer no-screen-saver mod. i.e. you can see you launcher widgets (calendar, task, time, battery) all the time. These s.s. pictures are quite antiproductive.
 

Renate

Recognized Contributor / Inactive Recognized Dev
Ok, here goes. My apologies if this is complicated.
I didn't want to distribute B&N code or presume what mods where already in your services.jar

Code:
adb pull /system/framework/services.jar
apktool d services.jar \Services

Edit \Services\smali\com\android\server\PowerManagerService.smali

parta.txt replaces 3 lines in the original that have to do with parse / move / setImageURI

Delete those lines and insert the file where the .line statements match.

You can leave both the comments in parta.txt and the .line statements there.

partb.txt gets inserted at the end of the file.

Code:
apktool b \Services services.jar
adb push services.jar /system/framework/

You probably want to clear the cache and reboot at that point.
Note: If you are using the standard slide unlock, the image placement code for that is in android.policy.jar
That defaults to portrait orientation. It is not affected by this mod.

Please tell me if this works for you.
 
Last edited:

marspeople

Senior Member
Jul 7, 2011
70
100
This is a nice idea. However, when you use book cover as screensaver via Cool Reader most of them aren't 800x600 images. The B&N default behavior is to resize to fit the screen (keep aspect ratio), but with your mod the picture appears at 1:1 scale (normally cropped). Would this be an easy fix?
 

Renate

Recognized Contributor / Inactive Recognized Dev
It's tomorrow.

I hope that I covered all the cases because more variants will require user configuration somewhere.

  • If the image is 600 x 800, 800 x 600 or an aspect ratio of 3:4 or 4:3 it will fit exactly.
  • If the image has another aspect ratio it will fit inside with side strips in white.
  • If the image is exactly square it will use the current orientation and overfill the screen.
In all cases the aspect ratio will be preserved and at least one axis will fit exactly.

When the lock screen with the slider pops up the image will not be consistent.
This is because B&N handled the screensaver image there separately.
I will be releasing a mod for android.policy.jar to fix that soon.
(Or you could switch to another screen locker.)

Install procedure same as above.
 
Last edited:

Renate

Recognized Contributor / Inactive Recognized Dev
Ok, here's the one that fixes the lock screen too.

parta.txt and partb.txt are the same as they were.

partc.txt and partd.txt are for LockScreen inside android.policy.jar

Code:
adb pull /system/framework/android.policy.jar
apktool d android.policy.jar \Policy

Edit \Policy\smali\com\android\internal\policy\impl\LockScreen.smali

partc.txt replaces the entire updateBackgroundImage method.

partd.txt gets inserted at the end of the file.

Code:
apktool b \Policy android.policy.jar
adb push android.policy.jar /system/framework/

As always, be careful and backup.

(This is also in the readme file.)

Warning: This is only for Nook 1.12 and older, not for Nook 1.2 and newer.
 

Attachments

  • LandMod.zip
    4.2 KB · Views: 51
Last edited:

Renate

Recognized Contributor / Inactive Recognized Dev
Oh, and if you're tired of dragging to unlock your NOOK™,
place the extracted files in /res/drawable-mdpi/ inside /system/framework/framework-res.apk

Just to be clear, this doesn't change the manner of unlocking, just the look.

(The folks at B&N made the graphics shorter by making the top 30 pixels transparent.
That was an unnecessary hack, as long as all four graphics are the same height it works fine.)
 

Attachments

  • Slide.png
    Slide.png
    1.5 KB · Views: 99
  • Slide.zip
    2.2 KB · Views: 32
  • Like
Reactions: ajislav

ajislav

Senior Member
Apr 1, 2011
412
212
signing / alternative to adb push

Renate,

thank you for the mods. The rotated screensaver has been irritating me for some time ;-) And I intend to put my email instead of the "slide to unlock" text..

Just 2 questions, before I do so:

1) do I need to sign the modified .jar/.apk files?
2) As I do not have ADB installed, I intend to change the files from a command line over ssh (i.e. copy, chown, chmod). My understanding is that this should be equivalend to adb push. Is this so?

Cheers
 

ajislav

Senior Member
Apr 1, 2011
412
212
Bootloop

Hi,

I tried to do both changes (screensaver, slider) but since the recompilation of services.jar and android.policy.jar was giving me errors (see below), I decided to go with replacing framework-res.apk

what I did was

ssh into my nook
Code:
cd /system/framework/
mount -o remount,rw /dev/block/mmcblk0p5 /system
#copy the new framework into target dir
cp /sdcard/download/framework-res.apk ./framework-res.apk.new
#fix permissions
chmod 644 framework-res.apk.new
#make a backup
cp framework-res.apk framework-res.apk.old
#replace the file
cp framework-res.apk.new framework-res.apk

now at that moment I got the bootloop screen.. however ssh was still working, so I run the following line to restore the framework:
Code:
cp framework-res.apk.old framework-res.apk

and rebooted.. I am getting bootloops ever since..

I can boot to CWM. so I tried both what I should have done in the first place, i.e. replace the file in CWM
I tried this
http://xdaforums.com/showpost.php?p=24728342&postcount=22
(fixes permissions)
and this
http://xdaforums.com/showpost.php?p=23607664&postcount=11
(restores the old framework and fixes permissions)

but none seem to work... still the same bootloop (nook by B&N and 5 dots going from Left to Right)..

any ideas? I'd rather not go all the way to factory restore :(

p.s. I also tried wiping cache and dalvik-cache in CWM.. could this cause any problems?

p.p.s. the errors I got with recompiling the jars are:
Code:
>apktool b .\Services2 services.jar
I: Checking whether sources has changed...
W: Could not find resources
I: Building apk file...
is the "Could not find resources" normal?
 

Renate

Recognized Contributor / Inactive Recognized Dev
Let's take the easy one first.

Compiling the jars will return "No resources found", because they are just jars.
You should always check to make sure that the output is about the same size as the original.
It may be a bit bigger or smaller depending on the vagaries of compression.

Now the toughie.

Hot-swapping jars is a bit risky.
In the best of all worlds, you'd like to swap them when they are not being used.

Swapping framework-res.apk could make it crash when something can't find a resource,
but it's not code and generally if you leave the Nook sitting it won't try to access anything.

If all you did was replace one file and now you replaced it back it should be working.

I don't know how you are getting a ssh into the Nook.
I've got no port 22 or 23 open.
 

ajislav

Senior Member
Apr 1, 2011
412
212
Hi Renate,

Compiling the jars will return "No resources found", because they are just jars.
You should always check to make sure that the output is about the same size as the original.
It may be a bit bigger or smaller depending on the vagaries of compression.
I did this, of course. The files are generally sightly smaller, in the case of framework-res.apk the change is relatively big: from 2,897,726 to 2,381,970 (but I am not worried about this as I get a similar size decrease even during simple decompile/recompile)

Swapping framework-res.apk could make it crash when something can't find a resource,
but it's not code and generally if you leave the Nook sitting it won't try to access anything.
If all you did was replace one file and now you replaced it back it should be working.
I know, and I totally agree with you!

My conclusion is that something got corrupted.. :(
I tried removing the apk.old and apk.new files via CWM (to make sure they are not in the way)
I also tried running e2fsck -p /dev/block/mmcblk0p5 via CMW (from http://xdaforums.com/showpost.php?p=21915065&postcount=59 )
.. but still the same bootloop.

Is there any way to see some logs of the failed boots?

Since I did not make a backup just before doing this change (and I know you had adviced to do so ;)), the only thing which I can think of now is
a) create a backup with noogie
b) mount the image and check what is actually in /system
unfortunately, I do not have access to linux so this would be kind of pain (my old laptop with WinXPSP3 is the main reason, why I dont have ADB..)

And I am not sure if this is not more complicated than reinstalling everything from scratch..

Thanks for your help, I'll probably give it a day's rest and then do the factory reset..

I don't know how you are getting a ssh into the Nook.
I've got no port 22 or 23 open.
I have droidSSHd installed and am able to connect easily with Putty.
 

ajislav

Senior Member
Apr 1, 2011
412
212
I am not sure how to do this (dmesg, logcat)

I was probably unclear about the ssh - I WAS able to ssh in when Nook was booting normally. Now I cannot.

Is there any way to do this from CWM? (I mean dmesg, logcat)
 

ajislav

Senior Member
Apr 1, 2011
412
212
I used noogie to get an img which I then mounted (using OSFMount and Ext2IFS) under windows..

looking at the /system partition, I see that
- my .old and .new files are gone
- the correct framework-res.apk is in place
i.e. the CWM scripts I have run did their job correctly.. so they have effectively undone any changes that I have made.. so the nook should boot up without any problems

weird....

so I guess my only options are
- restore my pre-root backup
- factory reset
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Ok, here's the one that fixes the lock screen too.

    parta.txt and partb.txt are the same as they were.

    partc.txt and partd.txt are for LockScreen inside android.policy.jar

    Code:
    adb pull /system/framework/android.policy.jar
    apktool d android.policy.jar \Policy

    Edit \Policy\smali\com\android\internal\policy\impl\LockScreen.smali

    partc.txt replaces the entire updateBackgroundImage method.

    partd.txt gets inserted at the end of the file.

    Code:
    apktool b \Policy android.policy.jar
    adb push android.policy.jar /system/framework/

    As always, be careful and backup.

    (This is also in the readme file.)

    Warning: This is only for Nook 1.12 and older, not for Nook 1.2 and newer.
    2
    If you use applications in landscape mode, you may have noticed this already.
    When your Nook sleeps or is sent to sleep your normal portrait screensaver appears rotated, squished and with black borders.
    Clearly, the Nook developers never anticipated that people would be using landscape mode.

    I have a mod to /system/framework/services.jar to fix this.
    If the graphic is either 600 x 800 or 800 x 600 it will put it in the orientation that fits.
    If the graphic is 800 x 800 it will put it in the current orientation, centered at a scale of 1:1.

    Since a lot of people seem to use a moded system.jar already it would have to be integrated in.

    Is there interest in this?
    2
    Ok, here goes. My apologies if this is complicated.
    I didn't want to distribute B&N code or presume what mods where already in your services.jar

    Code:
    adb pull /system/framework/services.jar
    apktool d services.jar \Services

    Edit \Services\smali\com\android\server\PowerManagerService.smali

    parta.txt replaces 3 lines in the original that have to do with parse / move / setImageURI

    Delete those lines and insert the file where the .line statements match.

    You can leave both the comments in parta.txt and the .line statements there.

    partb.txt gets inserted at the end of the file.

    Code:
    apktool b \Services services.jar
    adb push services.jar /system/framework/

    You probably want to clear the cache and reboot at that point.
    Note: If you are using the standard slide unlock, the image placement code for that is in android.policy.jar
    That defaults to portrait orientation. It is not affected by this mod.

    Please tell me if this works for you.
    2
    It's tomorrow.

    I hope that I covered all the cases because more variants will require user configuration somewhere.

    • If the image is 600 x 800, 800 x 600 or an aspect ratio of 3:4 or 4:3 it will fit exactly.
    • If the image has another aspect ratio it will fit inside with side strips in white.
    • If the image is exactly square it will use the current orientation and overfill the screen.
    In all cases the aspect ratio will be preserved and at least one axis will fit exactly.

    When the lock screen with the slider pops up the image will not be consistent.
    This is because B&N handled the screensaver image there separately.
    I will be releasing a mod for android.policy.jar to fix that soon.
    (Or you could switch to another screen locker.)

    Install procedure same as above.
    1
    Oh, and if you're tired of dragging to unlock your NOOK™,
    place the extracted files in /res/drawable-mdpi/ inside /system/framework/framework-res.apk

    Just to be clear, this doesn't change the manner of unlocking, just the look.

    (The folks at B&N made the graphics shorter by making the top 30 pixels transparent.
    That was an unnecessary hack, as long as all four graphics are the same height it works fine.)