Unofficial ApkTool 🔧

Bleeding-edge builds of ApkTool.

📥 Download Version 2.3.1-212330-SNAPSHOT (9.45MB)


ApkTool v2.3.1-212330-SNAPSHOT uses smali and baksmali version 2.2.1


Remember to delete the following folder: C:\Users\Your-User-Name\apktool\,
so you’ll enjoy the new android-framework.jar.
You can, also, extract the android-framework.jar,
from within apktool-cli-all-2.3.1-212330-SNAPSHOT.jar\brut\androlib\
and place it there manually.

ApkTool uses smali and baksmali (and other useful libs) internally,
and you do not need to download an additional.. anything really..

If you want to, you can download them all in a jar format,
which you can use to update other tools (“Android Kitchen” and such..),
simply browse the following links:

smali and baksmali:
bitbucket.org/JesusFreke/smali/downloads/ (for both)
repo1.maven.org/maven2/org/smali/smali/
repo1.maven.org/maven2/org/smali/baksmali/
github.com/testwhat/SmaliEx/releases – an updated MOD that supports multi-dex, includes both, plus oat2dex too.

smali util:
repo1.maven.org/maven2/org/smali/util/

dexlib2:
repo1.maven.org/maven2/org/smali/dexlib2/

snakeyaml:
bitbucket.org/asomov/snakeyaml/downloads/?tab=tags
repo1.maven.org/maven2/org/yaml/snakeyaml/


Some information:

– about smali: github.com/JesusFreke/smali.

– ApkTool on XDA: forum.xda-developers.com/showthread.php?t=1755243.

– ApkTool build process: iCompile – Build ApkTool


Common commands

  • extract.cmd
    drag&drop APK over the cmd file, to extract it to a folder the same name.

    @echo off
    call java.exe -jar "apktool.jar" --verbose d "%~1"
    pause
    
  • extract_no_source.cmd
    same as before, slightly faster since no need smali-up things, used only to extract the resources or view the decoded XML text-content, you can even try built it back with the same code, useful if you just want to modify non-code resources, such as making themes (but there are easier way to do it.. such as with XPOSED-Framework..)

    @echo off
    call java.exe -jar "apktool.jar" --verbose -s d "%~1"
    pause
    
  • build_same_sig.cmd
    drag&drop the (previously decoded) folder, and get an apk in the build sub-folder, it tries to build the same content and same (?) signature, which is useful in-case you havn’t changed too much.. if you wish you can specify aapt, which you can download from here: https://github.com/eladkarako/Pre-Built-Binary-AAPT-For-Windows-Linux-And-MacOS.

    @echo off
    java -jar apktool.jar --verbose -c --aapt "aapt.exe" b "%~1"
    pause
    
  • build_same_sig_force_no_change_detection
    same as before, but force build, useful if you want to ignore the change-detection and build anyway.

    @echo off
    java -jar apktool.jar --verbose -c -f --aapt "aapt.exe" b "%~1"
    pause
    
  • build_fresh_no_sig.cmd
    drag&drop previously decoded folder, get an apk-file that included all the changes, unsigned (sign it yourself..), it is useful if you want to build an entire project without trying to mock the original-apk exactly.

    @echo off
    java -jar apktool.jar --verbose --aapt "aapt.exe"  b "%~1"
    pause
    
  • build_fresh_no_sig_force_no_change_detection.cmd
    same as above, but (for some reason..) full the change-detection to think there was no change, to force built the folder into apk.

    @echo off
    java -jar apktool.jar --verbose -f --aapt "aapt.exe"  b "%~1"
    pause
    
  • How to sign? (quick tip)
    See: Generate KeyStore And Sign Anything for more easy-drag&drop commands for signing the result-apk. Keep in-mind to delete old signatures from the /META-INF/ folder (CERT.RSA, CERT.SF, MANIFEST.MF, …), but do not delete any sub folder such as com\google\android\ since they are often used to have useful scripts placed there to not-disrupt the overall checksum.


    Align after you’ve signed! not before, not both before and after.
    sign.cmd
    drag&drop any file to align it (apk, zip, jar,…) it will keep the original name, with the suffix _aligned, and the same extension.

    @echo off
    set FILENAME_IN=%~s1
    set FILENAME_OUT=%~d1%~p1%~n1_aligned%~x1%
    
    call zipalign.exe -v 4 %FILENAME_IN% "%FILENAME_OUT%"
    pause