[Q] Re-compile framework-res.apk - Android Q&A, Help & Troubleshooting

I am trying to make some minor changes to framework-res.apk in /res/values/bools.xml
I used apktool to decompile and make my changes but I am not sure how to properly re-compile.
Just "apktool b framework-res" errors out with invalid resource names.
Finally got it to re-compile by pasting the resource.arsc. from original apk(Dunno if this is correct way)
Then, after re-compile I paste the META-INF from the original apk.
I am hesitant to push this onto my phone now because to file sizes of the modified and original .apk differ by like 2mb. And theres 100 more files in /res of the modified .apk. (Now shows file I was trying to access by decompiling before)
Can I safely push the .apk? or am I doing it completly wrong?
Thanks!
( I did search forums and web before, but did not find anyone having to copy resource.arsc before re-compiling)

trailblazerz11 said:
I am trying to make some minor changes to framework-res.apk in /res/values/bools.xml
I used apktool to decompile and make my changes but I am not sure how to properly re-compile.
Just "apktool b framework-res" errors out with invalid resource names.
Finally got it to re-compile by pasting the resource.arsc. from original apk(Dunno if this is correct way)
Then, after re-compile I paste the META-INF from the original apk.
I am hesitant to push this onto my phone now because to file sizes of the modified and original .apk differ by like 2mb. And theres 100 more files in /res of the modified .apk. (Now shows file I was trying to access by decompiling before)
Can I safely push the .apk? or am I doing it completly wrong?
Thanks!
( I did search forums and web before, but did not find anyone having to copy resource.arsc before re-compiling)
Click to expand...
Click to collapse
FOr me, APKtool works as ****...
What you can do: pull /system/framework/framework-res.apk ~/backup
and then you can push. If it doesn't work, then boot into recovery, select mount system and push back the old one.
OT: I don't get why you should use original resources.arsc...
offtopic: when I decompile framework-res using apktool, I get other file structure then normal extract. example: my framework-res doenst have a raw-folder, but apktool decompiled has...

mDroidd said:
FOr me, APKtool works as ****...
What you can do: pull /system/framework/framework-res.apk ~/backup
and then you can push. If it doesn't work, then boot into recovery, select mount system and push back the old one.
OT: I don't get why you should use original resources.arsc...
offtopic: when I decompile framework-res using apktool, I get other file structure then normal extract. example: my framework-res doenst have a raw-folder, but apktool decompiled has...
Click to expand...
Click to collapse
This is due to the raw folder being combined into the resources file. Search for apkmultitool it is a far easier tool to use and will do everything you need. That goes for both posts

Before doing that, create a flashable zip containing the framework-res.apk file which you can use in case you get a black screen or something.
So that you don't have to restore.

You do realize that resources.arsc, aka resources directory is the collection of xml and other data. You take it from another ROM, how on earth will your xml edits be preserved?
Sent from my HTC Desire using Tapatalk

I need to edit the bools.xml file in framework-res.apk and an a bit stuck on the apktool. I used the APK Multitool to decompile the framework-res.apk file. I then used notepad++ to edit the bools.xml file. I then recompiled it using the APK Multitool and pushed it to /system/framework overwriting the original (after first making a copy of the original). On reboot the phone is stuck in a boot loop.
I managed to use ADB shell to restore the original file and it now boots (I lost all the synchronise stuff but not a big deal). So I have been searching and have found various posts about the later versions of apktool not working very well.
I have a fairly clean Windows 7 x86 installation with Java 1.6 and am using this to do the work on. Can someone point me in the right direction as to how to edit/recompile the framework-res.apk file?
Andy

I actually also trying to edit bools.xml located in framework-res.apk
I'm using Apk Changer it may be easier.
after some tries (and bootloops) I've managed to do some changes in framework-res : replacing pictures -> It works
after decompiling the apk, when I edit values within bools.xml , & then choose to compile, it creates a folder called "keep" and i have to delete edited files in that folder so as to replace them by my customized files.
BUT I don't find the folder "values" that contains bools.xml . Therefore, the generated apk will not make changes done in bools.xml .
Does anyone has any idea about Editing that xml ?
More details & Tuto :
http://forum.xda-developers.com/showthread.php?t=916814
http://forum.xda-developers.com/showpost.php?p=9066440&postcount=1
http://forum.xda-developers.com/showpost.php?p=9978779&postcount=62
@ADB100
Advanced Decompiling
Sometimes, you have that pesky app that just won't decompile correctly. Usually, it's an app related to others, like a proprietary system app based off framework-res.apks.
When this happens, you need to ensure that the frameworks are there to have the app's recourse tables properly compile.
For either apktool or apk manager, find a folder on your computer called "apktool."
The should be a folder in here called "framework," and inside that, a 1.apk.
For an app that is dependent on the framework-res.apk in a specific phone/rom, take the framework-res.apk for that rom and rename it 1.apk.
Replace the default one in the folder with yours.
If there's a second one, like the twframework-res.apk for Samsung phones, rename it 2.apk and place it in the "framework" folder.
Now, decompile like normal, and everything should be good
//By theimpaler747
Click to expand...
Click to collapse
-Yasser-

-yasser- said:
I actually also trying to edit bools.xml located in framework-res.apk
I'm using Apk Changer it may be easier.
after some tries (and bootloops) I've managed to do some changes in framework-res : replacing pictures -> It works
after decompiling the apk, when I edit values within bools.xml , & then choose to compile, it creates a folder called "keep" and i have to delete edited files in that folder so as to replace them by my customized files.
BUT I don't find the folder "values" that contains bools.xml . Therefore, the generated apk will not make changes done in bools.xml .
Does anyone has any idea about Editing that xml ?
More details & Tuto :
http://forum.xda-developers.com/showthread.php?t=916814
http://forum.xda-developers.com/showpost.php?p=9066440&postcount=1
http://forum.xda-developers.com/showpost.php?p=9978779&postcount=62
@ADB100
-Yasser-
Click to expand...
Click to collapse
The values folders get compressed into the resources.arsc file so in the keep folder delete this file and your changes will stick

not sure if you got this figured out yet but if not heres how the whole process should go.
Code:
apktool if framework-res.apk
if on a sense based rom do this too
Code:
apktool if com.htc.resources.apk
change to the directory where your framework-res.apk is
Code:
apktool d -f framework-res.apk out
or something like this if apktool is not in your path
Code:
apktool d -f ~/Desktop/framework-res.apk ~/Desktop/out
easy way to build is to cd to out folder
Code:
cd ~/Desktop/out
to build apk
Code:
apktool b
then just sign apk if needed
if you are on linux you can try this:
http://forum.xda-developers.com/showthread.php?t=1446233

wes342 said:
not sure if you got this figured out yet but if not heres how the whole process should go.
Code:
apktool if framework-res.apk
if on a sense based rom do this too
Code:
apktool if com.htc.resources.apk
change to the directory where your framework-res.apk is
Code:
apktool d -f framework-res.apk out
or something like this if apktool is not in your path
Code:
apktool d -f ~/Desktop/framework-res.apk ~/Desktop/out
easy way to build is to cd to out folder
Code:
cd ~/Desktop/out
to build apk
Code:
apktool b
then just sign apk if needed
if you are on linux you can try this:
http://forum.xda-developers.com/showthread.php?t=1446233
Click to expand...
Click to collapse
Thanks for this. This is what I have done but it hasn't worked for me so far. I am not sure whether I need to sign the file or not - I suspect I do?
Apart from the boot-loop another thing that worries me is the file sizes - the original framework-res.apk is 6,135,120-bytes whilst the new one is 3,319,608-bytes.
My ROM is based on the stock rooted 3.12.405.1 by nitro. The framework-res.apk already had a modification (the default wallpaper was changed) and I changed this back by just replacing the image in the .apk from WinRar and this worked fine. I want to edit the bools.xml file and get it back into the resources.arsc file.
Andy

ADB100 said:
Thanks for this. This is what I have done but it hasn't worked for me so far. I am not sure whether I need to sign the file or not - I suspect I do?
Apart from the boot-loop another thing that worries me is the file sizes - the original framework-res.apk is 6,135,120-bytes whilst the new one is 3,319,608-bytes.
My ROM is based on the stock rooted 3.12.405.1 by nitro. The framework-res.apk already had a modification (the default wallpaper was changed) and I changed this back by just replacing the image in the .apk from WinRar and this worked fine. I want to edit the bools.xml file and get it back into the resources.arsc file.
Andy
Click to expand...
Click to collapse
No you don't have to sign the framework API. System apks are signed. What edits are you trying to do?

zelendel said:
No you don't have to sign the framework API. System apks are signed. What edits are you trying to do?
Click to expand...
Click to collapse
All I want to edit is the bools.xml file so I can enable the SIP client to work over 3G: i.e. change this line in the file and re-cook it
Code:
<bool name="config_sip_wifi_only">true</bool>
This is potentially the 1st step though. If I can sucessfully edit this then I will probably try other things.
Andy

ADB100 said:
All I want to edit is the bools.xml file so I can enable the SIP client to work over 3G: i.e. change this line in the file and re-cook it
Code:
<bool name="config_sip_wifi_only">true</bool>
This is potentially the 1st step though. If I can sucessfully edit this then I will probably try other things.
Andy
Click to expand...
Click to collapse
Ok so here is a step by step that I have used to make just this edit.
Apkmultitool is the one I use.
1. Decompile the apk
2. Change the false to true
3. Compile with option 11
4. In the keep folder delete the resource.asc file and then finish compiling.
5. Put New apk in zip removing the unsigned so it is named properly
6. Flash

zelendel said:
Ok so here is a step by step that I have used to make just this edit.
Apkmultitool is the one I use.
1. Decompile the apk
2. Change the false to true
3. Compile with option 11
4. In the keep folder delete the resource.asc file and then finish compiling.
5. Put New apk in zip removing the unsigned so it is named properly
6. Flash
Click to expand...
Click to collapse
OK - just removed and reinstalled APK Multitool, verified the path environment variable and followed these steps - Step 3 where it asks whether this is a system apk I said yes and when it asks about copying files I said yes. The resulting file is now 5,653KB compared to the original that is 5,992KB. I assume the difference is the lack of signing?
Does this sound right?
Andy

ADB100 said:
OK - just removed and reinstalled APK Multitool, verified the path environment variable and followed these steps - Step 3 where it asks whether this is a system apk I said yes and when it asks about copying files I said yes. The resulting file is now 5,653KB compared to the original that is 5,992KB. I assume the difference is the lack of signing?
Does this sound right?
Andy
Click to expand...
Click to collapse
That and the compression level that is used. It will also change if you optimize the pngs. Nothing to really worry about

I am obviously doing something fundamentally wrong
I followed the instructions to the letter, created the unsignedframework-res.apk, renamed it, pushed it to to my device (adb remount, adb push framework-res.apk system/framework/framework-res.apk) and rebooted - boot loop. Tried signing it with APK Multitool and then pushing this file. This time it booted but I had forced close on all sorts of things. Restored the original file and it is working again but all the sync stuff has screwed up meaning I need to re-flash as my ROM has stuff in /data that will get wiped if I do a factory reset.
Any other pointers or do you want to try editing the file for me and I'll see if yours works? I have attached the original file.
Andy

ADB100 said:
I am obviously doing something fundamentally wrong
I followed the instructions to the letter, created the unsignedframework-res.apk, renamed it, pushed it to to my device (adb remount, adb push framework-res.apk system/framework/framework-res.apk) and rebooted - boot loop. Tried signing it with APK Multitool and then pushing this file. This time it booted but I had forced close on all sorts of things. Restored the original file and it is working again but all the sync stuff has screwed up meaning I need to re-flash as my ROM has stuff in /data that will get wiped if I do a factory reset.
Any other pointers or do you want to try editing the file for me and I'll see if yours works? I have attached the original file.
Andy
Click to expand...
Click to collapse
I've tried to change it for you,
Code:
<bool name="config_sip_wifi_only">false</bool>
The file size is reduced to 3.23 Mb maybe it's bcz of optimizing effect..
check if it works .
-Yasser-

-yasser- said:
I've tried to change it for you,
Code:
<bool name="config_sip_wifi_only">false</bool>
The file size is reduced to 3.23 Mb maybe it's bcz of optimizing effect..
check if it works .
-Yasser-
Click to expand...
Click to collapse
Hi
Thanks for this. Just renamed this and pushed it to my DHD, rebooted and yep it works. I haven't built a ROM with it yet but this tells me something is wrong at my end....
I have a fairly vanilla Dell PC with Windows 7 Ultimate x86 OEM. I have installed the DSIXDA kitchen and have been building ROMs for my DHD for a while. I have some of the Android SDK installed but maybe not all or updated (not sure if this is a problem?) but enough for adb.exe to work? I have installed the APK Multitool (obviously) and some other utilities (Ultimate Multi Tool, HTC Sync)
Other than that its a pretty clean machine - Microsoft Security Essentials and WinRar is all that's installed. This is a spare PC that I wiped recently and installed Windows 7 on and all I am really using it for is making android ROMs.
EDIT: Just built a ROM with this framework-res.apk as swapping this after I have configured account sync seems to screw the accounts up (they sync but aren't displayed in Settings, Accounts & Sync). Anyway the ROM built OK and its all working. I'd really like to know what I am doing wrong with editing the APK?
Andy

OK.
I don't really know what's wrong with your PC, or procedure ..
I'll tell you what I am doing, that may helps.
I'm using apk changer . download it from here
I think It's nearly the same as other tools, although you can try it.
For editing framework-res.apk,
first open cmd : cd <..>\apk_changer\other (folder containing apktool.jar)
then type : java -jar apktool.jar if <PATH To>\framework-res.apk
It should tell you that "framework installed to ..."
Now put your framework-res.apk in "place-files-here-for-modding"
and run apkchanger.bat choose 1 (decompile) and 3 (for sources & resources)
Do your modifications.
then return to bat, type 3 (compile). yes for system apk & yes for replacing original files.
a 'keep' folder will be created, delete resources.asc inside it.
type enter within cmd & you're done . check the new file in "place-files-here-for-modding" (unsignedframework-res.apk)
Yasser

-yasser- said:
OK.
I don't really know what's wrong with your PC, or procedure ..
I'll tell you what I am doing, that may helps.
I'm using apk changer . download it from here
I think It's nearly the same as other tools, although you can try it.
For editing framework-res.apk,
first open cmd : cd <..>\apk_changer\other (folder containing apktool.jar)
then type : java -jar apktool.jar if <PATH To>\framework-res.apk
It should tell you that "framework installed to ..."
Now put your framework-res.apk in "place-files-here-for-modding"
and run apkchanger.bat choose 1 (decompile) and 3 (for sources & resources)
Do your modifications.
then return to bat, type 3 (compile). yes for system apk & yes for replacing original files.
a 'keep' folder will be created, delete resources.asc inside it.
type enter within cmd & you're done . check the new file in "place-files-here-for-modding" (unsignedframework-res.apk)
Yasser
Click to expand...
Click to collapse
Hi
Thanks for replying. I am going to wipe and reinstall Windows 7. I know it seems a bit drastic but its the only way I can eliminate it - plus its just a PC in the corner that has no important stuff (apart from the android stuff) on it.
Andy

Related

Need Help

Posted it here because i need a dev.
I pulled my Framework-res.apk and modified all the icons for everything. I decompiled using apktool.
My question is what steps do i take now (do i need to sign it, what a good tool to recompile it as apktool does and gives me a framework-res.apk but caused my phone not to boot up)..also someone said seomthing about resources.arsc or something..not sure where to go...thanks for your help.
Open ur new apk using 7zip (righr click>7zip>open archive) and do the same with ur old one. Delete the resources.xxxx(i dont know the name by heart lol) and drag and drop the one (by one i meant the resources.xxxx file) from the new zip to the old zip and adb push ur old frameworkres apk and reboot
Sent from my PG86100 using XDA App
kpkimmel said:
Posted it here because i need a dev.
I pulled my Framework-res.apk and modified all the icons for everything. I decompiled using apktool.
My question is what steps do i take now (do i need to sign it, what a good tool to recompile it as apktool does and gives me a framework-res.apk but caused my phone not to boot up)..also someone said seomthing about resources.arsc or something..not sure where to go...thanks for your help.
Click to expand...
Click to collapse
sounds more like a question. Use apk manager and or 7zip
how does just that one file carry over all the new pics and stuff i changed...
edited......
What exactly have you edited? If you just change non patch9 images... then you can just drag and drop the new images into the apk (may have to rename apk to zip).
If they are patch9's... you need to..
decompile framework-res.apk (apktool d framework-res.apk)
swap out images
recompile (apktool b framework-res)
Now take the newly compiled apk (in the /dist folder). Open it up and take the edited images (only the ones you need changed) and put them into your original apk.
No need to resign just push it to your phone and verify that it works
If you are editing xml files in /values* or /layout..
do the same as above, except after re-compiling, you're going to swap over the resources.arsc file to the original apk.
This is using apktool... in my experience apk manager doesn't do the job to my expectations... so i just do it manually with apktool.
Lemme know if u need anything more, or if i didnt touch on a specific situation.
Btw, maybe to combat the retarded comments about q&a and being in the right section... maybe turn the OP into a How-To?
preludedrew said:
What exactly have you edited? If you just change non patch9 images... then you can just drag and drop the new images into the apk (may have to rename apk to zip).
If they are patch9's... you need to..
decompile framework-res.apk (apktool d framework-res.apk)
swap out images
recompile (apktool b framework-res)
Now take the newly compiled apk (in the /dist folder). Open it up and take the edited images (only the ones you need changed) and put them into your original apk.
No need to resign just push it to your phone and verify that it works
If you are editing xml files in /values* or /layout..
do the same as above, except after re-compiling, you're going to swap over the resources.arsc file to the original apk.
This is using apktool... in my experience apk manager doesn't do the job to my expectations... so i just do it manually with apktool.
Lemme know if u need anything more, or if i didnt touch on a specific situation.
Btw, maybe to combat the retarded comments about q&a and being in the right section... maybe turn the OP into a How-To?
Click to expand...
Click to collapse
Thank you very much..finally...one last question, where do i put the wallpaper so when the system is fully booted it shows the wallpaper i want? Thanks.
kpkimmel said:
Thank you very much..finally...one last question, where do i put the wallpaper so when the system is fully booted it shows the wallpaper i want? Thanks.
Click to expand...
Click to collapse
There's an xml edit for it... but forgot it off the top of my head... quickest way is to replace system/customize/resource/shows_over.jpg with your image.
preludedrew said:
There's an xml edit for it... but forgot it off the top of my head... quickest way is to replace system/customize/resource/shows_over.jpg with your image.
Click to expand...
Click to collapse
Thanks you, sorry about the stupid framework-res question...i knew the answer but had been so long forget the simplest of steps....instead of normal compression i was using store instead.....duh.......thank you though for the reminder because 7zip will automatically restore the same it was decompressed with, unlike that crap winrar. Have a good one man and thank you again.

Volume Slider Color

I'm wanting to change the color of the slider when you turn your volume up and down from yellow to another color. I'm running CM7 fascinatemtd ROM by JT, I know which folder it's in and how to do it. My question is, I use Apk Manager to decomplie my framework-res.apk which was pulled from the ROM using 7zip, I've decompiled the apk, edited the XML file, when I went to recompile the framework-res apk using option 11, a error pop up and told me to read the log, I hit enter, answered yes to system question, then went to keep folder and deleted the resources file as instructed, and hit enter, I was left with an unsigned framework-res.apk file, renamed it to framework-res.apk, and pushed it back into ROM with 7zip, rebooted recovery, cleared caches, and installed ROM, but phone wouldn't boot up. So what am I doing wrong...
Obviously not
Sent from my SCH-I500 using XDA App
What color do you want the slider man
Sent from my SCH-I500 using XDA App
Blue would match my theme the HEX code is 11114b...
Sent from my SCH-I500 using XDA Premium App
If apkmanager errors common logic would dictate to read the log and see what is going wrong
Trying to flash a broken apk won't work obviously
I've gotten it to decompile and recompile bit the problem now os the changes I've made don't show up I'm not getting any errors before I was ising a ROM that I themed so I went back and used the original ROM how do I get the changes to stay...
Sent from my SCH-I500 using XDA Premium App
And you're trying to edit progress_horizontal.xml? And changing code to ff11114b leaving the "f's" in?
good day.
Yes
Sent from my SCH-I500 using XDA Premium App
I should rename unsigned framework.res to framework.res right...
Sent from my SCH-I500 using XDA Premium App
And during the compile process, you hit y for "system apk" and hit y for "would you like to copy over any files..............." and from the keep folder delete resources.arsc and continue to compile. And yes rename back to framework-res.apk.
good day.
Answered yes to system app and no to copy over files, didn't delete arsc and changes stayed, but if I install will I get boot loop since I didn't delete arsc....
Sent from my SCH-I500 using XDA Premium App
If I hit y to copy over files the changes don't stay only if I hit n
Sent from my SCH-I500 using XDA Premium App
it worked, by not copying over the files and not deleting the resources arsc file, does anyone know what the XML file name is for the download progress bar color is...and thanks for your help guys...
Here's what I would do if I was on Windows!
Download apktool & dependencies:
http://android-apktool.googlecode.com/files/apktool1.4.1.tar.bz2
http://android-apktool.googlecode.com/files/apktool-install-windows-r04-brut1.tar.bz2
Unpack both archives to your Windows folder. This will make apktool accessible through cmd anywhere.
CD in cmd window to the location of your apk, If you haven't already done so and install the resources by copying or pulling (framework-res.apk, twframework-res.apk for touchwiz) or (framework-res.apk, SystemUI.apk for GB). Once copied to the folder you are cd'd too...
Install the resources
apktool if framework-res.apk
apktool if twframework-res.apk
apktool if SystemUI.apk
Decompile and make your changes..
apktool d framework-res.apk
Recompile when done
apktool b framework-res
If it built succesfully, then make a copy of your framework-res.apk. Then navigate to framework-res/build/apk! Open your copied apk with 7zip and drag n drop res & resources.arsc from framework-res/build/apk inside! Close it up..
Push and test.. On windows you may need to navigate to your sdk directory if not properly setup!
adb push "your_copied_file"/system/framework/framework-res.apk
If you get a failed to write to system, run this first.
adb shell su -c rw
YES got all progress bar colors changed to blue now my CM7 Fascinatemdt ROM is themed all of my drawable hdpi and XML files are complete I might post this as a theme, thank you for your help...
Sent from my SCH-I500 using XDA Premium App
notta said:
Here's what I would do if I was on Windows!
Download apktool & dependencies:
http://android-apktool.googlecode.com/files/apktool1.4.1.tar.bz2
http://android-apktool.googlecode.com/files/apktool-install-windows-r04-brut1.tar.bz2
Unpack both archives to your Windows folder. This will make apktool accessible through cmd anywhere.
CD in cmd window to the location of your apk, If you haven't already done so and install the resources by copying or pulling (framework-res.apk, twframework-res.apk for touchwiz) or (framework-res.apk, SystemUI.apk for GB). Once copied to the folder you are cd'd too...
Install the resources
apktool if framework-res.apk
apktool if twframework-res.apk
apktool if SystemUI.apk
Decompile and make your changes..
apktool d framework-res.apk
Recompile when done
apktool b framework-res
If it built succesfully, then make a copy of your framework-res.apk. Then navigate to framework-res/build/apk! Open your copied apk with 7zip and drag n drop res & resources.arsc from framework-res/build/apk inside! Close it up..
Push and test.. On windows you may need to navigate to your sdk directory if not properly setup!
adb push "your_copied_file"/system/framework/framework-res.apk
If you get a failed to write to system, run this first.
adb shell su -c rw
Click to expand...
Click to collapse
will this work also when trying to decompile/recompile a non system app, like one from the market, that has dependencies
adude247 said:
will this work also when trying to decompile/recompile a non system app, like one from the market, that has dependencies
Click to expand...
Click to collapse
It will work with anything provided you have the resources. Some apk's are picky by means of what you can replace.
The method above is using apktool the way it is supposed to be used. That apkmanager thing sounded crazy with the delete this after that, hit y or n before this. Seems like alot of un-needed steps and confusion!
On linux it's even easier, pretty much fully auto!
notta said:
It will work with anything provided you have the resources. Some apk's are picky by means of what you can replace.
The method above is using apktool the way it is supposed to be used. That apkmanager thing sounded crazy with the delete this after that, hit y or n before this. Seems like alot of un-needed steps and confusion!
On linux it's even easier, pretty much fully auto!
Click to expand...
Click to collapse
yeah, I didn't delete anything just decompiled, edited the XML, and recompiled, that was the only way I could get the changes to stay. Any suggestions on what to use if the above resources don't work to get the apk to decompile, an example of an apk that I want to edit but cant get it to recompile after decompiling and editing the XMLs is....
adude247 said:
yeah, I didn't delete anything just decompiled, edited the XML, and recompiled, that was the only way I could get the changes to stay. Any suggestions on what to use if the above resources don't work to get the apk to decompile, an example of an apk that I want to edit but cant get it to recompile after decompiling and editing the XMLs is....
Click to expand...
Click to collapse
I can't and won't explain getting resources for market apps or generally someone else's work. However there are several ways to approach non-building apk's.
For example aapt has the capability to recompile standalone 9's as well as xml's, which can then be injected into the apk with the 7zip method. Especially useful for minor changes.
Another example for stubborn apk's would be the Eclipse or similar project. This is where you would partially build the files you wanted to change.
Thanks for the advice...
Sent from my SCH-I500 using XDA Premium App

[Q] SystemUI.apk (apktool) Windows/Mac

i have been trying to change some strings in the SystemUI.apk file in synergy, just to see what i can make them say... but i keep getting the same issues.
WTF am i doing wrong? :l
alright, so i put a (framework) folder in the usr/local/bin folder and added synergy frameworks.
(com.htc.resources.apk) <--- labeled this 1.apk
(framework-res.apk) <--- labeled this 2.apk
i decompiled SystemUI.apk using [apktool d /Users/Rolando-Ramiro/Desktop/SystemUI.apk /Users/Rolando-Ramiro/Desktop/SystemUI]
and used textmate (application for mac to edit xml files) to edit the strings i wanted and then i built the file again using..
apktool b /Users/Rolando-Ramiro/Desktop/SystemUI /Users/Rolando-Ramiro/Desktop/SystemUI.apk
no errors on either part.
now i tried 2 things after this.
i unzipped the synergy rom and added the SystemUI.apk to system/app folder on my computer.
i compressed it once more and tried to flash it. Nothing happened.
so i got the SystemUI.apk (the one with the modified strings.xml) and just moved it from my sdcard to the system/app folder in my phone.
Right after that, i got FC.
so i went back to what i originally had.
any idea what im doing wrong?
i keep getting
install /sd card ...
finding update package
opening update package
Installing update...
then it goes back to TWRP
--> choose zip to flash
[ ] reboot after successful flash
[ ] zip signature verification
--> reboot to system
<-- back to main menu
anyone with input please let me know.
i have mac/windows
omg ^^..
I already said it many times to you:
1. Pull the SystemUI.apk from your rom.
(put the apk in the same folder with the apktool, the you just have to type teh name of the the apk,with out a complete path. just like in step two)
2. Decompile it:
apktool d SystemUI.apk
Click to expand...
Click to collapse
3. make the changes in the SystemUI folder
4. Recompile it WITH AN OTHER NAME:
apktool b SystemUI SystemUI_NEW.apk
Click to expand...
Click to collapse
DON'T overwrite the original SystemUI.apk! (In your 1st post you did this!)
5. open both apks with 7zip
6. when u made changes in the res folder drag&drop the ressources file from SystemUI_NEW to SystemUI
- when you see other folder in the 7zip, with xml/pictures you also edited drag&drop them also
7. You dont need do do anything more now!
- just zipping the apk and flash via cwm won't work, read here how to make one:
http://forum.xda-developers.com/showthread.php?t=732957
- to try installing this apk won't work either.
8. The right way: copy the SystemUI.apk with ne new ressources file in it
and paste in on your sdcard. move it to /system and change the permission with root explorer to 644 or similar (just like all other apks in system/app) and then finally move it in system/app
- or just push it via adb to system/app
9. reboot
Edit: if u still don't understand how to do it, open teamviewer and give me id and pw =P
Rolando.Ramiro said:
i keep getting
install /sd card ...
finding update package
opening update package
Installing update...
then it goes back to TWRP
--> choose zip to flash
[ ] reboot after successful flash
[ ] zip signature verification
--> reboot to system
<-- back to main menu
anyone with input please let me know.
i have mac/windows
Click to expand...
Click to collapse
i would imagine there is an error in your edify script somewhere. and did you resign the apk as a system apk after you recompiled?
i've done everything you said, I PROMISE!
but it still messes up...
how do i resign it?
i decompile SystemUI.apk
it makes a folder called SystemUI
i remove the original SystemUI.apk
then i edit the string, then compile it again.
(i am using the frameworks from the rom that i got the SystemUI.apk from)
once i compile it, i extract the original rom, and go into (system/app) folder and add the .apk
then i compress it back to .zip
i try and flash and i get same error.
i really did the same steps.
i havent tried it on PC though, but i do have it.
gonna do that today.
edit; ok so im reading over the steps that you gave me.
im half asleep right now so i didnt get to fully read them.
my bad! ill do that right now and let you know what i came up with.
edit 2; (15 mins later) i have zip signer 2 on my phone, im pretty sure that will work the same as ppcgeeks apk signer. right?
alright, so instead of creating an update script, i just wanted to push the application from my phone straight into it.
i followed the steps;
1. decompile
2. modify files
3. build with NEW name
4. use 7zip for both NEW and original .apks
5. move over any files from NEW that were modified into original.
6. compress (im not sure if i should of compressed or built again..)
7. move to /system/ and change to what all the apps in /system/app/ are (permissions)
8. move from system/ into system/app.
i still get FC.
sorry if i sound REALLY retarded. im just really unsure what im doing wrong so i have to write it all out.
j4n87 said:
omg ^^..
I already said it many times to you:
1. Pull the SystemUI.apk from your rom.
(put the apk in the same folder with the apktool, the you just have to type teh name of the the apk,with out a complete path. just like in step two)
2. Decompile it:
3. make the changes in the SystemUI folder
4. Recompile it WITH AN OTHER NAME:
DON'T overwrite the original SystemUI.apk! (In your 1st post you did this!)
5. open both apks with 7zip
6. when u made changes in the res folder drag&drop the ressources file from SystemUI_NEW to SystemUI
- when you see other folder in the 7zip, with xml/pictures you also edited drag&drop them also
7. You dont need do do anything more now!
- just zipping the apk and flash via cwm won't work, read here how to make one:
http://forum.xda-developers.com/showthread.php?t=732957
- to try installing this apk won't work either.
8. The right way: copy the SystemUI.apk with ne new ressources file in it
and paste in on your sdcard. move it to /system and change the permission with root explorer to 644 or similar (just like all other apks in system/app) and then finally move it in system/app
- or just push it via adb to system/app
9. reboot
Edit: if u still don't understand how to do it, open teamviewer and give me id and pw =P
Click to expand...
Click to collapse
DUDE I ****ING GOT IT. :O
thank you so much.
posting screenshots right meow.
Rolando.Ramiro said:
DUDE I ****ING GOT IT. :O
thank you so much.
posting screenshots right meow.
Click to expand...
Click to collapse
no need to resign/compress after drag/drop file...thats the way im doing it
Congrats that u finally made it..was a hard way =P
j4n87, that guide. it's beautiful.
You saved my day, Sir!
@j4n87:
Thanks a lot for your nice step by step guide - it really helped me a lot!
As a beginning, I tried to change the color of the statusbar's clock. My main mistake was violating your rule 6b:
6. when u made changes in the res folder drag&drop the ressources file from SystemUI_NEW to SystemUI
- when you see other folder in the 7zip, with xml/pictures you also edited drag&drop them also
So you have to copy the file status_bar.xml from SystemUI_NEW.apk/res to SystemUI.apk/res, too.
Thanks again!
Wolfgang
EDIT:
Here is a little timesaver for you when you have installed Android Development Kit (with adb command within your PATH) and you have a WLAN connection to your development PC:
- Install the app adbWireless from the market.
- To get SystemUI.apk installed, start adbWireless and type in your PC's terminal:
1. adb connect 192.168.1.100:5555
2. adb remount
3. adb push SystemUI.apk /system/app
4. adb shell killall system_server
ad 1) Take the values the app tells you.
ad 2) Makes /system partition writeable.
ad 3) You may have to add the correct path to the SystemUI.apk on your PC.
ad 4) That's the command for soft rebooting your smartphone which is faster than a normal reboot.

[Q] Modifying SystemUI.apk xml file

I am using kyanROM and love it! One little tweak I was looking to make was in the notification it has kyanROM along the bottom. I was looking to replace that with my nickname. I am new to modding Android, so any help or tips would be appreciated.
Here are the steps I took and the issues I encountered:
Using NinjaMorph I extracted/decompiled SystemUI
I copied the files over to my PC
Looking through the files (not an exhaustive search mind you), I found one, tw_status_bar_tracking.xml, that had android:text="@string/kyanROM and android:layout_gravity="bottom". This looked promising to me, so I changed kyanROM to the name I wanted to use.
After saving, I copied this file back to my phone and opened the projected in NinjaMorph and said replace the original xml file with my new xml file.
"Finished" the project and closed out NinjaMorph.
Immediately experienced issues. SystemUI stopped working. Rebooting did nothing. So I restored my nandroid backup in order to start over. Back in NinjaMorph, I extracted SystemUI again and copied all files to my PC. Searching the contents of all files (a more exhaustive search) I found 4 instances of the phrase kyanROM:
First was the original in tw_status_bar_tracking.xml and said android:text="@string/kyanROM"
Second is in values\public.xml and says <public type="string" name="kyanROM" id="0x7f0800cd" />
The last two hits are from the same line in values\strings.xml and say <string name="kyanROM">kyanROM</string>
Now, assuming I'm correct that I need to mod SystemUI, after looking at the search results I'm thinking the change I need to make is to the last hit on my search, thus making it <string name="kyanROM">myName</string>. Then, when tw_status_bar_tracking.xml looks for the string kyanROM, it will display myName.
So, am I correct that in order to make this change I need to be in SystemUI? And If that is correct, is my proposed change correct - modifying the strings.xml file to show <string name="kyanROM">myName</string>?
If I do those, go into NinjaMorph and say to replace the original file with my new file I then should see myName along the bottom of the notification dropdown. Thoughts???
So I started over, this time I pulled the SystemUI.apk using adb. Then using apktool I did "apktook if SystermUI.apk". Then, apktool d SystermUI.apk ./mod". Found the file I *think* I need to modify (\values\strings.xml) and replaced kyanROM with myName. Saved the file.
Now I'm trying to recompile the file. I run the following apktool b -f -d mod. When I run this I get the error: Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml.
1) Am I modifying the correct file to place myName at the bottom of the notification screen?
2) How do I fix the PathNotExist error? I've looked at some solutions, but none seem to have worked.
Actually you need framework-res.apk from /system/framework installed through apk tool.
Pull framwork-res.apk and install it as you did for systemui.
After installing framework,type
apktool d systemui.apk
Now make the necessary changes and type
apktool b systemui
To recompile it back.
Note:after you recompile,you need to add meta-inf folder from original apk to your new recompiled apk to make it work.
Sent from my GT-N7000 using xda app-developers app
OK, I think I'm with you.
I need both SystemUI and framework-res in order to modify SystemUI
Install both (apktool if NameOfApk.apk)
decompile (apktool d SystemUI.apk)
make changes
recompile (apktool b SystemUI) but not the framework-res since I made no changes to it
And thanks for the tip about adding the meta-inf folder. I knew this, but since I never gotten that far to test, I'd probably forget to do that.
cyberpac9 said:
OK, I think I'm with you.
I need both SystemUI and framework-res in order to modify SystemUI
Install both (apktool if NameOfApk.apk)
decompile (apktool d SystemUI.apk)
make changes
recompile (apktool b SystemUI) but not the framework-res since I made no changes to it
And thanks for the tip about adding the meta-inf folder. I knew this, but since I never gotten that far to test, I'd probably forget to do that.
Click to expand...
Click to collapse
Installing framework-res.apk alone is enough if you have Samsung phone and have the latest apktool...
Sent from my GT-N7000 using xda app-developers app
vijai2011 said:
Installing framework-res.apk alone is enough if you have Samsung phone and have the latest apktool...
Sent from my GT-N7000 using xda app-developers app
Click to expand...
Click to collapse
OK, I installed both - no harm I guess. So I have made all my changes, updated the apk with the meta folder, etc. I'm ready to push this over to my phone. Using adb, do I need to remount or can I just do the following: adb push S:\apk\SystemUI.apk /system/app/
Well, I took a shot and just did the adb push without remount. I think it worked. We'll see if there are any issues moving forward. Yay! Many thanks....
edit: I noticed it reset my wallpaper, easy fix. Wonder if anything else would've been reset by this change?

[Q] Adding more languages to MOTO E and How to edit the boot.img ?

So I bought this little phone and I was baffled that there are so few language options to select.
The phone is for my father (the english evades him) therefore I need my mother language on it.
Phone Version XT1021
OS:
Android 4.4.2 Blur_Version.20.11.14.condor_retaildsds.retaildsdsall.en.03 Updated to 4.4.4, rebuilt in a deodexed ZIP file, and a system.img file
Ho needs it, I can upload it, I have either the update.zip or system/boot img files.
What I tried:
I tried to recompile the framework-res, system and other 15~20 apps, on some it worked on some it did not.
I am using the Nexus 5 translations files
On those that worked I managed to activate them by using a morelocale app from market and the translations work just fine.
On systemUI.apk I am getting force close
On framework-res.apk the phone freezes.
How I decompile/recompile and test the apps.
1) Decompile the app
2) Add the new values
4) Recompile
5) Copy the new app created app and the original one in a folder.
6) Open both apps
7) Drag and drop the resources.asrc file in the original apk and when you are asked how would you like to compress the file, I select STORE (I use winrar)
So if anyone managed to edit the framework app, systemUI and he is kind to share how he did it without getting any bootloops and force close, I would be very appreciative.
Now, regarding the boot.img
I tried to unpack it, using the classic method, it unpacks ok, the problem is on repacking,
Is there a special tool to do it or what ?
Why do i need
I need the adb.secure to be 0, and also the security off, so I can be able to use ADB REMOUNT and monitor adb logcat since the device starts. and also to be able to push apps to system using adb.
So, ho has the information and he is kind to share ?
here is the proper way to decompile and recompile the apk in a proper way
1. Make sure you have the latest version of the apktool
2. install the framework (try using 4.4.2 framework if 4.4.4 one gives error)
3. Decompile make changes
4. Choose option compile system app in apktools
5. now when it asks to delete all the things you have modified then delete the res and resources.arsc file and if you have made any smali changes delete the classes.dex too
6. go back to script and press enter
7. now open both MODIFIED APK and UNMODIFIED APK and then DRAG AND DROP androidmanifest.xml and meta inf from UNMODIFIED TO MODIFIED APK
8. push it and set rw-r-r permission
and if you are getting the error unable to remount then install adb insecure app by chainfire
thats it
happy modding
any help comment below by quoting or mentioning my name(i get notification so that i can give quick responce )
Prashanth Meesara: said:
here is the proper way to decompile and recompile the apk in a proper way
1. Make sure you have the latest version of the apktool
2. install the framework (try using 4.4.2 framework if 4.4.4 one gives error)
3. Decompile make changes
4. Choose option compile system app in apktools
5. now when it asks to delete all the things you have modified then delete the res and resources.arsc file and if you have made any smali changes delete the classes.dex too
6. go back to script and press enter
7. now open both MODIFIED APK and UNMODIFIED APK and then DRAG AND DROP androidmanifest.xml and meta inf from UNMODIFIED TO MODIFIED APK
8. push it and set rw-r-r permission
and if you are getting the error unable to remount then install adb insecure app by chainfire
thats it
happy modding
any help comment below by quoting or mentioning my name(i get notification so that i can give quick responce )
Click to expand...
Click to collapse
I will try like this, thx for the input.
globula_neagra said:
I will try like this, thx for the input.
Click to expand...
Click to collapse
Anytime bro . if you get any errors I will help you on Teamviewer
Sent from my Moto E using XDA Free mobile app
I managed to add the language using your method, only with one mention, I think on framework you have to select STORE when you add the file to the archive.

Categories

Resources