Screensave while in landscape mode - Nook Touch General

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?

I am very interested!!
Can u share your mod?

Well, with all the modded services.jar and various updates maybe posting the injected smali code?
Or is that too difficult/annoying?

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 NST . we are waiting !

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.

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?

marspeople said:
Would this be an easy fix?
Click to expand...
Click to collapse
Tomorrow.

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.

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.

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.)

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 said:
1) do I need to sign the modified .jar/.apk files?
Click to expand...
Click to collapse
"Badges? Badges? We don't need no stinkin' badges."
No, if you copy in anything directly you bypass all the signing stuff.
How you get the files over is however you like.

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://forum.xda-developers.com/showpost.php?p=24728342&postcount=22
(fixes permissions)
and this
http://forum.xda-developers.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?

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.

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.
Click to expand...
Click to collapse
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.
Click to expand...
Click to collapse
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://forum.xda-developers.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.
Click to expand...
Click to collapse
I have droidSSHd installed and am able to connect easily with Putty.

Have you already tried to look at dmesg? logcat?

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)

I was wondering how you were in a boot loop and managed to ssh.
Code:
# dmesg
.....
# logcat
.....
If you don't have a shell this is not going to do you any good.

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

Related

[TUT]Revive your(original) framework-res.apk when boot looping caused by modding

Hi all,
i often noticed people(including me) who tried to modificate their framework-res.apk resulting in boot loops(e.g. looping at white/green quietly brilliant screen).
So i tried to find out a fast way to get back to my(original) framework-res.apk without usage of recovery console each time my framwork-res.apk did not work as expected.
How it could help you:
It's a fast way to:
check out your moddings when doing numerous modifications in different versions of your modded framework-res.apk on your way to get it to work.
if you want to get back to your original/working framework-res.apk, even when it boot loops!
Click to expand...
Click to collapse
When you do numerous modifications on framework-res.apk and your modded apk leads to a boot loop you will be able to replace the current apk through e.g. the original apk.
At this boot point(boot loop screen) Android nearly finished booting and you have access on ADB commands.
What do you need to do this:
Download and extract/install QtADB from the link below:
QtADB
to replace the erroneous(current) framework-res.apk by the original or a fixed one.
Click to expand...
Click to collapse
There's no need to describe how to get a copy of your untouched framework-res.apk from device, since there are numerous tutorials around here.
Please check this tutorials to get a copy of your apk.
Please note before beating your device:
this probably will work with the most visual moddings of framework-res.apk - but i can't guarantee it works 100%.
It probably will not work when you play around with hardware or connections setting, other apk's or other stuff in other folders, so i am not responsible if it does not work.
always backup your current ROM/settings/whatever and save a copy of your untouched framework-res.apk
There is a little catch in it in comparsion with using recovery:
After you did like described, you have to set your background image and your (google) accounts anew.
But this is just a little work and it's not necessary until your framework-res.apk is doing the modded stuff correctly - or if you want to set the original framework-res.apk back.
Click to expand...
Click to collapse
So let's start to revive your original framework-res.apk.
(Of course you can use this method to push a modded to your device, to check out if your modding works):
Boot your device and let it load until you're at boot loop
(Download, extract,) run QtADB
Navigate in left window(Computer) to your copy of original framework-res.apk(e.g. in root directory of SD card, but i recommend a folder on your computer)
Navigate in right window(Phone) to device folder /system/framework/
Use in left window(Computer) context menu on your original framework-res.apk and select copy or drag&drop it to right window to copy the original framework-res.apk to your device
(just ignore that your device is doing strange stuff then, since it cannot access your framework-res.apk correctly at this point)
Then enter shell of QtADB(at left toolbar of QtADB) and enter the following commands to set the apk's prermissions:su
cd /system/framework/
chmod 777 framework-res.apk​
Reboot your device( e.g. by using top menu->tools-ADB->reboot)
Set your background image and your (google/HtcSense) accounts anew.
Hope it helps you a bit on modding,
Greetings, brush2(Stephan)
error
hey man, Im getting an error on this. I changed my transitions effects ( folder anim on framework-res.apk) using the app metamorph. well, now every time I open an app the phone ( xt920) reboot. I ask my friend that have the same phone to send me his framework-res.apk. I try to replace using this method but dont got. I draged and droped the new apk and when I would type the shell's code the last code dont work because it said that the file is a "read-only system". What can I do to have my phone back? Please help.
Thanks.

Change Images of sleep/boot

Hi
I have successfully changed the poweroff image. But I cannot find a instruction how to change the sleep mode and boot images. Is it possible with adb?
Thanks!
Before you venture on, make sure you have a proper backup of your NST!
The boot images are packed into framework-res.apk
Here's a thread about the subject:
http://forum.xda-developers.com/showthread.php?t=1272397
Here's a specific post about modifying framework-res
http://forum.xda-developers.com/showpost.php?p=17882146&postcount=11
Sleep images are handled by the screensaver service.
Here's a thread on the subject:
http://forum.xda-developers.com/showthread.php?t=1286456
Thank you very much for your answer! In the first thread you wrote mounting a partition:
mkdir /data/local/tmp/mnt
mount -o rw -t vfat /dev/block/mmcblk0p1 /data/local/tmp/mnt
ls -l /data/local/tmp/mnt
Can I do this with adb? How can I access these files then? (Im on xp and a noob, sorry )
Thanks.
Here's another thread , and yes, its done through adb.
http://forum.xda-developers.com/showpost.php?p=20069276&postcount=8
Yes, I changed the power off image with that. Worked perfect. But how exactely can I change the boot and sleep images? They seem not included in framework-res.apk.
Thanks for your help!
Would it be something like this?:
Code:
cd C:/android-sdk-windows/platform-tools
adb connect yourNSTip
adb pull /dev/block/mmcblk0p1/charging0.pgm
then change the image and:
Code:
adb shell
mount -o remount,rw -t vfat /dev/block/mmcblk0p1
exit
adb push charging0.pgm /dev/block/mmcblk0p1/
reboot
Gogolo2 said:
Yes, I changed the power off image with that. Worked perfect. But how exactely can I change the boot and sleep images? They seem not included in framework-res.apk
Click to expand...
Click to collapse
Maybe I was a little unclear on the subject.
The first boot image is booting.pgm on the boot partition.
The other images there aren't interesting, the charging ones only gets triggered when your NST is so low on power it cannot boot.
The boot animation after the initial boot image is done by /system/bin/bootanimation and there's not much you can do about that short of writing your own service
The "sleep" images is handled by a screensaver service that pulls the images from a predefined folder. (/system/media/screensaver/*)
Thanks very much!
That means I could change the images in /system/media/screensaver/authors without a problem?
Gogolo2 said:
Thanks very much!
That means I could change the images in /system/media/screensaver/authors without a problem?
Click to expand...
Click to collapse
I haven't tested it, but yeah, I suppose you could
It was no problem changing the images, but: they dont show up. Only black screen. I checked everything, resolution, color depth, file name. Im stuck...
The original ones are fine. I even tried to copy only the image over the original, save - but no luck. As if the original ones had some flag or it looks at the creation date, I dont know.
It tries to show the images: If I have two own images and one original, it shows to times black and one time the original images in sleep mode. Why is that?
Thanks anyway
Connect your Nook to your PC, search for screensavers folder, create a new folder, name it whatever, and put your images there (600x800, grayscale).
Now on the nook settings, on screensaver, select your new folder.....
Sometimes life is that simple....
Thank you very much! Perfect!
ros87 said:
Maybe I was a little unclear on the subject.
The first boot image is booting.pgm on the boot partition.
The other images there aren't interesting, the charging ones only gets triggered when your NST is so low on power it cannot boot.
The boot animation after the initial boot image is done by /system/bin/bootanimation and there's not much you can do about that short of writing your own service
The "sleep" images is handled by a screensaver service that pulls the images from a predefined folder. (/system/media/screensaver/*)
Click to expand...
Click to collapse
You could try doing a boot animation zip like on a normal Android device
Located at:
/data/local/bootanimation.zip
A properly designed boot animation may theoretically work on the NST won't know until someone tries.
Ok, waiting for the first volunteer
Did you unzip?
Did you unzip the archive, replace the files, then zip it? I did this a few times. You can open the archive inside 7zip by just double clicking. Go where you need to, then paste in the new files. Then just push the same file back to the nook. Doing this on 1.1, I got the power off screen to show, and it will boot to the screensaver, but when I unlock it and select a chooser (ADW, home, relauncher), then the screen goes black and I have to restore.
I did not try this. with adb I changed power off screen successfully. Also screensaver works. But first screensaver when starting up isn't working. I think in the startup sequence it doesn't look in the specified folder.

those invisible menu options

There is an interesting discussion on the Russian forum the-ebook.org (paste this link into Google and select the translation; item is on page 2) regarding those annoying invisible menu options in many apps. Although the translation is a little rough around the edges, the gist seems to be that the default text and background colors for the app menus are not exactly what the e-ink display has in mind, often resulting in light or near-white text on a white background--hence, invisible text.
The "solution" used is to change some background color settings in framework-res.apk. I have no idea what the outcome looks like but it seems like a really good idea, although beyond my abilities, and the example used is 1.10 firmware. I'm using 1.21. Any attempt I have made to modify apk files has always failed
Does anyone have a fool-proof set of steps for doing this?
I remember reading about what you're talking about somewhere on the forums but I could never get it to work either...
Here's what I'm talking about:
http://forum.xda-developers.com/showthread.php?t=1356514
http://forum.xda-developers.com/showthread.php?t=1512846
OK, well.....I've got the adjusted background images extracted from the framework-res.apk file that I got from the Russian site (I'm working with the lighter background option at this point). And...I've found the setting in WinRar to simply "store" (not compress) the updated png files. So far, so good. My altered apk file is the same size as the original.
The clincher is to get it back on the Nook without disaster ensuing. I'm going to follow Renate's method for pushing back framework-res.apk via ABD (from this thread):
C:\>adb shell
# stop
# mount -o rw,remount /dev/block/mmcblk0p5 /system
# ^C
C:\>adb push framework-res.apk /system/framework
C:\>adb shell
# reboot
Keep your fingers crossed. If it works, I'll report back with step-by-step and files.
[Report: in concept this "works". On reboot I could see the slightly grey background color in menu options and going to a few apps where I knew the menus were invisible, I could see white text on the slightly grey background. BUT...almost no apps will work. The B&N side seems to function OK, but the App drawer is useless. Back to the drawing board. The Russian site has a method for installation using RootExplorer. I'll try that next.]
OK...day 2. Here's what does NOT work:
1. method in post above using ADB
2. method using RootBorwser as adapted from Russian site and detailed below:
a. Change permissions in /system, /system/etc and /system/framework folders so that all users have write access
(note this is my kludge to get around not knowing how to "mount" the /system partition as r/w--maybe it's wrong?)
b. Use ADB wireless to move modified framework-res.apk into /system/etc
c. Use RootBrowser to check ownership of modified framework-res.apk (should be and was already owner: 0-root, group: 0-root)
d. Use RootBrowser to change permissions on modified framework-res.apk to rw-r--r-- (664)
e. Use RootBrowser to move (cut/paste) modified framework-res.apk into /system/framework (overwrite)
With Superuser permission, this all went off without a hitch.
f. Use RootBrowser to reset permissions of folders listed in (a)
g.Shut down Nook and restart.
The result is the same as the ADB-only method described before. The Nook starts up just fine. You can see that the background color of menus is slightly gray. Those changes have obviously worked. But the vast majority of apps will not run (ADW Launcher is an exception). At one point while I was fiddling with things the Nook spontaneously rebooted.
I guess that's better than spontaneously combusting
SIGH. Clearly, despite my best efforts, something I did in handling the framework-res.apk has damaged it in some subtle way, OR, my inability to properly "remount" the /system as R/W is causing the problem, although using ADB this is accomplished without difficulty and since the result is the same...it must be the modified apk file.
And this is why I have a dedicated SD card backup......
Method 3 that does NOT work:
1. Install Ninjamorph and BusyBox from Market
2. Follow instructions for altering framework-res.apk found here.
Two ways to Finish Project, with zip-align and without. Both yield the same result which is the same as the other methods above, i.e., the B&N stuff mostly works and the desired contrast of the menus is achieved so you can actually see what used to be invisible, but most apps will not run. Really frustrating.
I have to say that while this method seemed promising it is tedious in the extreme as each of the 28 png files must be replaced individually and that means each must be located in a much larger list (which reverts to the top after each replacement....). Ugh.
I simply don't believe anyone who says they can make these modifications with the instructions they have provided. It must be that people who are more familiar with this stuff are leaving out information which is so obvious to them that they don't even think to mention it
framework-res.apk is an apk and therefore it must be signed.
It's a system apk so it must be signed with the system signature.
Modifying a few things doesn't annoy the signature matching, other stuff does.
When you have problems, please quote from logcat because that tells you exactly what the problem is.
Using ADB:
Code:
logcat
Whatever.9.png are special files.
The are usually created thusly:
http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch
When they get packed into an apk they are turned into a PNG graphic with alpha channel.
aapt handles this.
If you take a PNG with sidebars and just zip it, it will not work.
Renate NST said:
When you have problems, please quote from logcat because that tells you exactly what the problem is.
Using ADB:
Code:
logcat
Whatever.9.png are special files.
The are usually created thusly:
http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch
When they get packed into an apk they are turned into a PNG graphic with alpha channel.
aapt handles this.
If you take a PNG with sidebars and just zip it, it will not work.
Click to expand...
Click to collapse
I just tried again and this time after pushing the amended framework-res.apk file (yes, all 28 amendations are nine-patch files) I typed in logcat before rebooting.
Whoosh!!! Lines of information went streaming by faster than I could follow, so much that some of the earliest disappeared from the top of the console window. I have no clue how to extract the text from the console window
The top-most complaint I saw was a reference to system error 1248 in association with the CleanMaster app. Then there seems to be a periodic (15 second) dhcpcd renewal. Eventually there is a section that says "Framework disconnected, eof, failed to read size, closing connection". Then comes a long list of notifications from the Service Manager about all the services that have just died. After that it just continues with the 15-second dhcpcd renewal cycle. Then I gave up and rebooted.
The result is the same as before. The new image backgrounds have been incorporated into the system, but most of the app drawer is just pretty icons. ADW runs--at least the drawer and home page appear. The B&N Home and Library pages load but you can't access any of the books shown. Wi-Fi can be accessed but no apps that use it will run. Occasionally the CleanMaster app throws up an error message.
Here's what I've learned so far:
1. In the original amended framework-res.apk file (for FW 1.10) viewing the archive reveals that the files which have been changed all have an "archive " attribute. None of the original files show any attribute. I don't know whether that is important. I've searched on this topic and have come up with nothing.
2. In moving the amended *.9.png files from the original Russian example for FW 1.10 into a copy of my own framework-res.apk for FW 1.21, those "archive" attributes came along for the ride and the resulting amended file does show "STORE" for the method so I think I got that part right and didn't recompress any files when moving from one apk to another (I dragged the files from one instance of WinRAR to another--I tried 7zip as well...).
But I have no idea why people report that this procedure works just fine. For me, it is predictable, but not successful.
I've just completed yet another restore from backup. I'm going to uninstall CleanMaster and try again. Perhaps it's background activities are driving the process into the ground. I have no clue.
Here's the logcat session file (learned how to get that done!) after a re-try, having removed CleanMaster first.
No change in the outcome but no bleating from the Nook about CleanMaster errors.
I wonder--is it the modified apk that is causing the system to malfunction, or....is it the way it is being pushed back to the Nook?
So..an experiment: I pulled a copy of the stock framework-res.apk from my Nook. I didn't do anything to it at all. Then I pushed it back to the Nook via wireless ABD:
C:\>adb shell
# stop
# mount -o rw,remount /dev/block/mmcblk0p5 /system
# ^C
C:\>adb push framework-res.apk /system/framework
C:\>adb shell
# reboot
This is supposed to work, yes? It does not. It leaves me in the same condition that all of the other attempts by this and other methods have. The Nook boots normally and displays Home but you can't access the "currently reading" book. I can get to the app drawer via the quicknav buttons, but very few apps will work (including ADB). There is no way to examine the file system because RootBrowser will not work (although ES File Explorer does, but it doesn't have root access).
So....whether the modified apk is OK or not, I would never know because all of the methods I have tried to get the framework-res.apk back onto the Nook have been unsuccessful.
That procedure should work fine.
Have you checked using the stock framework-res.apk ?
Renate NST said:
That procedure should work fine.
Have you checked using the stock framework-res.apk ?
Click to expand...
Click to collapse
Yes, that's what I just tried. Just pulled it via ADB and then pushed it right back. I also installed a copy of Root Explorer (I generally used Root Browser) because that's what was used in the original thread on the Russian site where I got started with the whole project. That also yields the same results. The Home screen loads but you can't access the book currently being read from it or from the little button at the top left. You can access any of the QuickNav options. The Library "functions". But you can't access books from their covers and the double-tap does not work.
In the app drawer, ADW seems to work fine but you can only run a very few apps, and none that require wi-fi (although wi-fi works). Too much fiddling around and the Nook spontaneously reboots.
When I have tried to move in the modified apk with the slightly gray background 9.png files I can see that the new image backgrounds have been used in the drop-down menus. This suggests to me that the problem is not in how the 9.png files have been moved from the FW1.10 apk obtained from the Russian site into my FW1.21 apk but rather in the integration of the modified apk into the system. I've checked permissions, etc. Everything is OK but the system is just screwed up.
I'm running FW1.21 which has been rooted using Nook Manager with Gapps added. I've done the multi-touch modification and have swapped in a modified internal.db file which seems to have solved the confusion of the "reading now" button. I have some apps that run along in the background, like Tasker and Clean Master (probably others that I don't realize). Do I need a completely clean system to make this change?
I saw the logcat and it showed that it's unhappy and killing the Android.
I couldn't see exactly where the problem is.
I think that you are doing too many things at once.
If there are specific things that do not work, a logcat when you do that should show.
Renate NST said:
I saw the logcat and it showed that it's unhappy and killing the Android.
I couldn't see exactly where the problem is.
I think that you are doing too many things at once.
If there are specific things that do not work, a logcat when you do that should show.
Click to expand...
Click to collapse
Yes, I was probably a little unclear. The ONLY thing that I did when I produced the logcat was attempt to push the modified framework-res.apk file back to the Nook. All those other things mentioned have long ago been successfully accomplished and included in my current backup (which I've had to use dozens of time in the last week or two as I struggle with this framework issue).
The ONLY change to the stock framework-res.apk is the overwriting of 28 *.9.png images with ones copied from another framework-res.apk which, unfortunately, is from FW1.10 (or I'd just use it "as is" without the copying). However, even pushing back an unmodified stock apk results in the same mess.
Like I say, based on what functionality remains when the modified apk file is pushed over, it is clear that the new images are being used, but the system function is severely degraded.
I don't know much about the process, but from what I've read I'm wondering if it would be better to use a zip via CM to deliver this modified file? That way the Android system is not even running (right?) during the replacement procedure.
When you say "stop" Android is no longer running.
Try clearing the cache:
Code:
rm -R /data/dalvik-cache/*
Renate NST said:
When you say "stop" Android is no longer running.
Try clearing the cache:
Code:
rm -R /data/dalvik-cache/*
Click to expand...
Click to collapse
Before pushing? After, but before rebooting?
Anytime that Android is stopped you can clear the cache.
I tried this with a copy of the stock apk:
Code:
C:\>adb shell
# stop
# rm -R /data/dalvik-cache/*
# mount -o rw,remount /dev/block/mmcblk0p5 /system
# ^C
C:\>adb push framework-res.apk /system/framework
C:\>adb shell
# reboot
It put me in an very long chase of the black and white dots that I almost thought would be endless but eventually it finished booting and is in the same condition as all the previous methods. Very crippled.
I can't figure it out
First, get the 1.2.1 update off B&N's website and unzip.
Get framework-res.apk out of that and push it.
The stuff in /system/framework should all be chmod 644.
An ADB push probably leaves it with wider access.
None of this should make any difference.
I'd guess that you are either missing a resource in your fw-r or else you modified something else.
Find an app that crashes. Get a logcat of just that crashing.
Renate NST said:
First, get the 1.2.1 update off B&N's website and unzip.
Get framework-res.apk out of that and push it.
The stuff in /system/framework should all be chmod 644.
An ADB push probably leaves it with wider access.
None of this should make any difference.
I'd guess that you are either missing a resource in your fw-r or else you modified something else.
Find an app that crashes. Get a logcat of just that crashing.
Click to expand...
Click to collapse
I got a copy of the FW 1.21 zip from B&N and extracted the framework-res.apk. I didn't try to push it yet. Instead I got the checksum for the current file on the Nook and compared it to the newly minted file. They were identical. I don't think there is any point in trying yet again with the same procedure. If my reasoning is incorrect, I'm certainly game to try anyway.
All files in /system/framework are chmod 644. The Framework folder itself (and the system folder) are something else, but the contents are all 644.
The only modifications I have made after rooting with Nook Manager are the installation of Google Apps, the implementation of multi-touch (I have to go back and look that up to see what all I did, but surely nothing with framework-res.apk or it never would have worked....), editing settings.db to relabel the QuickNav buttons after programming with NTMM, and pushing a modified copy of internal.db to fix the schizo "reading now" button. As i say, these are all long-established changes and the Nook has been stable with them. I think Google apps may modify framework.jar, but I'm not sure.
[I checked on multi-touch. I flashed a new kernal image and added one line to /etc/permissions/required_hardware.xml in order to enable multi-touch...have no idea what "flashed a new kernal" actually did, but it worked]
Two really noob questions: 1) how can I get a logcat of an app crashing when ADB will not run once a copy of framework-res.apk has been pushed? 2) if the Android system is actually stopped when I type "stop"in ADB shell, how does ADB continue to function?
And, actually, apps do not so much "crash" once I've attempted to put in a "new" framework-res.apk--most just refuse to run. But maybe there is something going on in the droid brain while the screen flickers a little and nothing else happens.
ADB runs under Linux, not the Android subsystem.
You should always be able to access ADB.
If ADB isn't running continuously and reliably you have problems.
If some app does not run, give the specific section in logcat where it doesn't run.

NST sleep but retain last screen image

Forgive me if I have a gross misunderstanding about the hardware in the NST, but in my eyes it should be possible for the Nook to sleep but retain the screen, perhaps with a small banner indicating it's in sleep state and you need to press the 'n' to wake. It just seems silly having the benefit of an e-ink display only for the screensaver to kick it when it sleeps. If it didn't do this, I could (for example) leave a map open in OsmAnd and refer to it still while the Nook is sleeping. The only 'solutions' to this I've found involved plain and simply keeping the Nook awake! A hack I can think of would be to somehow bodge something together to take a screenshot just before the nook sleeps and set it as the screensaver image. Seems silly though... I've had a search around and can't find anything related to this specifically, more either people wanting to keep the nook awake or disable the slide to unlock.
Any thoughts welcome!
I had the exact same thought,
so I'm making an app that takes a screenshot every 1:50 minutes and saves it at a screensaver,
to be displayed when the nook goes to sleep.
hopefully it will be ready this weekend so stay tuned
It should be be simple enough.
Modify /system/framework/android.policy.jar
The class is com.android.internal.policy.impl.LockScreen
What puts up the "screensaver" is updateBackgroundImage()
The layout is in /system/framework/framework-res.apk,
res/layout/keyguard_screen_gossamer_unlock.xml
I'm not sure if changing the layout to transparent and not updating the image should be enough.
Renate NST said:
It should be be simple enough.
Modify /system/framework/android.policy.jar
The class is com.android.internal.policy.impl.LockScreen
What puts up the "screensaver" is updateBackgroundImage()
The layout is in /system/framework/framework-res.apk,
res/layout/keyguard_screen_gossamer_unlock.xml
I'm not sure if changing the layout to transparent and not updating the image should be enough.
Click to expand...
Click to collapse
Oh I wish you would have said that two days ago...
It seems a far better solution than my app, maybe I'll try playing with that later.
I tried replacing updateBackgroundImage()
with a stub, but the screensaver still comes up as usual,
Only difference is the "slide to unlock" screen now has black background, so that's what this function is doing.
Time for plan B (or C, really):
If I were to modify framework-res.apk as you suggest, Will I need to resign the whole system, as here?
Update -
The function that sets the screensaver is createScreensaver(), in class com.android.server.PowerManagerService, found in /system/framework/services.jar
I modified it to make the screensaver invisible, but unfortunately it also means there's no indication that the nook sleeps.
Anyway, it's better than constantly taking screenshots, so I'll stick with that.
nivieru said:
Update -
The function that sets the screensaver is createScreensaver(), in class com.android.server.PowerManagerService, found in /system/framework/services.jar
I modified it to make the screensaver invisible, but unfortunately it also means there's no indication that the nook sleeps.
Anyway, it's better than constantly taking screenshots, so I'll stick with that.
Click to expand...
Click to collapse
How did you do that? I'm using the screenshot sreensaver app for that and I find it very useful. But the above mentioned way seems to be less power consuming. Could you explain it for somebody with very little knowledge about manipulating apk, though I know how to manipulate apk with xdaAutotool.
I don't know xdaAutotool, I use apktool but you can probably use whatever tool you like.
First you need a patched /system/framework/services.jar
the one I attached here is for firmware 1.2.1 rooted with NookManager, so it also includes the NookManager patches.
if this is your setup as well, skip to 4
if you run a different firmware or don't want the NookManager patches you will need to patch it yourself
patching /system/framework/services.jar - some vauge instructions:
you will need apktool (or XdaAutotool or whatever) and the android-sdk.
1) use apktool to decompile services.jar
2) modify createScreensaver() in file smali/com/android/server/PowerManagerService.smali according to the attached patch-services.txt
notice - this patch is for firmware 1.2.1 with NookManager patches, it might not be ready for use with other versions - not only the line numbers, also the register v6 might not be a good choice if it is used later in the code without being assigned a new value first.
3) recompile with apktool.
replacing services.jar with patched version - complete instructions:
4) making a full backup before messing with the system is good practice, although the nook is notoriously hard to brick.
you could use NookManager to do the backup.
5) connect to your device with adb
6) apply these commands:
Code:
adb push pathced-services.jar /media
adb shell stop
adb shell mount -o remount,rw /dev/block/mmcblk0p5 /system
adb shell cp /system/framework/services.jar /system/framework/services.jar.backup
adb shell cp /media/pathced-services.jar /system/framework/services.jar
adb shell chmod 644 /system/framework/services.jar
adb shell reboot
7) relax, first boot takes a few minutes, this is normal.
with this patch the screensaver is invisible, so there is no indication at all that the device is asleep.
also, there's no magic button to change behavior - if you want to the screensaver back you need to replace services.jar with original version
Thanks for that extensive description. I'll try the next days to implement it in my system which differs from yours, since I'm using the custom rom from pinguy1982.
Got it.
I compared your PowerManagerService.smali with the one in my services.jar and made the changes.
Recompiled the services.jar.
Exchanged the original classes.dex with the new compiled classes.dex in 7zip.
Signed the jar file.
Had a lot of problems with adb, which didn't recognize my device.
Lost my temper, packed it into a ZIP-file and replaced it via CWM.
Everything is working now. Thanks!
nhedgehog said:
Got it.
I compared your PowerManagerService.smali with the one in my services.jar and made the changes.
Recompiled the services.jar.
Exchanged the original classes.dex with the new compiled classes.dex in 7zip.
Signed the jar file.
Had a lot of problems with adb, which didn't recognize my device.
Lost my temper, packed it into a ZIP-file and replaced it via CWM.
Everything is working now. Thanks!
Click to expand...
Click to collapse
Hi @nhedgehog
I also use the custom rom from pinguy1982.
Can you share your zip file to flash with CWM
Thanks
tebra said:
Hi @nhedgehog
I also use the custom rom from pinguy1982.
Can you share your zip file to flash with CWM
Click to expand...
Click to collapse
Here you are:
Patch (nivieru's method) via ZIP, tested only with modded ROM from pinguy1982 and installed Nooter-Part1.zip. Install via CWM, to be safe make a backup before you do the patch.
Services-org.zip=original services.jar
Services-patch.zip=patched services.jar
Hi everyone!
I've patched the jar and now enjoy the last image in sleep mode. But, I'd like to wake app the Nook every few hours, update the page in dolphin and go back sleep. Page in dolphin has a meta refresh. But I can't wake up the Nook on interval. Is it impossible or I missing smth very important on this topic?
If anybody has some experience on topic, please comment.
Update, my solution:
Re-signed the system with personal cert and implemented an app instead of dolphin+web page.
App wakes up every few hours, updates view and throws device to deep sleep. Hope to get an uptime up to 10-15 days.
nivieru said:
I
replacing services.jar with patched version - complete instructions:
4) making a full backup before messing with the system is good practice, although the nook is notoriously hard to brick.
you could use NookManager to do the backup.
5) connect to your device with adb
6) apply these commands:
Code:
adb push pathced-services.jar /media
adb shell stop
adb shell mount -o remount,rw /dev/block/mmcblk0p5 /system
adb shell cp /system/framework/services.jar /system/framework/services.jar.backup
adb shell cp /media/pathced-services.jar /system/framework/services.jar
adb shell chmod 644 /system/framework/services.jar
adb shell reboot
7) relax, first boot takes a few minutes, this is normal.
with this patch the screensaver is invisible, so there is no indication at all that the device is asleep.
also, there's no magic button to change behavior - if you want to the screensaver back you need to replace services.jar with original version
Click to expand...
Click to collapse
I've done exactly as described in points 4-7 on NST firmware 1.2.1 , rooted with Nook Manager.
I used Root explorer for replacement and rename of patched-services.jar.
After rebooting of NST, it works as intended - the screensaver is unseen, but it appears other problem.
When i click at random .apk, nothing happens, only the screen is flickering once and that's all.
I cannot install apk-s, nor uninstall them....? WTF ?
Someone with explanation...?
gsms said:
I've done exactly as described in points 4-7 on NST firmware 1.2.1 , rooted with Nook Manager.
I used Root explorer for replacement and rename of patched-services.jar.
After rebooting of NST, it works as intended - the screensaver is unseen, but it appears other problem.
When i click at random .apk, nothing happens, only the screen is flickering once and that's all.
I cannot install apk-s, nor uninstall them....? WTF ?
Someone with explanation...?
Click to expand...
Click to collapse
Replacing services.jar while the android system is running can cause problems, that's why I suggest doing it through adb after issuing the "stop" command, which stops android while leaving the underlying linux (with adb) running.
You should try that and see if it helps.
I will try, but before that another question from me.
Is there a chance the file "patched-services.jar" to be remade as .zip file and installed thru CWM.
If this can be done, i will be glad somebody to share the .zip file, because i think it is more comfortable for installation than using adb shell....
thanks
P.S. Adb don't work correctly for me, so the only available option is obviously flashable .zip file...
...
Has anyone tried this with FW 1.2.2 yet?
jptiger said:
Has anyone tried this with FW 1.2.2 yet?
Click to expand...
Click to collapse
If the original services.jar was patched, it will break NTMM since that relies on patches. But if you can discern what the additional patches are you could patch the 1.2.2 file used in NookManager.
Edit: but if you just want to see how it might work, you can probably use the 1.2.1 jar without any problems. When I first started working on the update to NookManager I used the original 1.2.0 jars that were provided with FW 1.2.2 and saw no evidence of problems. A diff showed very minor changes. Depending on how extensive the patching is for this mod, it might be easier--if you still want the use of NTMM--to patch the file in post #8 for NTMM since the patches are well documented on github. Otherwise you have a lot of diffs to look at and sort out.

NGL3 Screensaver Images

Hi everyone,
I have a Nook GlowLight 3. I don't like the default screensavers, so I'd like to delete them and (optionally) put in some new ones. Is this possible?
Maybe it's just a matter of getting into the Nook's file system and replacing their image files with my own (with the same filenames)?
This Nook is new. I don't mind voiding the warranty, but I'd rather not unless I know it will be worthwhile. Otherwise, I would try it myself. So I'm hoping some kind soul who has a NGL3 that they have already broken into would be willing to take a look at it for me.
Please let me know if I can help! Thank you!!
Robert
I've got too many Nooks and I'm far removed from stock.
Do you have a directory /data/sleep/
That used to have PNGs for some standby images.
Do you currently have the old, creepy authors?
I have not rooted it or anything yet, just plugged it into my Mac and looked at the default directories it comes with. There is basically nothing there– I even had to research online and experiment how to just create a directory where I could sideload a PDF. So, no, I haven't seen any directory like you mentioned. And I'm not sure what you mean about the old authors(?). The screensavers I have are Symbols and Quotes. In any case, this is my first Nook, and it's less than a week old.
So, do you think there is a good chance I could make changes to the stock screensavers?
The "old, creepy authors" were the screensavers that made the Brontë sisters look like the witches out of Macbeth.
These images are all packed away in /system/priv-app/partner.apk in res/drawable-mdpi-v4/
Code:
artboard_1.png
artboard_2.png
artboard_3.png
artboard_4.png
artboard_5.png
artboard_6.png
artboard_7.png
artboard_8.png
alexander_pope.png
chinese_proverb_00.png
cicero.png
jane_austen.png
john_wilson.png
lady_mary_montagu.png
louisa_alcott.png
robert_southey.png
thomas_jefferson.png
thomas_kempis.png
The list of images is in res/values/arrays.xml in quotes_imgs and symbols_imgs
The actual screensaver mechanism is com.nook.partner.screensaver.ScreenSaver (in partner.apk).
If you repack that all it won't have a B&N signature
I'm not sure how much that will break things.
In worst case you could resign everything.
I think that I'd just rewrite ScreenSaver to fetch PNGs from a directory like /data/sleep
That way, changing the collection would be easier.
Oh, and another thing...
As always, the sloppiness of B&N gets to me.
Those "quote" image files are ten times the size of the "symbol" image files.
Why? Because they have a very subtle dithering to the backgrounds.
It's nothing that you can see even on a regular LCD monitor, let alone on a black & white eInk panel with 16 shades.
So the file is basically trying to compress random noise. That doesn't work out well.
Below is what you get when you use the fill tool (red) in MS Paint on the image.
It leaves holes because the adjacent pixels aren't exactly the same value.
Oh, yes: I remember those goofy portraits.
OK, thank you– I really appreciate your help! I am excited to try this out when I can snag some free time. I will try to post what happened, too.
OK, I was able to pull that partner.apk file to my Mac, and unzip it. The images are there. Awesome!
So, I'm temped to create my own B&W/greyscale pngs, with the same dimensions, and give them the same file names. Then put them in the same locations, rezip (with an apk extension), and push it into place. I know it will have a different file size, etc, but do you think that will be a problem? Normally I'd just try it, but I'm trying to err on the side of caution.
Thanks!
Newtham said:
rezip (with an apk extension), and push it into place.
Click to expand...
Click to collapse
Yes, it should work.
There doesn't seem to be any problem with signatures.
I modified all my images for fun and it didn't break anything.
(Although, I've hacked so much stuff on this that the screensaver never activate. This is not my primary reading device.)
It must have some signature (the originals will do) or it won't be acknowledged as an APK.
Make sure that you keep the original file as a backup.
I'm still new to this, so basic question: what is a signature (in this case) and how do I create or modify it?
Thanks!
Newtham said:
What is a signature...
Click to expand...
Click to collapse
Signatures are the three (or more) files in the META-INF directory in the zip (apk).
If they are there, that's fine.
To learn about apk signing Google it.
@Newtham
Oh! I figured something out. I looked through the code.
If you just want to have one screensaver of your own (which you could manually change).
All you have to do is change some undocumented settings.
File: /data/data/com.nook.partner/shared_prefs/screen_saver_preference.xml
Code:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
[color=red]<boolean name="pref_key_screen_saver_from_sdcard" value="true" />
<string name="pref_key_screen_saver_from_path">/sdcard/sleep.png</string>[/color]
<boolean name="pref_key_screen_saver_low_power" value="false" />
<int name="key_screensaver_img_index" value="8" />
</map>
OK, awesome, thanks!
About a week ago, I tried just modifying the image files, rezipping & renaming to apk, and pushing into place, but I didn't modify the signatures. So now I'm stuck on the boot screen. (I forced it off in the meantime, but since it's e-ink, its still showing the boot screen.)
I can still see it on the command line via adb, but I no longer have write permission so I can't push the original apk back into place. So that's my next task. I haven't had time to play with it since then. It's fun playing with this, I just wish I had more time.
Newtham said:
I no longer have write permission...
Click to expand...
Click to collapse
Well, you did it once, it's just a question of making /system rw:
Code:
# mount -o rw,remount /system
One of the silly things that B&N did was making the "screensaver" and the "wallpaper" the same thing.
I'll have to write some code to make them separate things.
Lol! As I dived into this I realized that I had been all over this ground before.
The stuff I wrote in https://forum.xda-developers.com/showpost.php?p=79994025&postcount=11 about using settings to disable the B&N wallpaper is true but not necessary.
You can disable all that silliness with:
Code:
# pm disable com.nook.partner/.daydream.DayDream
You can set a simple white wallpaper using my Wallpaper.apk app available in the signature
The wallpaper only appears as a background to a launcher (or any app that has no background).
The Glow3 4.7 & Glow4 5.0 both broke the Wallpaper, you need a separate patch for that, see below.
I had previously made a patch to cycle through user supplied PNGs as a lock screen.
That patch is available in the signature as nook45patch.zip
Code:
C:\> adb pull /system/framework/android.policy.jar
C:\> apktool d android.policy.jar -o AP
C:\> mergesmali /v \AP\smali Screen.smali
C:\> apktool b AP -o android.policy.jar
Then replace android.policy.jar and delete/backup/rename/whatever android.policy.odex
Then stuff your PNGs in /data/sleep
Erm, I think this mostly applies to Glow2 4.5
I'll look more closely at Glow3 4.7
glow45patch.zip works fine on the Glow3 4.7 & Glow4 5.0
So, the nook45patch.zip works fine on the Glow3 4.7
I kind of confused myself, strange things happen if you have no images in data/sleep.
I'll look into that too.
The Glow3 & Glow4 have this problem where B&N stole the functionality of wallpaper for sleep screen.
The background on launchers appears black even though the Wallpaper API changes /data/system/users/0/wallpaper correctly.
I should be able to solve this one too.
There was a minor bug in the old patch.
It would barf if you didn't have any user images.
The new glow45patch.zip is in the signature under mergesmali.
The aforementioned glow45patch.zip is a valid patch for Glow3 4.7 too.
There is also the issue of the black Wallpaper on Glow3 4.7 when using a stock Launcher.
Does anybody else have this/notice it/care?
With 4.7 B&N got rid of /system/priv-app/SystemUI.apk and put it all into /system/priv-app/partner.apk
This necessitated a change in the WallpaperManager since it's all a different package.
The actual ImageWallpaper.DrawableEngine.drawFrame() is a bit complicated.
I couldn't (be bothered to) figure out how it was supposed to work and where it was failing.
To my taste, anything other than solid white wallpaper on an eInk device is just distracting.
I wrote a small patch to make drawFrame() just drawColor() instead of scaling and rotating Wallpapers.
Is there any interest in that?
I have been working on this, but I can't get write access via adb anymore. I have tried everything I can think of, including your suggestion above. I can log in to the adb shell and run as root and make changes there. But anytime I try to push anything with adb, it tells me it is read-only. When I run rootnook.sh, it tells me I'm already rooted, but no superSU found (and then roots again, with no different results). adb root doesn't work, either.
The only major thing that's changed recently is that I installed the latest nook update, which I thought would be a good idea before I start hacking. Maybe that messed it up.
I'm stumped (which is not difficult to do...). Any suggestion on how to get back in there?
Thanks!
You probably de-rooted yourself.
Does adb shell give a # prompt?
Does the shell command "id" tell that you are root?
Does the shell command "mount" tell you that /system is rw?
Does the shell command "getprop ro.secure" say 0 (security is off)?
When in doubt, push to sdcard and then copy (cp) to where it should be.
Thanks! Moving it to sdcard did the trick.
I unpacked the apk with apktool, edited the images directly (didn't change the file names), repacked it with apktool, and then (finally, by using the sdcard directory) got it back to the Nook. And then copied it into place. But I still get the same results: the GUI gets stuck on the boot screen.
So, do you think this has to do with signing the apk file? I did a lot of research on it, but mostly what I found was how to sign your own file, not someone else's. Do you have any tips on how I can do this (if that's what's needed)? Thanks!!
(P.S. Thanks for the info on the glow45patch. I haven't had a chance to look at it too closely yet, but it looks interesting. I'd still like to mod the actual pics, though, if I can.)

Categories

Resources