Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Android APK unpacking and resource extraction tool for reverse engineering. Use when you need to decode APK files, extract resources, examine AndroidManifest.xml, analyze smali code, or repackage modified APKs.
.claude/skills/aiskillstore-apktool/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 442% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 468% | 0% |
| case-21 | ✗→✓ | ▲ Improved | 273% | 0% |
| case-23 | ✗→✓ | ▲ Improved | 155% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 643% | 0% |
You are helping the user reverse engineer Android APK files using apktool for security analysis, vulnerability discovery, and understanding app internals.
Apktool is a tool for reverse engineering Android APK files. It can decode resources to nearly original form and rebuild them after modifications. It's essential for:
When the user asks to unpack, decode, or analyze an APK:
Standard decode command:
bashapktool d <apk-file> -o <output-directory>
Example:
bashapktool d app.apk -o app-unpacked
With force overwrite (if directory exists):
bashapktool d app.apk -o app-unpacked -f
After unpacking, the output directory contains:
app-unpacked/
├── AndroidManifest.xml # Readable manifest (permissions, components)
├── apktool.yml # Apktool metadata (version info, SDK levels)
├── original/ # Original META-INF certificates
│ └── META-INF/
├── res/ # Decoded resources
│ ├── layout/ # XML layouts
│ ├── values/ # Strings, colors, dimensions
│ ├── drawable/ # Images and drawables
│ └── ...
├── smali/ # Disassembled DEX code (smali format)
│ └── com/company/app/ # Package structure
├── assets/ # App assets (if present)
├── lib/ # Native libraries (if present)
│ ├── arm64-v8a/
│ ├── armeabi-v7a/
│ └── ...
└── unknown/ # Files apktool couldn't classifySkip resources (code analysis only):
bashapktool d app.apk -o app-code-only -r # or apktool d app.apk -o app-code-only --no-res
Skip source code (resource analysis only):
bashapktool d app.apk -o app-resources-only -s # or apktool d app.apk -o app-resources-only --no-src
The manifest reveals critical security information:
bash# After unpacking cat app-unpacked/AndroidManifest.xml
Look for:
android:allowBackup="true" (security risk)android:debuggable="true" (major security issue)Example analysis commands:
bash# Find all permissions grep "uses-permission" app-unpacked/AndroidManifest.xml # Find exported components grep "exported=\"true\"" app-unpacked/AndroidManifest.xml # Check if debuggable grep "debuggable" app-unpacked/AndroidManifest.xml # Find all activities grep "android:name.*Activity" app-unpacked/AndroidManifest.xml
bash# View all string resources cat app-unpacked/res/values/strings.xml # Search for API keys, URLs, credentials grep -r "api" app-unpacked/res/values/ grep -r "http" app-unpacked/res/values/ grep -r "password\|secret\|key\|token" app-unpacked/res/values/ # Find hardcoded URLs in resources grep -rE "https?://" app-unpacked/res/
Smali is the disassembled Dalvik bytecode format:
bash# Find specific class find app-unpacked/smali -name "*Login*.smali" find app-unpacked/smali -name "*Auth*.smali" # Search for security-relevant code grep -r "crypto\|encrypt\|decrypt" app-unpacked/smali/ grep -r "http\|https\|url" app-unpacked/smali/ grep -r "password\|credential\|token" app-unpacked/smali/ # Find native library usage grep -r "System.loadLibrary" app-unpacked/smali/ # Find file operations grep -r "openFileOutput\|openFileInput" app-unpacked/smali/
Note: Smali is harder to read than Java source. Consider using jadx for Java decompilation for easier analysis.
bash# List native libraries ls -lah app-unpacked/lib/ # Check architectures supported ls app-unpacked/lib/ # Identify library types file app-unpacked/lib/arm64-v8a/*.so # Search for interesting strings in libraries strings app-unpacked/lib/arm64-v8a/libnative.so | grep -i "http\|key\|password"
After modifying resources or smali code:
bashapktool b app-unpacked -o app-modified.apk
Important: Rebuilt APKs must be signed before installation:
bash# Generate keystore (one-time setup) keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-key-alias # Sign APK jarsigner -verbose -keystore my-release-key.jks app-modified.apk my-key-alias # Verify signature jarsigner -verify app-modified.apk # Zipalign (optimization) zipalign -v 4 app-modified.apk app-modified-aligned.apk
For system apps or apps dependent on device manufacturer frameworks:
bash# Install framework apktool if framework-res.apk # List installed frameworks apktool list-frameworks # Decode with specific framework apktool d -t <tag> app.apk
bash# 1. Unpack APK apktool d target.apk -o target-unpacked # 2. Examine manifest for security issues cat target-unpacked/AndroidManifest.xml # 3. Search for hardcoded credentials grep -r "password\|api_key\|secret\|token" target-unpacked/res/ # 4. Check for debuggable flag grep "debuggable" target-unpacked/AndroidManifest.xml # 5. Find exported components grep "exported=\"true\"" target-unpacked/AndroidManifest.xml # 6. Examine network security config cat target-unpacked/res/xml/network_security_config.xml 2>/dev/null
For IoT companion apps, find device communication details:
bash# 1. Unpack APK apktool d iot-app.apk -o iot-app-unpacked # 2. Search for device endpoints grep -rE "https?://[^\"']+" iot-app-unpacked/res/ | grep -v "google\|android" # 3. Find API keys grep -r "api\|key" iot-app-unpacked/res/values/strings.xml # 4. Locate device communication code find iot-app-unpacked/smali -name "*Device*.smali" find iot-app-unpacked/smali -name "*Network*.smali" find iot-app-unpacked/smali -name "*Api*.smali" # 5. Check for certificate pinning grep -r "certificatePinner\|TrustManager" iot-app-unpacked/smali/
bash# Fast resource-only extraction apktool d app.apk -o app-resources -s # Extract app icon cp app-resources/res/mipmap-xxxhdpi/ic_launcher.png ./ # Extract strings for localization cat app-resources/res/values*/strings.xml # Extract layouts for UI analysis ls app-resources/res/layout/
bash# Fast code-only extraction apktool d app.apk -o app-code -r # Analyze smali quickly grep -r "http" app-code/smali/ | head -20 grep -r "password" app-code/smali/
Apktool doesn't have built-in output format options, but you can structure your analysis:
For human-readable reports:
bash# Generate analysis report { echo "=== APK Analysis Report ===" echo "APK: app.apk" echo "Date: $(date)" echo "" echo "=== Permissions ===" grep "uses-permission" app-unpacked/AndroidManifest.xml echo "" echo "=== Exported Components ===" grep "exported=\"true\"" app-unpacked/AndroidManifest.xml echo "" echo "=== Package Info ===" grep "package=" app-unpacked/AndroidManifest.xml } > apk-analysis-report.txt
Apktool works well with other analysis workflows:
bashapktool d app.apk -o app-unpacked cat app-unpacked/AndroidManifest.xml | less
The manifest provides the roadmap for further analysis.
-r flag-s flagbash# Create analysis script cat > analyze.sh << 'EOF' #!/bin/bash APK_DIR="$1" echo "[+] Searching for URLs..." grep -rE "https?://" "$APK_DIR/res/" | grep -v "schema\|google\|android" echo "[+] Searching for API keys..." grep -ri "api.*key\|apikey" "$APK_DIR/res/" echo "[+] Searching for secrets..." grep -ri "secret\|password\|credential" "$APK_DIR/res/" EOF chmod +x analyze.sh ./analyze.sh app-unpacked
Keep notes on:
Use both tools together:
Solution: Install framework resources:
bashapktool if <framework-res.apk>
Solution: Use --keep-broken-res flag:
bashapktool d app.apk -o output --keep-broken-res
Solution: Check file path and permissions:
bashls -l app.apk file app.apk # Should show "Zip archive data"
Solution: Increase Java heap size:
bashexport _JAVA_OPTIONS="-Xmx2048m" apktool d large-app.apk
Solution: Validate your smali/XML syntax:
bash# Check for syntax errors apktool b app-unpacked -o test.apk --use-aapt2
Solution: Sign the APK:
bashjarsigner -verbose -keystore debug.keystore rebuilt.apk androiddebugkey
IMPORTANT: Only analyze APKs you own or have permission to analyze.
A successful apktool analysis includes:
bash# Decode (unpack) apktool d <apk> -o <output-dir> # Decode with force overwrite apktool d <apk> -o <output-dir> -f # Decode without resources (faster) apktool d <apk> -o <output-dir> -r # Decode without source (faster) apktool d <apk> -o <output-dir> -s # Build (repack) apktool b <unpacked-dir> -o <output-apk> # Install framework apktool if <framework.apk> # Empty framework cache apktool empty-framework-dir
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 2,813 | 7,870 | +180% | 1 | 1 | 0% | 533 | 3,960 | +643% | 0 | 0 | — |
case-02 | pass→pass | 8,686 | 6,522 | -25% | 1 | 1 | 0% | 505 | 3,936 | +679% | 0 | 0 | — |
case-03 | fail→pass | 4,644 | 3,309 | -29% | 1 | 1 | 0% | 742 | 4,020 | +442% | 0 | 0 | — |
case-04 | pass→pass | 6,942 | 4,033 | -42% | 1 | 1 | 0% | 1,163 | 4,165 | +258% | 0 | 0 | — |
case-05 | pass→pass | 11,046 | 7,117 | -36% | 1 | 1 | 0% | 1,941 | 4,825 | +149% | 0 | 0 | — |
case-06 | pass→pass | 14,081 | 10,177 | -28% | 1 | 1 | 0% | 1,347 | 5,209 | +287% | 0 | 0 | — |
case-07 | pass→pass | 10,985 | 13,193 | +20% | 1 | 1 | 0% | 1,895 | 4,816 | +154% | 0 | 0 | — |
case-08 | pass→pass | 5,626 | 4,716 | -16% | 1 | 1 | 0% | 903 | 4,156 | +360% | 0 | 0 | — |
case-09 | pass→pass | 6,249 | 9,845 | +58% | 1 | 1 | 0% | 1,009 | 4,312 | +327% | 0 | 0 | — |
case-10 | pass→pass | 16,734 | 6,464 | -61% | 1 | 1 | 0% | 1,964 | 4,490 | +129% | 0 | 0 | — |
case-11 | fail→pass | 17,178 | 4,760 | -72% | 1 | 1 | 0% | 745 | 4,229 | +468% | 0 | 0 | — |
case-12 | pass→pass | 10,682 | 3,482 | -67% | 1 | 1 | 0% | 903 | 4,038 | +347% | 0 | 0 | — |
case-13 | pass→pass | 5,938 | 5,964 | +0% | 1 | 1 | 0% | 1,097 | 4,298 | +292% | 0 | 0 | — |
case-14 | pass→pass | 12,461 | 5,039 | -60% | 1 | 1 | 0% | 1,367 | 4,438 | +225% | 0 | 0 | — |
case-15 | pass→pass | 26,447 | 19,766 | -25% | 1 | 1 | 0% | 3,129 | 6,053 | +93% | 0 | 0 | — |
case-16 | pass→pass | 3,818 | 8,071 | +111% | 1 | 1 | 0% | 611 | 3,920 | +542% | 0 | 0 | — |
case-17 | pass→pass | 13,749 | 13,042 | -5% | 1 | 1 | 0% | 1,589 | 4,989 | +214% | 0 | 0 | — |
case-18 | pass→pass | 11,581 | 8,732 | -25% | 1 | 1 | 0% | 936 | 4,087 | +337% | 0 | 0 | — |
case-19 | pass→pass | 8,580 | 8,694 | +1% | 1 | 1 | 0% | 577 | 4,056 | +603% | 0 | 0 | — |
case-20 | pass→pass | 10,190 | 10,466 | +3% | 1 | 1 | 0% | 958 | 4,419 | +361% | 0 | 0 | — |
case-21 | fail→pass | 10,715 | 3,126 | -71% | 1 | 1 | 0% | 1,062 | 3,960 | +273% | 0 | 0 | — |
case-22 | pass→pass | 11,868 | 12,907 | +9% | 1 | 1 | 0% | 1,130 | 4,703 | +316% | 0 | 0 | — |
case-23 | fail→pass | 15,586 | 9,738 | -38% | 1 | 1 | 0% | 1,652 | 4,216 | +155% | 0 | 0 | — |
case-24 | pass→pass | 18,122 | 10,087 | -44% | 1 | 1 | 0% | 1,794 | 5,291 | +195% | 0 | 0 | — |
case-25 | pass→pass | 5,958 | 17,666 | +197% | 1 | 1 | 0% | 774 | 4,836 | +525% | 0 | 0 | — |
case-26 | pass→pass | 21,064 | 23,756 | +13% | 1 | 1 | 0% | 2,519 | 5,787 | +130% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 26 cases were attempted, and 25 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +15 percentage points is the difference between those two pass rates over the 25 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.