• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [Guide] How-To Properly Decompile and Recompile apk's with apktool

Someone help me with this stupid error. Its driving me insane. Ive downgrade and re-upgraded apktool, used different mms and framework-res', changed the ic_mms_drm_protected.png to 50 million things, deleted it, and even switched to Easy apk disassembler (which my the way uses apktool) and so on and can not get past this dumb error

update aapt is what I found with a little googlin

Sent from my typewriter.
 
i found a tool called apk edit 0.4....i dont have a link cuz i suck but i found it on XDA. It allows you to poke around in an apk and do stuff like change the icons of the apk, change the name of the apk and mess with various elements of the apk. its regular windows GUI too..not like linux...i thought you GNU
 
Everytime I try to compile an APK I get an error.

Im not doing it through ADB, Im running it all on my computer and editing them first and then pushing them to the phone. But I cant get an apk to work because I cant compile???

Same thing happens to me. I'm trying to do shiny's mod to change lockscreen background and the apk decompiles fine but when i try to recompile it i get a bunch of errors. Same thing happens in apkmultitools. It just wont let me recompile. Im using Number 2 2.2 trying to recompile frameworkres.apk.
 
Same thing happens to me. I'm trying to do shiny's mod to change lockscreen background and the apk decompiles fine but when i try to recompile it i get a bunch of errors. Same thing happens in apkmultitools. It just wont let me recompile. Im using Number 2 2.2 trying to recompile frameworkres.apk.

You need to take the drawable-hdpi folder out of LD-LG zvd and put it in Number #2's, decompile, make your changes, recompile then transfer the drawable-hdpi back ;)
 
KlexKavark said:
Same thing happens to me. I'm trying to do shiny's mod to change lockscreen background and the apk decompiles fine but when i try to recompile it i get a bunch of errors. Same thing happens in apkmultitools. It just wont let me recompile. Im using Number 2 2.2 trying to recompile frameworkres.apk.

No you gotta use the stock frame work. Like the original bone stock one not the one from the #2 ROM. Then you transfer whatever you modded over to your current fw that your going to use.
 
You need to take the drawable-hdpi folder out of LD-LG zvd and put it in Number #2's, decompile, make your changes, recompile then transfer the drawable-hdpi back ;)


Im loosing my mind.

Im gonna edit something in ICK theme framework.apk that will compile into the resources file. Where can I paste it to to get it to compile? I paste it to the stock framework and i get battery errors and everything else. Obviously I cant compile it as is cause it will throw errors. UGH
 
Im loosing my mind.

Im gonna edit something in ICK theme framework.apk that will compile into the resources file. Where can I paste it to to get it to compile? I paste it to the stock framework and i get battery errors and everything else. Obviously I cant compile it as is cause it will throw errors. UGH

use the stock framework.
 
Pull the framework from Mt's broken out. That is the framework I always use for the drawables. It will decompile and recompile with no .9 errors and it has 1% battery.
 
Ugh. After staring at my 9mm for a while and contemplating taking the easy way out, I tried one more time and finally got what I wanted. Dammit man.
 
Updated it after I posted. Still the same error :mad:
hey shiny, i just tried it myself threw framework and mms in.. ran 'apktool if framework-res.apk' then 'apktool d mms.apk mms' and it worked perfectly.. this is the apktool i use :D and remember you nedd java jdk installed 6+ for gb

EDIT: wth why cant i add an attachment?

[Link removed]
 
Last edited by a moderator:
what apk are you trying to edit? if it's non-stock than you will have issues lol you need to use stock apk, and ONLY edit xml files... DO NOT edit your png files when decompiling/recompiling!!!

what if i want to edit a non stock rom? I was trying to edit a non stock rom, it got compiled but while installing I got parsing error.
 
what if i want to edit a non stock rom? I was trying to edit a non stock rom, it got compiled but while installing I got parsing error.
be a lil more specific lol, which apk from which rom etc..? generally this should work for all cases unless the apk has some added image files vs stock version of that specific apk.. ie: framwork-res.apk from #2 has an added image, so instead of copying the whole drawable-hdpi from stock to new, you would instead only add the actual images from stock into the new apk's drawable-hdpi folder :D, then de/re-compiling should work fine..

and remember you cant use the actual new compiled apk, you need the original signature from stock/previous version of apk
 
be a lil more specific lol, which apk from which rom etc..? generally this should work for all cases unless the apk has some added image files vs stock version of that specific apk.. ie: framwork-res.apk from #2 has an added image, so instead of copying the whole drawable-hdpi from stock to new, you would instead only add the actual images from stock into the new apk's drawable-hdpi folder :D, then de/re-compiling should work fine..

and remember you cant use the actual new compiled apk, you need the original signature from stock/previous version of apk

I was trying to mod winamp, I run a CM 7.2 so used framework-res.apk from CM7.2, I didnt change any images I changed some string values which are present in res/values folder. Then compiled it, which it did without any error. Then I copied the resourses.arsc file to the original apk. When I copied to my phone and tried running it, it showed an error while installing "application not installed".
 
I was trying to mod winamp, I run a CM 7.2 so used framework-res.apk from CM7.2, I didnt change any images I changed some string values which are present in res/values folder. Then compiled it, which it did without any error. Then I copied the resourses.arsc file to the original apk. When I copied to my phone and tried running it, it showed an error while installing "application not installed".
how are you installing it?
btw some modified apk's cant be installed to data, you may have to push it to system via adb or a file manager app and reboot :D

an example would be, if you theme the youtube.apk, wont let you install it into data/app, can only install it to system/app
 
how are you installing it?
btw some modified apk's cant be installed to data, you may have to push it to system via adb or a file manager app and reboot :D

an example would be, if you theme the youtube.apk, wont let you install it into data/app, can only install it to /system/app

yes, i was installing it as a /data/app, but as per your advise I pushed it to /system/app using terminal and gave proper permissions (644) but its not running, its giving message "the app stopped unexpectedly", moreover the winamp icon is also gone from the apk after I recompiled it (the file manager shows the icons of apk's), what u think :confused: is there any mistake in recompiling?

Thanks
 
yes, i was installing it as a /data/app, but as per your advise I pushed it to /system/app using terminal and gave proper permissions (644) but its not running, its giving message "the app stopped unexpectedly", moreover the winamp icon is also gone from the apk after I recompiled it (the file manager shows the icons of apk's), what u think :confused: is there any mistake in recompiling?

Thanks
possibly.. are you sure you ONLY edited the strings.xml?? you didn't add anything else to a folder in 'res'?
 
possibly.. are you sure you ONLY edited the strings.xml?? you didn't add anything else to a folder in 'res'?

yes, I am editing strings.xml under values folder. For testing I decompiled the app and recompiled it without making any changes, strangely the size of the output app reduced to 429 KB ( as compared with 434 KB original). May be it cannot handle 3rd party apps and can only work with stock apps??
 
yes, I am editing strings.xml under values folder. For testing I decompiled the app and recompiled it without making any changes, strangely the size of the output app reduced to 429 KB ( as compared with 434 KB original). May be it cannot handle 3rd party apps and can only work with stock apps??
no thats just because the new one doesn't have it original signature... you need to use like 7zip or something to extract the files from new and place them into the original apk for it to work... i though you knew that..? LOL
 
First of all, Thanks for making this! It helps noobs like me that have no experience building apks. :)

Okay so for me, I read somewhere where someone wanted to run 2 instances of an app and another person recommended to decompile, edit manifest file to rename the app, then compile, sign, etc.

I want to do exactly that and whenever I just tried to change the name at the header of the AndroidManifest.xml file, it wouldn't recompile. I have computer knowledge, but none whatsoever to do with programming apps. So I was wondering if someone could help me out and explain to me how to rename the app so it'll work.

Big Thanks!
 
no thats just because the new one doesn't have it original signature... you need to use like 7zip or something to extract the files from new and place them into the original apk for it to work... i though you knew that..? LOL

Well, I used Winrar to copy resourses.arsc file into the original apk. I copied the resourses.arsc file from the recompiled apk. But it still aint working :vollkommenauf:
I think i am making some serious mistake here. I will try to edit some system app(like phone.apk or settings.apk) and let you know the outcome
 
Well, I used Winrar to copy resourses.arsc file into the original apk. I copied the resourses.arsc file from the recompiled apk. But it still aint working :vollkommenauf:
I think i am making some serious mistake here. I will try to edit some system app(like phone.apk or settings.apk) and let you know the outcome
h... this is a tricky one, LOL im not really sure.. wish i could 'see' the issue that what happenning and how you were doing it than i could help :D but i cant teleport haha
 
Pull the framework from Mt's broken out. That is the framework I always use for the drawables. It will decompile and recompile with no .9 errors and it has 1% battery.
09bh.jpg
09dh.jpg
09jh.jpg
09ht.jpg
zamz2.jpg
my framework does too (NOW LOL) but it's not the isssue, he's trying to edit an app from market
 
Back
Top Bottom