[GUIDE][HOW-TO] Decompile and Compile apps using Apktool in 5 Simple Steps

zocker7

Senior Member
Aug 11, 2008
385
21
38
when i try recompile whatsapp plus:

Failed to generate resource table for split ''
C:\Users\Bo\Desktop\AdvancedApkTool\3-Out\WA-Reborn-1.80-OsmDroid.apk\res\values-v21\styles.xml:4: error: Error: Color types not allowed (at 'android:borderRight' with value '#ff009688').

Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Bo\AppData\Local\Temp\brut_util_Jar_727603003604827161.tmp, p, --forced-package-id, 127, --min-sdk-version, 7, --target-sdk-version, 21, --version-code, 450298, --version-name, 2.11.531, -F, C:\Users\Bo\AppData\Local\Temp\APKTOOL4752753254971913589.tmp, -0, arsc, -I, C:\Users\Bo\Desktop\AdvancedApkTool\1-BDFreak\Frameworks\1.apk, -S, C:\Users\Bo\Desktop\AdvancedApkTool\3-Out\WA-Reborn-1.80-OsmDroid.apk\res, -M, C:\Users\Bo\Desktop\AdvancedApkTool\3-Out\WA-Reborn-1.80-OsmDroid.apk\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:437)
at brut.androlib.Androlib.buildResources(Androlib.java:374)
at brut.androlib.Androlib.build(Androlib.java:277)
at brut.androlib.Androlib.build(Androlib.java:250)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Bo\AppData\Local\Temp\brut_util_Jar_727603003604827161.tmp, p, --forced-package-id, 127, --min-sdk-version, 7, --target-sdk-version, 21, --version-code, 450298, --version-name, 2.11.531, -F, C:\Users\Bo\AppData\Local\Temp\APKTOOL4752753254971913589.tmp, -0, arsc, -I, C:\Users\Bo\Desktop\AdvancedApkTool\1-BDFreak\Frameworks\1.apk, -S, C:\Users\Bo\Desktop\AdvancedApkTool\3-Out\WA-Reborn-1.80-OsmDroid.apk\res, -M, C:\Users\Bo\Desktop\AdvancedApkTool\3-Out\WA-Reborn-1.80-OsmDroid.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:488)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:423)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [C:\Users\Bo\AppData\Local\Temp\brut_util_Jar_727603003604827161.tmp, p, --forced-package-id, 127, --min-sdk-version, 7, --target-sdk-version, 21, --version-code, 450298, --version-name, 2.11.531, -F, C:\Users\Bo\AppData\Local\Temp\APKTOOL4752753254971913589.tmp, -0, arsc, -I, C:\Users\Bo\Desktop\AdvancedApkTool\1-BDFreak\Frameworks\1.apk, -S, C:\Users\Bo\Desktop\AdvancedApkTool\3-Out\WA-Reborn-1.80-OsmDroid.apk\res, -M, C:\Users\Bo\Desktop\AdvancedApkTool\3-Out\WA-Reborn-1.80-OsmDroid.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:482)
... 6 more
:(
 

Hen Ry

Senior Member
Oct 21, 2012
661
365
93
Saxony
I just tried it, no problem
Decompiling with
Microsoft Windows [Version 10.0.10049]
(c) 2015 Microsoft Corporation. Alle Rechte vorbehalten.
S:\AndroidMultitool_v3.5>cd S:\AndroidMultitool_v3.5\Program_Files
S:\AndroidMultitool_v3.5\Program_Files>apktool d S:\AndroidMultitool_v3.5\WA+\Whatsapp_Plus_Reborn_v1.80_Caling_enabled.apk -o S:\AndroidMultitool_v3.5\Decompiled_apk\Whatsapp_Plus_Reborn_v1.80_Caling_enabled\
I: Using Apktool 2.0.0-RC3 on Whatsapp_Plus_Reborn_v1.80_Caling_enabled.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Hen Ry\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
Compiling -> No errors.
 
Last edited:

Joe Hanson

Senior Member
Feb 4, 2015
91
18
0
thanx your post really help me :)
but i'm getting errors in building apk
and pls give link for signing apk
Just make sure you've download every apktool requirements
[appt, apktool.jar, baksmali.jar, smali.jar, baksmali.file, smali.file]
from apktool official website, then you'll not confront with
any error :good: & for signing APK, you can use this PC Application
http://kefir500.github.io/apk-icon-editor/ , now you can sign, edit APK
easily, it is 2015 tho, everything is automate, no more manual :cool:
 
  • Like
Reactions: n78 shadow

iceman004

Member
Apr 20, 2014
47
4
0
Just make sure you've download every apktool requirements
[appt, apktool.jar, baksmali.jar, smali.jar, baksmali.file, smali.file]
from apktool official website, then you'll not confront with
any error :good: & for signing APK, you can use this PC Application
http://kefir500.github.io/apk-icon-editor/ , now you can sign, edit APK
easily, it is 2015 tho, everything is automate, no more manual :cool:
noob question...
pls tell me where to put baksmali.jar, smali.jar, baksmali.file, smali.file ?
and how to use
thanx
 

Joe Hanson

Senior Member
Feb 4, 2015
91
18
0
noob question...
pls tell me where to put baksmali.jar, smali.jar, baksmali.file, smali.file ?
and how to use
thanx
Okay, first thing first, you'll need all of the above mention file, the appt.exe
& apktool.bat is in a bz2 file [like zip] download it from the apktool website
here http://ibotpeaches.github.io/Apktool/ & scroll down, you'll see below
NEWS [23 Dec 2012 - Scripts r05-ibot Released] download it depending on
your PC Windows,Mac, etc. & extract. Then download the latest apktool that
is apktool 2.0 here https://bitbucket.org/iBotPeaches/apktool/downloads &
rename it to [apktool.jar] After that, download all baksmali & smali V2.03
here https://code.google.com/p/smali/downloads/list [I know baksmali &
smali has been updated, but V2.0.3 is working flawlessly] Lastly, put all of the files
into any folder you want or I would recommend to create a new folder named
[apktool] in C:/Windows/HERE [apktool] after that run it by the apktool.bat
or press [Shift + Right Click] then you'll see option "open command window here"
Then check your current version by typing in CMD
Code:
apktool -version
If it show " apktool 2.0.0" in CMD, then you've successfully installed :good:
To use it for compiling, first put framework-res of your ROM in the apktool folder
I've mention, then put any apk you want to compile [example, SystemUI.apk]
First, to prepare the compiling type in CMD
Code:
apktool if framework-res.apk
Then, type
Code:
apktool if SystemUI.apk
After that, type
Code:
apktool d SystemUI.apk
Lastly, after done editing & stuff, recompile by typing in CMD
Code:
apktool b SystemUI
[for recompiling, you do not need to type the ".apk" at the end of apk name, just
simply type the apk name]
NOTE: You don't have to do the, "apktool if SystemUI.apk" command for other APK
Just do the "apktool if framework-res.apk" at the beginning & you're good to go :cowboy:
Hit the thanks button if I helped :fingers-crossed:
 
Last edited:

iceman004

Member
Apr 20, 2014
47
4
0
Okay, first thing first, you'll need all of the above mention file, the appt.exe
& apktool.bat is in a bz2 file [like zip] download it from the apktool website
here http://ibotpeaches.github.io/Apktool/ & scroll down, you'll see below
NEWS [23 Dec 2012 - Scripts r05-ibot Released] download it depending on
your PC Windows,Mac, etc. & extract. Then download the latest apktool that
is apktool 2.0 here https://bitbucket.org/iBotPeaches/apktool/downloads &
rename it to [apktool.jar] After that, download all baksmali & smali V2.03
here https://code.google.com/p/smali/downloads/list [I know baksmali &
smali has been updated to V2.0.5 but I didn't know where to download it
perhaps, I guess V2.0.3 is working flawlessly] Lastly, put all of the files into
any folder you want or I would recommend to create a new folder named
[apktool] in C:/Windows/HERE [apktool] after that run it by the apktool.bat
or press [Shift + Right Click] then you'll see option "open command window here"
Then check your current version by typing in CMD
Code:
apktool -version
If it show " apktool 2.0.0" in CMD, then you've successfully installed :good:
To use it for compiling, first put framework-res of your ROM in the apktool folder
I mention, then put any apk you want to compile [example, SystemUI.apk]
First, to prepare the compiling type in CMD
Code:
apktool if framework-res.apk
Then, type
Code:
apktool if SystemUI.apk
After that, type
Code:
apktool d SystemUI.apk
Lastly, after done editing & stuff, recompile by typing in CMD
Code:
apktool b SystemUI
[for recompiling, you do not need to type the ".apk" at the end of apk name, just
simply type the apk name]
NOTE: You don't have to do the, "apktool if SystemUI.apk" command for other APK
Just do the "apktool if framework-res.apk" at the beginning & you're good to go :cowboy:
Hit the thanks button if I helped :fingers-crossed:
million thanx very nice tutorial thanx but i downloaded baksmali & smali why they need? so sorry for asking again and again
 

Joe Hanson

Senior Member
Feb 4, 2015
91
18
0
million thanx very nice tutorial thanx but i downloaded baksmali & smali why they need? so sorry for asking again and again
Of course you need it, it is created for a lot of stuff, especially for APKs/JARs compiling
If you didn't install it, I'm pretty sure you'll need it later :fingers-crossed:
Btw, latest version of baksmali & smali can be download from link I've
given lol by selecting the "Project Home" in the site, feeling silly :silly:
 
Last edited:
  • Like
Reactions: iceman004

Joe Hanson

Senior Member
Feb 4, 2015
91
18
0
Still getting install framework errors with cm 12.1....I followed the tutorial as you posted, every apktool I use is the same issue
Maybe apktool not yet fully implement for CM12.1 compiling, it's works fine on CM11 btw,
I think you'll have to wait for the upcoming apktool updates then & hope it's working
Check out the original site http://forum.xda-developers.com/showthread.php?t=1755243
I noticed that you've post a comment in that site, the op of this tool is working on it, so we'll see
 
Last edited:

Aman Dewett

Senior Member
Jul 5, 2014
240
25
0
Kapurthala

If you have any errors or problems related to apktool, post them here, I will try to solve them. :)
Bro i need your help because i am getting this error from yesterday. whenever i try to re-compile my apk after changing some png's it causing this error from yesterday before it was fine, that means i am following the proper procedure. Please check my attachments which contain errors.

One thing i wanna tell you that you'll see in error file that it saying that files are missing or deleted but in actual files are there present at path given in error and i try it on many different apk's but in every apk he's giving me this error even files are present in every case in the given error path. I don't know then why apktool giving this error. Please help!!
 

Attachments

thomas-07

New member
May 21, 2016
1
0
0
Hello,

thanks for the tutorial.
I've rebuilt successfully the Business Calendar Pro 2.3.2 apk since I wanted to remove the extra permissions except those related to calendar and read/write sdcard.
However when I install it on my device on which Norton Mobile Security is already installed, the rebuilt apk is recognized as malware by Norton.
I use SignApk.zip from your tutorial.

Do you know why it happens?

Thanks once again.
Thomas