[Q] Bootloop after editing a few XMLs? - Captivate Q&A, Help & Troubleshooting

So after decompiling framework-res.apk and editing statusbar.xml, statusbarextended.xml, and statusbarlatesteventcontent.xml I get stuck in a bootloop right after installing the ROM fresh from stock and a MC. So what could be the problem? Why would changing the text color of the statusbar cause a bootloop?

ih4ckback said:
So after decompiling framework-res.apk and editing statusbar.xml, statusbarextended.xml, and statusbarlatesteventcontent.xml I get stuck in a bootloop right after installing the ROM fresh from stock and a MC. So what could be the problem? Why would changing the text color of the statusbar cause a bootloop?
Click to expand...
Click to collapse
How did you decompile/recompile? When you recompiled, did you use the same filestructure?
Ex: /framework-res/res/drawable-hdpi instead of /res/drawable-hdpi
Did you keep the same lines and just edit the color codes? You need to give more info to let us know what you did. Any tiny mistake in editing framework-res.apk will result in a bootloop, so your case isn't diagnosable unless you tell us what you did.

.Candy said:
How did you decompile/recompile? When you recompiled, did you use the same filestructure?
Ex: /framework-res/res/drawable-hdpi instead of /res/drawable-hdpi
Did you keep the same lines and just edit the color codes? You need to give more info to let us know what you did. Any tiny mistake in editing framework-res.apk will result in a bootloop, so your case isn't diagnosable unless you tell us what you did.
Click to expand...
Click to collapse
I used apkmanager, decompiled, edited color codes only, recompiled, installed, bootloop and yes the filestructure is the same.

ih4ckback said:
I used apkmanager, decompiled, edited color codes only, recompiled, installed, bootloop and yes the filestructure is the same.
Click to expand...
Click to collapse
How did you install it. Using APK Manager? If so, that's probably the issue. I don't trust certain APK Manager options. To be safe, in the future you should only use it for decompiling, recompiling, and signing if necessary, never for re-install the APK.
Anyway, did you attempt to sign the file? framework-res.apk doesn't need to be signed, and if you do sign it, I believe it will create a boot-loop.
Also, when you recompiled it, did you go through the step that creates the "keep" folder where you delete the files that you edited? If not, then that's probably the issue. If you don't do that step, then your edited file will only contain the files that you edited. At least that's what I understand from my experience.

I copied the apk to my /system/framework folder within my custom rom and flashed the zip. I did sign the file. I'll retry without signing it and yes I did the keep step.

ih4ckback said:
I copied the apk to my /system/framework folder within my custom rom and flashed the zip. I did sign the file. I'll retry without signing it and yes I did the keep step.
Click to expand...
Click to collapse
dont sign system apks

Pirateghost said:
dont sign system apks
Click to expand...
Click to collapse
thats a good tip lol thanks I'll remember that next time I do any modding.

Related

[Q] How to edit framework-res.apk?

I'm trying to edit framework-res.apk so I can theme my rom. Are these the correct steps?
pull framework-res.apk from my phone
decompile the apk
make the changes
rebuild the apk
sign
zipalign
push apk back to device
I'm not too sure on this method as after I pushed back my modified apk, I get a load of force close errors
Any advice would be welcome
don't sign and don't zipalign and all are fine
I tried without sign and zipalign but the rom wouldnt boot. If I sign, I get force close errors
Does the rom need to be deoxed?
How is your process to decompile and recompile what tools do you use
vibez said:
I tried without sign and zipalign but the rom wouldnt boot. If I sign, I get force close errors
Does the rom need to be deoxed?
Click to expand...
Click to collapse
Sent from my GT-I9000 using XDA App
Is this an ODEXed ROM or a deOXEDed ROM? You can't mix and match. If you're not ODEXing any APKs after you've modified them then you need to make sure all APKs are deOXEDed.
setenza01 said:
How is your process to decompile and recompile what tools do you use
Sent from my GT-I9000 using XDA App
Click to expand...
Click to collapse
I use apk manager to decompile and rebuild
Benjamin Dobell said:
Is this an ODEXed ROM or a deOXEDed ROM? You can't mix and match. If you're not ODEXing any APKs after you've modified them then you need to make sure all APKs are deOXEDed.
Click to expand...
Click to collapse
It is a stock rom but there is no framework-res.odex does that mean it doesn't need deodexing even though there are odex files for every other apk in my system folder?
maybe this little monster is some help to you:
http://forum.xda-developers.com/showthread.php?p=7377678#post7377678
FadeFx said:
maybe this little monster is some help to you:
http://forum.xda-developers.com/showthread.php?p=7377678#post7377678
Click to expand...
Click to collapse
Nice app but this theme also needs .xml changes which this app doesnt support
ok, i put him a note in his thread about the xml changing issue, we will see what hes answer will be...
edit:
also this software could do the trick: http://android.modaco.com/content/t-mobile-pulse-pulse-modaco-com/302404/ande-android-design-editor/
I've been playing around a little more today and it seems the issue is that no tool can rebuild the xml files correctly, they seem to be compressed/encoded.
Has anyone been able to edit an xml file in framework-res.apk and have the phone read it properly?
vibez said:
I've been playing around a little more today and it seems the issue is that no tool can rebuild the xml files correctly, they seem to be compressed/encoded.
Has anyone been able to edit an xml file in framework-res.apk and have the phone read it properly?
Click to expand...
Click to collapse
Refer to my signature. Apk manager.
Edit : just read ur op.
Never sign the system apk's. Simply keep the original signatures intact and after recompiling them, re-include them.
So here are the rules u must follow :
If u've modified the manifest.xml, u must stop core, push the apk, start core or push the apk while in recovery.
If u've modified anything else, a simple push / reboot will do the trick.
Note, u cannot flash a modified system apk the first time (as in on a clean boot), u must flash the original rom, let it build the dex's and then flash ur modified apk.
Daneshm90 said:
Refer to my signature. Apk manager.
Edit : just read ur op.
Never sign the system apk's. Simply keep the original signatures intact and after recompiling them, re-include them.
Click to expand...
Click to collapse
Hi, I am already using apk manager but the xml files it creates do not seem to work.
To prove this, I have done a test. See the attached xml files,
original_stat_sys_battery.xml was extracted from the original framework-res.apk
I then used apk manager to decompile and then recompile the same apk without making any changes.
recompiled_stat_sys_battery.xml is this recompiled file
I then opened up both files and they look different to me
vibez said:
Hi, I am already using apk manager but the xml files it creates do not seem to work.
To prove this, I have done a test. See the attached xml files,
original_stat_sys_battery.xml was extracted from the original framework-res.apk
I then used apk manager to decompile and then recompile the same apk without making any changes.
recompiled_stat_sys_battery.xml is this recompiled file
I then opened up both files and they look different to me
Click to expand...
Click to collapse
That shouldn't concern u. Apktool's method of rebuilding the apk/arsc file is slightly different than how android originally builds an apk. What should concern u is if the apk simply works. Now when u decompile the apk, can u check the log to see if it reports of any missing resources, if it doesn't ur fine. So decompile the apk, make ur changes, recompile the apk, move the original meta-inf folder into ur new apk and push it to ur phone following the guidelines in my previous post. if it causes problems, post ur log and i'll take a look.
Ok this time I have added meta-inf to the new apk, pushed it to my phone and the phone hangs on boot.
Here is my log
--------------------------------------------------------------------------
|08/08/2010 -- 18:36:30.87|
--------------------------------------------------------------------------
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the path specified.
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
'adb' is not recognized as an internal or external command,
operable program or batch file.
Could Not Find C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged.apk
Could Not Find C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-signed.apk
Could Not Find C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-unsigned.apk
The system cannot find the file specified.
I: Loading resource table...
I: Decoding resources...
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'keyguard_password_attempts_count_pin_code' has no default translation in C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\other\..\out\res; found: fr ko
I: Building apk file...
Click to expand...
Click to collapse
Oh lol i meant the log of ur phone.
Use adb logcat
lol ok, at which point should I run logcat - after the hang or as soon as I switch the phone on?
vibez said:
lol ok, at which point should I run logcat - after the hang or as soon as I switch the phone on?
Click to expand...
Click to collapse
When u switch phone On.
Ok here you are
vibez said:
Ok here you are
Click to expand...
Click to collapse
Heres ur culprit
Code:
java.lang.SecurityException: META-INF/MANIFEST.MF has invalid digest for AndroidManifest.xml
Now seems u modified the androidmanifest.xml ? If u didn't then heres my recommendation, copy over the original androidmanifest.xml from the original apk.

APK Manger

So I want to mess with DialerTabActivity.apk. I know what I will do in terms of XML edits. I decompile it fine, with option 9. When I edit, it won't recompile when I say it isn't a system APK. When I say it is, it compiles but when I throw it onto my phone it doesn't show up as an app. Throw the old one in, it shows up immediately. I also tried option 10 and pointed it to my twframework-res.apk and this way it WILL recompile as a non-system APK. But it still doesn't work on my phone. I also tried signing it with both system and non-system APK compiled versions from the option 10 decompile. How do you properly de/recompile this APK so it works?
You have to say Yes when it asks if it's a system app.
Is it themed in anyway?
Could be compression.
MikeyMike01 said:
You have to say Yes when it asks if it's a system app.
Is it themed in anyway?
Could be compression.
Click to expand...
Click to collapse
Thanks, I'll try system app. Needs to be signed?
And I set my compression to 0, that's what I heard is necessary for JPY
EDIT: Set compression to 0, decompiled with dependencies and pointed it to twframework-res.apk, edited the XML, and recompiled it as a system APK and it worked. Now sign and push?
Also yes, it is themed. I threw in new PNG's. Otherwise it is the original Perception 10.1 dialer
Haloruler64 said:
Thanks, I'll try system app. Needs to be signed?
Click to expand...
Click to collapse
System apps should NOT be signed. That's actually what APK Manager is asking. If you notice, it says unsignedWhatever.apk.
And I set my compression to 0, that's what I heard is necessary for JPY
Click to expand...
Click to collapse
Good.
Also yes, it is themed. I threw in new PNG's. Otherwise it is the original Perception 10.1 dialer
Click to expand...
Click to collapse
If any of those are xxxxx.9.png files, then that's your problem. And I know how to fix it.
EDIT: Set compression to 0, decompiled with dependencies and pointed it to twframework-res.apk, edited the XML, and recompiled it as a system APK and it worked. Now sign and push?
Click to expand...
Click to collapse
If you don't have .9 png errors, then yes.
MikeyMike01 said:
System apps should NOT be signed. That's actually what APK Manager is asking. If you notice, it says unsignedWhatever.apk.
Good.
If any of those are xxxxx.9.png files, then that's your problem. And I know how to fix it.
If you don't have .9 png errors, then yes.
Click to expand...
Click to collapse
Ok renamed from unsigned to the original name, threw it onto my SD, and used Root Explorer to push it to /system/app/ and now it's gone from my launcher. I assume this is 9.png errors?
I realized what you meant by .9.png errors, so when it asked about preventing errors I said yes and deleted resources.arsc *sp and the XML I edited, and it worked! Thanks a LOT for your help
Glad to help.

framwork-res.apk modifying

Hi,
i'am searching for a guide how to manipulate correctly the framework-res.apk.
All ways i have tested fails.
I would modify some symbols in Notification bar (battery 1%) but all Time the my Phone run into bootloop or all Application Crashes after Startup.
I've tryed Apk Manager 4.9 / and Manualy with apktool.
Help plz .....
what i did :
1-extract apk (i use 7zip/WinRAR)
2-edit/replace image file(s)
3-repack with zero compression level ('store' level)
4-sign the apk
5-replace file using apk or create flashable recovery zip.
regards.
signing the framework-res.apk will not work.. will make the device go into bootloop
what you need is extract the framework-res.apk using apktool and edit the things you want and then compile it again using apktool .... now open the original framework-res.apk and replace the file resources.arsc with the edited compiled one..
this way you will retain the signature of the original framework-res.apk
PapaDocta said:
signing the framework-res.apk will not work.. will make the device go into bootloop
what you need is extract the framework-res.apk using apktool and edit the things you want and then compile it again using apktool .... now open the original framework-res.apk and replace the file resources.arsc with the edited compiled one..
this way you will retain the signature of the original framework-res.apk
Click to expand...
Click to collapse
But when i add some new Files and Edit some XML the Sign will be Corrupted ?
no it won't...
You need to do two copies.. the original file and the moded one...
1. make a backup of the original file
2. extract the original file using apktool
3. edit and modify anything you like
4. compile the edited file
5. rename the compiled file to framework-res.zip and take the modified resources.arsc
6. using winrar or 7zip open (to view not extract) the backed up framework-res.apk
7. place the moded resources.arsc into the backed up framework-res.apk
by doing this you retain the original signature of the backed up file and not breaking it..
Thx, will test it ;-)
kowalski99 said:
But when i add some new Files and Edit some XML the Sign will be Corrupted ?
Click to expand...
Click to collapse
Android system, signs system apk's on boot, you shouldnt sign them
Sent from my Desire HD using Tapatalk
My signed apk just work well.
AFAIK, we only cant re-sign htc's apk.
PapaDocta said:
signing the framework-res.apk will not work.. will make the device go into bootloop
what you need is extract the framework-res.apk using apktool and edit the things you want and then compile it again using apktool .... now open the original framework-res.apk and replace the file resources.arsc with the edited compiled one..
this way you will retain the signature of the original framework-res.apk
Click to expand...
Click to collapse
The right approach always depends, what you want to change. There is no need to decompile, if you only change a few standard png. If you change xml in values folder like color, styles or arrays, you can certainly not delete resources.arsc - resources have nothing to do with the signature anyway. So if you want to play safe, you should insert the original Meta-Inf (signature) and Android Manifest after compile. It is also recommended to zipalign the final apk in order to reduce RAM usage.
thanks he_stheone64 for the clarification.. i reached that conclusion based on my own research on the net and yeah i used to change the XML files to add language support and that the only way that worked with me..
And be sure to have a working and up-to-date sdk before trying to use apktool...
First, using a old sdk release i got a partially working result (few graphics bugs and strange reboots), then with a badly updated sdk on top off the old i got apktool making many errors. Finally, re-installing the last sdk from start i got apktool and my resulting apk working correctly.

[Q] Editing framework-res.apk

Hey can someone give me some quick tips on how to edit it?
I edited SystemUI.apk just fine but no matter what I do to framework-res, it won't let me replace the files (I'm only replacing pngs in drawable-mdpi folder)
What error are you getting? Also, install framework with apktool
POTATO!!!!
I think he's talking about drag and drop png file ) If it's true, the solution for him is learning how to decompile apk. Becoz most of png in systemUI is png, not too many 9.png files so it's easy to replace without decompiling
devilsking said:
I think he's talking about drag and drop png file ) If it's true, the solution for him is learning how to decompile apk. Becoz most of png in systemUI is png, not too many 9.png files so it's easy to replace without decompiling
Click to expand...
Click to collapse
Yup...
Decompile the framework-res.apk with Apktool and then replace the pngs..
I can't recompile because apktool always crashes when trying to recompile XML files. I'm using the AceCream framework apk instead of the stock rom one...
I'll try this on another PC to see if it's some weird software glitch
ZakooZ said:
I can't recompile because apktool always crashes when trying to recompile XML files. I'm using the AceCream framework apk instead of the stock rom one...
I'll try this on another PC to see if it's some weird software glitch
Click to expand...
Click to collapse
Try APK manager...much easier...
ZakooZ said:
I can't recompile because apktool always crashes when trying to recompile XML files. I'm using the AceCream framework apk instead of the stock rom one...
I'll try this on another PC to see if it's some weird software glitch
Click to expand...
Click to collapse
Tell me the definition of your "crashes"
it will show errors if u did smth wrong, even u use apkmanager )
For me apktool is more easier
devilsking said:
Tell me the definition of your "crashes"
it will show errors if u did smth wrong, even u use apkmanager )
For me apktool is more easier
Click to expand...
Click to collapse
Well, apktool dumps a stack trace where the error seems to occur in a public.xml file, apk manager says there is a error but the log shows nothing for me
https://www.dropbox.com/s/hbgqlo8pkfff10p/framework-res.apk
Can you test if you can modify this file without errors?
ZakooZ said:
Well, apktool dumps a stack trace where the error seems to occur in a public.xml file, apk manager says there is a error but the log shows nothing for me
https://www.dropbox.com/s/hbgqlo8pkfff10p/framework-res.apk
Can you test if you can modify this file without errors?
Click to expand...
Click to collapse
Oh...The infamous apktool bug...Use another version of apk tool and compile,will work
POTATO!!!!

[guide]easy apk modding (linux)

Most of the guides ive read on XDA say you have to decompile and recompile APKS just to make a couple of modifications to the images. Well I dont believe this to be true. I have tested my method on ubuntu 14.10 and with my nexus 5.
This guide is specifically for modifying images inside of the apks, not the code, or xml itself.
- ADB pull the APK file you want to modify (i chose SystemUI.apk)
- Double click it in File Manager on ubuntu, this should open it up in the archive manager. If not, manually open it up in archive manager
- Click on the "Add Files" button and select which files you want to replace. It will automatically overwrite the current ones.
- Make sure that you are keeping the proper directory structure and are putting the images in the proper place with proper names.
- Copy the new APK file back to your device on /sdcard/file.apk
Then, to get the APK file back on your system without causing problems, I rebooted into TWRP, mounted system and went into the file manager and copy/pasted the APK in the appropriate folder. When you get back into android, chmod 644 new-file.apk. I would not suggest trying to copy the modified APK file into your system while android is running live. Thats why I did it in TWRP. It could cause system unstability, crashing, etc... Im sure that I am not the first person to realize this could be done, but I did discover this on my own because I like to try things. PLEASE, make a backup in case something doesnt work correctly after your mod. Good luck!
bynarie said:
Most of the guides ive read on XDA say you have to decompile and recompile APKS just to make a couple of modifications to the images.
Click to expand...
Click to collapse
Mine doesn't.
XperienceD said:
Mine doesn't.
Click to expand...
Click to collapse
Um, not to be rude but the guide on your signature shows using apktool to decompile and recompile. Soo....? Unless its another guide. And Im not saying ALL guides are, but some, and thats ok. Could you link me to your guide please? I would love to take a look at it. Thanks
EDIT - woops im sorry i didnt really read it... i do see where it says drag and drop the images... good deal. sorry
bynarie said:
Um, not to be rude but the guide on your signature shows using apktool to decompile and recompile. Soo....?
Click to expand...
Click to collapse
Edit: No need for my original reply as you found it.
XperienceD said:
Edit: No need for my original reply as you found it.
Click to expand...
Click to collapse
Yes, and your guide is very good. Thank you for that.

Categories

Resources