$npx -y skills add CreditTone/android-reverse-engineering-skill --skill android-reverse-engineeringDecompile Android APK, XAPK, JAR, and AAR files using jadx or Fernflower/Vineflower. Reverse engineer Android apps, extract HTTP API endpoints, trace call flows from UI to network layer, and analyze runtime behavior with Frida, network capture, JNI/SO inspection, and signature ge
| 1 | # Android Reverse Engineering |
| 2 | |
| 3 | Decompile Android APK, XAPK, JAR, and AAR files using jadx and Fernflower/Vineflower, trace call flows through application code and libraries, produce structured documentation of extracted APIs, and escalate to runtime analysis only after static triage shows that it is needed. Two decompiler engines are supported: jadx for broad Android coverage and Fernflower/Vineflower for higher-quality output on complex Java code. |
| 4 | |
| 5 | ## Core Principle |
| 6 | |
| 7 | Do not jump straight into Frida, packet capture, or SO analysis. Start with JADX and identify: |
| 8 | |
| 9 | - The network stack in use |
| 10 | - The request builder or interceptor chain |
| 11 | - Where signing or encryption appears to happen |
| 12 | - Whether the logic is visible in Java or delegated to native code |
| 13 | |
| 14 | Use dynamic analysis only to confirm or bridge gaps that static analysis cannot resolve. |
| 15 | |
| 16 | ## When to Suggest IDA MCP |
| 17 | |
| 18 | IDA MCP provides static binary analysis (disassembly, decompilation, cross-references) for `.so` files. Do NOT suggest it blindly — check these conditions first: |
| 19 | |
| 20 | **Suggest IDA MCP when the user asks to:** |
| 21 | - Find function offsets or exports in a specific SO |
| 22 | - Decompile a known native function to C pseudocode |
| 23 | - Trace cross-references to a string, symbol, or address |
| 24 | - Check whether a SO imports crypto/network libraries |
| 25 | - Analyze a SO that is NOT obfuscated (standard compiler, recognizable function boundaries) |
| 26 | |
| 27 | **Do NOT suggest IDA MCP when:** |
| 28 | - The SO uses control-flow flattening or similary heavy obfuscation — pseudocode will be unreadable. Use Frida scripts instead. |
| 29 | - All strings in the SO are encrypted — static search finds nothing. Use `jni_method_trace.js` to capture runtime decryption. |
| 30 | - The user needs runtime values (keys, tokens, parameters, decrypted data) — IDA can only show static code. |
| 31 | - The target SO has not yet been identified — suggest `jni_method_trace.js` first to find which SO handles the logic. |
| 32 | - The user needs to compute or generate a signature, ciphertext, or token — this requires runtime execution, not static analysis. |
| 33 | |
| 34 | **Quick check before suggesting:** Use `survey_binary` on the SO. If the output shows only a handful of huge functions (> 10 KB each) instead of many small ones, the binary is obfuscated — skip IDA and suggest Frida. |
| 35 | |
| 36 | ## Prerequisites |
| 37 | |
| 38 | This skill requires **Java JDK 17+** and **jadx** to be installed. **Fernflower/Vineflower**, **dex2jar**, and **rizin** are optional but recommended for better decompilation quality and native `.so` analysis. Run the dependency checker to verify: |
| 39 | |
| 40 | ```bash |
| 41 | bash skills/android-reverse-engineering/scripts/check-deps.sh |
| 42 | ``` |
| 43 | |
| 44 | On Windows (PowerShell): |
| 45 | |
| 46 | ```powershell |
| 47 | & "skills/android-reverse-engineering/scripts/check-deps.ps1" |
| 48 | ``` |
| 49 | |
| 50 | If anything is missing, follow the installation instructions in `skills/android-reverse-engineering/references/setup-guide.md`. |
| 51 | |
| 52 | ## Workflow |
| 53 | |
| 54 | ### Phase 1: Verify and Install Dependencies |
| 55 | |
| 56 | Before decompiling, confirm that the required tools are available — and install any that are missing. |
| 57 | |
| 58 | **Action**: Run the dependency check script. |
| 59 | |
| 60 | ```bash |
| 61 | bash skills/android-reverse-engineering/scripts/check-deps.sh |
| 62 | ``` |
| 63 | |
| 64 | On Windows (PowerShell): |
| 65 | |
| 66 | ```powershell |
| 67 | & "skills/android-reverse-engineering/scripts/check-deps.ps1" |
| 68 | ``` |
| 69 | |
| 70 | The output contains machine-readable lines: |
| 71 | - `INSTALL_REQUIRED:<dep>` — must be installed before proceeding |
| 72 | - `INSTALL_OPTIONAL:<dep>` — recommended but not blocking |
| 73 | |
| 74 | **If required dependencies are missing** (exit code 1), install them automatically: |
| 75 | |
| 76 | ```bash |
| 77 | bash skills/android-reverse-engineering/scripts/install-dep.sh <dep> |
| 78 | ``` |
| 79 | |
| 80 | On Windows (PowerShell): |
| 81 | |
| 82 | ```powershell |
| 83 | & "skills/android-reverse-engineering/scripts/install-dep.ps1" <dep> |
| 84 | ``` |
| 85 | |
| 86 | The install script detects the OS and package manager, then: |
| 87 | - Installs without sudo when possible (downloads to `~/.local/share/`, symlinks in `~/.local/bin/`) |
| 88 | - Uses sudo and the system package manager when necessary (apt, dnf, pacman) |
| 89 | - If sudo is needed but unavailable or the user declines, it prints the exact manual command and exits with code 2 — show these instructions to the user |
| 90 | |
| 91 | Windows notes: |
| 92 | |
| 93 | - The Powe |