Getting Started Guide
How to Install and Use APKTool
This guide covers installing APKTool and using it to decompile, modify, and rebuild Android APK files.
Prerequisites
- -Java 8+
- -An APK file to analyze
Install APKTool
Install APKTool from your package manager or download the jar.
macOS
brew install apktoolDebian/Ubuntu
sudo apt install apktoolVerify
apktool --versionDecompile an APK
Decode an APK into its components - smali code, resources, manifest, and assets.
Decompile
apktool d target.apk -o output/What you get
ls output/
# AndroidManifest.xml - App permissions and components
# res/ - Decoded resources (layouts, strings, images)
# smali/ - Dalvik bytecode in smali format
# assets/ - Raw asset filesNote: APKTool decodes to smali (Dalvik assembly), not Java. Use JADX if you want Java source. APKTool is better when you need to modify and rebuild the APK.
Analyze the Manifest
The AndroidManifest.xml reveals permissions, activities, services, receivers, and exported components.
View manifest
cat output/AndroidManifest.xml | grep -E 'permission|activity|service|receiver|exported'Note: Look for exported components (exported=true) - these are accessible to other apps and are common attack surfaces. Excessive permissions are also a red flag.
Modify and Rebuild
Make changes to the decompiled APK and rebuild it.
Rebuild
apktool b output/ -o modified.apkSign the APK
keytool -genkey -v -keystore test.keystore -alias test -keyalg RSA -keysize 2048 -validity 10000
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore test.keystore modified.apk testNote: Rebuilt APKs must be signed to install on a device. The signature won't match the original, so apps with signature verification will detect the modification.