• 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

I'm not sure where to post this but it seems somewhat relevant here, please move if it needs it.

I have a deodexed ROM and I want to see what framework files a certain APK is accessing or using. How should I proceed?

Thanks!:)
try to decompile the apk, the when it looks for resources in C:/Users/(your-name)/apktool/framework/(#.apk)

check which number it says...

if it's
1.apk = framework-res.apk
2.apk = RES_cappuccino.apk
3.apk = RES_sui.apk

etc.. so basically to find out which one YOU need, just install all the framework apk's to your apktool:

apktool if framework-res.apk

apktool if RES_cappuccino.apk

apktool if RES_sui.apk

etc...

eventually you will find the number/apk you need for the specific app resources
:D
 
  • Like
Reactions: Catalyst2012
Upvote 0
in the first page said:

"use something like 7zip, take the 'resources.arcs' file and any other xml files you edited out of the "-new" apk and copy them into Original apk"

but when I tried to extract the original apk, there is no folder name "values", but the folder is there when I decompile the apk, and it's gone when I've recompile it, so what should I copy from the new apk to the old apk when the folder does not exist.
 
Upvote 0
in the first page said:

"use something like 7zip, take the 'resources.arcs' file and any other xml files you edited out of the "-new" apk and copy them into Original apk"

but when I tried to extract the original apk, there is no folder name "values", but the folder is there when I decompile the apk, and it's gone when I've recompile it, so what should I copy from the new apk to the old apk when the folder does not exist.
it's the resources.arsc or whatever it's called lol those are your value's folder edits ;)
 
Upvote 0
and for decompilen apks i also follow ur tutorial and decompile the mms.apk to change the bubble color and to decompile i have no problems but when i try to compile back an error always came up so what i did i made the changes to the
.9 png files then i use eclipse wich i think is on the android tools so i create i new project put a name to it then the follow the instructions till you create the project
wich automatically create a drawable/res folder then you place the .9 png files on mi case of course i put them on the res/hdpi folder then export theunsigned apk to my desktop so i find them then i use 7zip to open the new apk that i create with eclipse go to the res/hdpi folder then grab the .9 png files that i just modified the open with 7zip the original mms.apk and put the modd .9 png files to the same directory on my case res/hdpi folder and override the originals and it work for me
https://www.dropbox.com/s/kql0xa6ev3np3kw/screenshot-1388708127281.png
this is how i change the colors
 
Upvote 0
well I was following this wonderful article by LDrifta.
I am new to Android world and reverse engineering. Well can any one help me Why this error is shooting out while i reassemble the apk using apktool
[HIGH]
Please enter the number of your choice: 1
Enter the name of the folder to assembly (ex: dis_Name.apk) : dis_g.apk

<<<<Error>>>>
[HIGH]FICHIER
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
(skipping (null) file 'G:\APK_HACK\EasyApkDisassembler.V1.3.2\dis_g.apk\ res\
drawable-hdpi\_r2_c2.9.png')
(skipping (null) file 'G:\APK_HACK\EasyApkDisassembler.V1.3.2\dis_g.apk\ res\
drawable-hdpi\_r4_c2.9.png')
invalid resource directory name: G:\APK_HACK\EasyApkDisassembler.V1.3.2\dis_g.ap
k\res/drawable-xxhdpi
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: brut.common.BrutException: could not exec command: [aapt, p, --min-
sdk-version, 8, --target-sdk-version, 15, -F, C:\Users\Imet\AppData\Local\Temp\A
PKTOOL8203745195223044340.tmp, -0, arsc, -I, C:\Users\Imet\apktool\framework\1.a
pk, -S, G:\APK_HACK\EasyApkDisassembler.V1.3.2\dis_g.apk\r es, -M, G:\APK_HACK\Ea
syApkDisassembler.V1.3.2\dis_g.apk\AndroidManifest .xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib .java:358)
at brut.androlib.Androlib.buildResources(Androlib.jav a:283)
at brut.androlib.Androlib.build(Androlib.java:206)
at brut.androlib.Androlib.build(Androlib.java:176)

at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not
exec command: [aapt, p, --min-sdk-version, 8, --target-sdk-version, 15, -F, C:\
Users\Imet\AppData\Local\Temp\APKTOOL8203745195223 044340.tmp, -0, arsc, -I, C:\U
sers\Imet\apktool\framework\1.apk, -S, G:\APK_HACK\EasyApkDisassembler.V1.3.2\di
s_g.apk\res, -M, G:\APK_HACK\EasyApkDisassembler.V1.3.2\dis_g.apk\A ndroidManifes
t.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(An drolibResources.jav
a:357)
at brut.androlib.Androlib.buildResourcesFull(Androlib .java:336)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd
k-version, 8, --target-sdk-version, 15, -F, C:\Users\Imet\AppData\Local\Temp\APK
TOOL8203745195223044340.tmp, -0, arsc, -I, C:\Users\Imet\apktool\framework\1.apk
, -S, G:\APK_HACK\EasyApkDisassembler.V1.3.2\dis_g.apk\r es, -M, G:\APK_HACK\Easy
ApkDisassembler.V1.3.2\dis_g.apk\AndroidManifest.x ml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(An drolibResources.jav
a:355)
... 6 more
java.io.FileNotFoundException: dis_g.apk\dist\g.apk (The system cannot find the
path specified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at com.android.signapk.SignApk.main(SignApk.java:320)
Press any key to continue . . .
[/HIGH]

Can anyone plz help me
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones