[TUT]Revive your(original) framework-res.apk when boot looping caused by modding - HD2 Android Q&A, Help & Troubleshooting and Genera

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.

Related

[HOW-TO]--Stock Bootscreen w/ Sound

Well here we go, this will revert your bootscreen to the Stock Verizon Android Bootscreen with Sound.
(Verizon animation then waving droids, followed by the HTC animation)
!!!! THIS IS FOR ROOT USERS ONLY !!!!
This has not been tested with any Non-Root ROM!
This HOW-TO was put together on a Windows Machine, Please adjust your syntax if you are using linux.
This has been tested on the Plain Jane ROM (Thanks Jcase!!) And confirmed working on Ivan's ROM (Thanks pkopalek)
EDIT [6/9/10 @ 3:39pm EST]: THIS WORKS ON Eris-based ROMs ONLY at this time. I will be experimenting with other ROM's and will post my findings.
This Bootscreen was pulled from the Downgrade.zip included in this post:
Android Fourms
Please give credit where credit is due. All i did was get all together and write this HOW-TO.
1. Download this zip ... bootscreen_Stock_Sound
And Extract to any location on you computer. You should have a folder named bootscreen with some xml,mp3,and gif files.
2. if you have pushed a bootscreen to /data/local, delete it.
Code:
adb remount
adb shell rm /data/local/bootanimation.zip
3 Enter the adb shell and cd to /system/media and list contents.
Code:
adb remount
adb shell
cd /system/media
ls
Back up the bootanimation.zip located here.
Code:
cp bootanimation.zip bootanimation.bak
or delete it.
Code:
rm bootanimation.zip
Exit shell
Code:
exit
4. Now to push the animation to /system/media
<your-save-path-here> is where you extracted the RAR. When extracted you will have folder named bootscreen_Stock_Sound with a nested folder named bootscreen.
I downloaded the rar to the desktop on Win 7 so my path would be:
C:\Users\Lostbytes\Desktop\bootscreen_Stock_Sound\bootscreen
NOT: C:\Users\Lostbytes\Desktop\bootscreen_Stock_Sound\bootscreen\
as this will nest the folders.
Code:
adb push <your-save-path-here>\bootscreen /system/media/bootscreen
Wait for it to finish.
EDIT:For those having problems with a black boot screen, please enter the following to set the permissions on the bootscreen folder.
Code:
adb remount
adb shell chmod 775 /system/media/bootscreen
5. To Test.
Code:
adb remount
adb shell
bootanimation
PRESS Ctrl-C to return to the shell.
Now a creative person with the inclination, should be able to modify the contents of the bootscreen xml file to use custom sounds and animations. Have Fun All
TO THE DEVS:
Thank you for all your hard work day in and day out. Without people like you, this scene would not exist.
Have Fun
Have Fun Everyone!!!!!!
I've been thinking about this bootscreen for a long time.
Thank you for this.
And for what it's worth, with all the files in place,
my Evil Eris boot animation is just a blank, black screen.
Hmm..... I'm missing something.
I thought this had to be in a ZIP format...
After downloading ..it is a RAR file...
bukada said:
I thought this had to be in a ZIP format...
After downloading ..it is a RAR file...
Click to expand...
Click to collapse
This is not the common Bootanimation.zip!!!
Please read the directions, this is the old Style bootanimation format. (using a XML instruction sheet, NOT the desc.txt file w/ png in zip format) This allows much more control. You mush first back up or remove any and all Bootanimations on your phone.
pkopalek said:
And for what it's worth, with all the files in place,
my Evil Eris boot animation is just a blank, black screen.
Hmm..... I'm missing something.
Click to expand...
Click to collapse
Did you back up or remove the bootanimation in
/data/local
/system/media
also if /system/media already has a bootscreen folder delete it and replace it with the one from the RAR.
Bootanimation formats as far as i know are:
/data/local/bootanimation.zip
/system/media/booanimation.zip
/system/media/bootscreen/<XML,Gif,MP3 files>/
This bootscreen is the last format. It works on a ERIS running Plain Jane, Will post vid soon.
pkopalek said:
And for what it's worth, with all the files in place,
my Evil Eris boot animation is just a blank, black screen.
Hmm..... I'm missing something.
Click to expand...
Click to collapse
Same here. Followed the instrucations and only have a blank screen now during boot up. Is a step missing?
lostbytes said:
Did you back up or remove the bootanimation in
/data/local
/system/media
also if /system/media already has a bootscreen folder delete it and replace it with the one from the RAR.
Bootanimation formats as far as i know are:
/data/local/bootanimation.zip
/system/media/booanimation.zip
/system/media/bootscreen/<XML,Gif,MP3 files>/
This bootscreen is the last format. It works on a ERIS running Plain Jane, Will post vid soon.
Click to expand...
Click to collapse
All checkpoints check.
This is also pretty standard for all of Android, so I am baffled as to why we're getting black bootscreens!
pkopalek said:
All checkpoints check.
This is also pretty standard for all of Android, so I am baffled as to why we're getting black bootscreens!
Click to expand...
Click to collapse
I will recreate the procedure from the beginning . All i did was pull the original boot screen from Android 1.5 and push to my phone, Maybe i missed documenting something.....But it is a simple operation. Will post again soon.
Yeah, I see.
I even pulled apart downgrade.zip (which I have on my computer) and looked at it myself, just in case a file got corrupted or something.
I can't figure it out!
Maybe this needs to be turned into a bootanimation.zip for some ROMs?
pkopalek said:
Yeah, I see.
I even pulled apart downgrade.zip (which I have on my computer) and looked at it myself, just in case a file got corrupted or something.
I can't figure it out!
Maybe this needs to be turned into a bootanimation.zip for some ROMs?
Click to expand...
Click to collapse
Its possible, I will look into it some more, What baffles me is that works for me!!! It may be ROM dependent but i am just recreating the file structure with no modifications from the original. So, in theory the ROM should not matter.
I tried grabbing the /system/bin/bootanimation file from another ROM (so that the 'bootanimation' command would maybe work?) to see if that makes the difference, but it doesn't seem to.
It seems like something silly is missing! I even did a Root Explorer search for anything with the word 'boot' in it to see what could be causing the trouble, but I don't see anything at all! The only things with 'bootscreen' or words like it is in the /system/media/bootscreen/ folder that is there (because I put it there).
Baffling!
Here are screens of what i did, I recreated the whole process and it worked fine for me. Again i am running the Plain Jane ROM (Thanks to Jcase) if that matters.
link To Screen
Hope this helps!!!
I confirmed this DOES seem to work on normal Eris-based ROMs like yours (Ivan's 1.0, in my case)
but NOT on EvilEris.
pkopalek said:
I confirmed this DOES seem to work on normal Eris-based ROMs like yours (Ivan's 1.0, in my case)
but NOT on EvilEris.
Click to expand...
Click to collapse
Would you like me to post the bootanimation file from /system/bin?
maybe replacing this file with mine might solve the issue...
File located here........... Bootanimation
Please let me know if this resolves the issue. If not i will install EvilEris and try to recreate.
Same exact success rate.
I also had to chmod your 'bootanimation' to make it work, but that may or may not be related to me downloading/pushing it from a Windows machine.
Neither here nor there, just a black screen.
Blah.
pkopalek said:
Same exact success rate.
I also had to chmod your 'bootanimation' to make it work, but that may or may not be related to me downloading/pushing it from a Windows machine.
Neither here nor there, just a black screen.
Blah.
Click to expand...
Click to collapse
pkopalek, Would you please, in root explorer, goto /system/media/bootscreen and list its contents? there should be a bunch of files and NO folders. I thinks my code was nesting the files in a second bootscreen folder.
lostbytes said:
pkopalek, Would you please, in root explorer, goto /system/media/bootscreen and list its contents? there should be a bunch of files and NO folders. I thinks my code was nesting the files in a second bootscreen folder.
Click to expand...
Click to collapse
Nope. Exactly the contents it should have.
android_audio.mp3, android_audio.mp3_, boot.gif, boot.mp3, boot_animation.xml, etc etc etc.
Certainly no folders in here. Exactly the contents it should have.
/system/media/bootscreen
same contents as C:\Documents and Settings\Administrator.PAULSTERM1\Desktop\android\downloads\bootscreen
which is where I extracted the bootscreen contents (twice, once from your download, once from my own downgrade.zip. same results.)
pkopalek, Would you please, in root explorer, goto /system/media/bootscreen and list its contents? there should be a bunch of files and NO folders. I
Click to expand...
Click to collapse
Nope. Exactly the contents it should have.
android_audio.mp3, android_audio.mp3_, boot.gif, boot.mp3, boot_animation.xml, etc etc etc.
Certainly no folders in here. Exactly the contents it should have.
/system/media/bootscreen
same contents as C:\Documents and Settings\Administrator.PAULSTERM1\Desktop\android\downloads\bootscreen
which is where I extracted the bootscreen contents (twice, once from your download, once from my own downgrade.zip. same results.)
Click to expand...
Click to collapse
This may be obvious, but make sure to check the permissions on the folder itself.
Try this, then reboot.
adb remount
adb shell chmod 775 /system/media/bootscreen
-------------------------------------
Sent via the XDA Tapatalk App

[Q] Droid 2 Boot Animation

Hello everyone,
I have recently been messing around with my droid 2 and was able to change the boot screen successfully by doing the following commands:
PHP:
adb push bootanimation.zip system/media/
After running this command I had the new animation and that works great. My question is if anyone know how to incorporate a boot up sound with this. I have tried creating a bootscreen folder and having the boot_animation.xml in both the system/media path and the system/media/bootscreen path, however to no success. It is to be noted that when I removed the bootanimation.zip from the system/media folder, it defaults to the original blue android loading animation as if it were not seeing a bootscreen folder.
theecho said:
Hello everyone,
I have recently been messing around with my droid 2 and was able to change the boot screen successfully by doing the following commands:
PHP:
adb push bootanimation.zip system/media/
After running this command I had the new animation and that works great. My question is if anyone know how to incorporate a boot up sound with this. I have tried creating a bootscreen folder and having the boot_animation.xml in both the system/media path and the system/media/bootscreen path, however to no success. It is to be noted that when I removed the bootanimation.zip from the system/media folder, it defaults to the original blue android loading animation as if it were not seeing a bootscreen folder.
Click to expand...
Click to collapse
What is the boot animation that you used and is is just as simple as removing the boot animation that is in the system media file and replacing it with another boot animation like what was done with the D1?
Yes it was pretty simple just do the following
PHP:
adb pull system/media/bootanimation.zip
This will pull you current boot animation. Move it somewhere to keep as a backup.
PHP:
adb push bootanimation.zip system/media/
This is assuming bootanimation.zip is located in you android sdk's tools folder. You can use any of the bootanimations that are an assortment of pngs.
Sent from my DROID2 using XDA App
I wonder what would happen if you had one in data/local
bump*
Anyone have any further info on this? I would really like a startup sound again.
theecho said:
Yes it was pretty simple just do the following
PHP:
adb pull system/media/bootanimation.zip
This will pull you current boot animation. Move it somewhere to keep as a backup.
PHP:
adb push bootanimation.zip system/media/
This is assuming bootanimation.zip is located in you android sdk's tools folder. You can use any of the bootanimations that are an assortment of pngs.
Sent from my DROID2 using XDA App
Click to expand...
Click to collapse
Ok if the boot animation is on the system media file like the D1 why cant we just take a boot animation and delete it out of the system media and replace it with a new one? Do you have to ADB push it?
The boot animation is kept in the system/media folder. If you can replace this by another means, it will work. I chose to use adb push as I was already in my command line due to an application i was writing.
help
hey guys, sorry for the noob question, but what r u guys using to zip your finnished product? (not a flashable zip) just the zip u can push or use root expor to just place in correct spot. i know you cant use anycompression, but ive tryed everything and i must be doing something wrong. to make sure my zip methods are not adding any compression, i pulled my orig bootanimation, which zipped is 6114kb, i unzipped, then rezipped, and i keep getting dif sized zip files.. if done right it should be the exact same size right?
using the following this is what i get
ok oring is 6114kb, heres what the others do, 7zip 6124kb(bigger) PC zip client 6086kb and winrar is the closest at 6119kb
any advice would be greatly apr
Does doing ADB push require you to plug the phone into the computer in PC mode?
Also, can you change boot animations on stock ROM, or only on custom ROM?
I downloaded a bootanimation.zip file that's 480x854 pixels, the same as the D2's screen. I also looked at the default bootanimation.zip file, which is 480x480. Does the resolution matter at all, or can the phone display it either way?
Tappin' and Talkin' with Tapatalk
theecho said:
Yes it was pretty simple just do the following
PHP:
adb pull system/media/bootanimation.zip
This will pull you current boot animation. Move it somewhere to keep as a backup.
PHP:
adb push bootanimation.zip system/media/
This is assuming bootanimation.zip is located in you android sdk's tools folder. You can use any of the bootanimations that are an assortment of pngs.
Sent from my DROID2 using XDA App
Click to expand...
Click to collapse
No need, you can download Super Manager from Market, using file manager function and get root access to copy directly.
Have fun.
Since this is bumped anyway, for whatever reason sounds will not work on boot with the default Rom. MIUI and other Roms are necessary for this mod.

Full Charge Popup!? Please help

Can anyone put this in a cw flashable zip or have one already? I need to get rid of the stupid popup that tells me my battery is full. It wakes me up and it seems to keep my alarm clock from going off sometimes!?
1. decompile/de-odex services.jar/odex
2. open "com\android\server\status\StatusBarPolicy.smali" in a text editor
find ".method private showFullChargePopup()V" about line 2779
and remove the entire method all of it from ".method private showFullChargePopup()V"
to .end method
and delete this line at about line 3441
invoke-direct {p0}, Lcom/android/server/status/StatusBarPolicy;->showFullChargePopup()V
3. save, compile and re-odex as necessary
Click to expand...
Click to collapse
What ROM version and theme? The services.jar file changes between roms and themes.
Blackhole 3.0 DL09
Oh my god! If you could also do this for me, or just tell me how or something ( I have no idea what the dedeoxin' does or anything) I would be forever thankful! haha
I have DJ05 Superclean JT rom
Its just an simple apk you can get rid of via root explorer or titanium backup or whatever.
In titanium its called FullBatPopupApp 1.0, I have removed it with no ill effects. The name of the apk in /system/app/ is FullbatPopup.apk
Sent from my SCH-I500 using Tapatalk
1. You need to have java installed for this. You will also need smali/baksmali
2. Open command prompt or linux terminal with your phone plugged in. Also navigate to or create a directory to perform the work in.
3. Once in your working directory, run:
Code:
adb pull /system/framework/services.jar
3a. If your system isn't de-odexed, you may need to pull an odex file as well
4. Take the smali/baksmali files you downloaded earlier and put them in the same directory that your services.jar file is in.
5. Run the following (assumes windows command prompt):
Code:
java -jar baksmali-<version>.jar services.jar
5a. If your system is not deodexed, you will likely need to deodex the system/services.jar for this to work.
6. Open the file required for the edit and make the needed changes.
7. Run the following (again, assuming windows command prompt):
Code:
java -jar smali-<version>.jar out -o classes.dex
8. Replace the classes.dex file within services.jar with the new classes.dex file
9. Push the file to /system/framework with adb, then reboot:
Code:
adb push services.jar /system/framework/services.jar
adb reboot
9a. You may need to remount the /system partition as rw to push the file.
10. On restart, the phone will take longer to boot, but assuming the changes were made properly you should be good.
I left out some information for the "a" steps on purpose. If you cannot do these steps yourself, or find how to do them, you likely shouldn't be doing this on your own. As always, backup your phone/data before trying this, and I am not responsible for any lost data, non-booting phones, or bricked devices. If you are unsure of what you are doing, then don't do it.
n0yd said:
Its just an simple apk you can get rid of via root explorer or titanium backup or whatever.
In titanium its called FullBatPopupApp 1.0, I have removed it with no ill effects. The name of the apk in /system/app/ is FullbatPopup.apk
Sent from my SCH-I500 using Tapatalk
Click to expand...
Click to collapse
Removing that does nothing, already did it and I still get the popup.
Or just find the post with the hidden menu dialer codes and turn it off that way.........
Sent from my SCH-I500 using XDA App
Even the hidden dialer menu does not always work either. Plus I thought the hidden menu was not accessible in DJ05/DL09? Maybe this is with certain roms?
yea I hate that popup. Ive removed the apk also and still it keeps popping up. A fix would be greatly appreciated!!!
The dailer codes worked for me. Using Blackhole 3.0. Just make sure you include the Hidden Menu when building your rom.
Sent from my SCH-I500 using XDA App
imnuts said:
Removing that does nothing, already did it and I still get the popup.
Click to expand...
Click to collapse
Weird, I never noticed. Thanks for letting me know
Sent from my SCH-I500 using Tapatalk
+1 on getting rid of this stupid pop up.
Man I hate that thing.
I posted instructions on how to do it. I'm not going to do the mod for everyone, so do it on your own, or ask the rom builder to include the change in the rom. There are to many roms and themes out there to try and accomplish this for every possible combination.
Hidden menu method would not work for me on dj05.
Changed it to disabled and it still pops up
I just went in with root explorer and mounted system/app as RW, renamed FullBattPopup.apk to FullBattPopup.apk.OLD and it did not get recreated after a reboot. I guess I'll have to wait till a full charge to see if it comes back.
I just used Titanium Backup to freeze FullBatPopupApp.
Will report back after I change my phone....
Sent from my Samsung Fascinate
Pfredd said:
I just used Titanium Backup to freeze FullBatPopupApp.
Will report back after I change my phone....
Sent from my Samsung Fascinate
Click to expand...
Click to collapse
As I figured, freezing didn't remove the popup.
I went ahead and edited the services file, as specified earlier in this post. I followed the procedure provided by imnuts and did the edits as specified in the post by Nimhlan.
It appears to work like a charm. No more Full battery popups!
I would post my edited file, but I suspect it is dependent on what kernel/ROM you are running....
Do you download the smali 1.26.jar & baksmali 1.26 jar or just the baksmali & smali file in the link provided.
ellisz said:
Do you download the smali 1.26.jar & baksmali 1.26 jar or just the baksmali & smali file in the link provided.
Click to expand...
Click to collapse
You need the *.jar files. However, I tried making the edit and I still get the popup.

Screensave while in landscape mode

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

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.

Categories

Resources