Back to skills
SKILL.md
Android Dex Unpacking
ASecurityIdentifies commercial Android APK packers (360, Tencent Legu, Bangcle, IJiami, NetEase Yidun, etc.), APK Signature Schemes (V1/V2/V3), and guides memory DEX dumping or instruction-extraction recovery during authorized security audits. Use when JADX shows only StubApp/ProxyApplication, business classes are missing, or repackaged APKs crash on startup.
- 5 stars
- 0 votes
- 0 copies
- 0 views
- Added December 1, 2026
Works with
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add muyang520/awesome-mobile-re-mcp-skills --skill android-dex-unpacking --agent claude-codeAre you the author of Android Dex Unpacking?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/muyang520-android-dex-unpacking)---
name: android-dex-unpacking
description: >-
Identifies commercial Android APK packers (360, Tencent Legu, Bangcle, IJiami, NetEase Yidun, etc.), APK Signature Schemes (V1/V2/V3),
and guides memory DEX dumping or instruction-extraction recovery during authorized security audits.
Use when JADX shows only StubApp/ProxyApplication, business classes are missing, or repackaged APKs crash on startup.
---
# Android APK Packer Triage & DEX Unpacking SOP
Never waste tokens searching business logic inside a packed APK before identifying the shell generation and dumping the real DEX payloads from runtime memory.
---
## Step 1: Run Automated Packer & Signature Triage (0.2 Seconds)
Always run the bundled zero-dependency scanner first before opening JADX or IDA:
```bash
python skills/android-dex-unpacking/scripts/apk_packer_detector.py target.apk --json
```
Helper script: [apk_packer_detector.py](./scripts/apk_packer_detector.py)
Inspect three critical outputs from the JSON report:
1. **`detected_packers` & `stub_dex_suspect`**: If `dex_count == 1` (`< 180 KB`) while `lib/arm64-v8a/` contains native shell libraries (`libjiagu*.so`, `libshella*.so`, `libSecShell*.so`, `libexec.so`, `libnesec.so`), all real Java code is encrypted.
2. **`detected_frameworks`**: Check if business logic actually lives inside `libflutter.so`/`libapp.so` (`flutter-https-capture`), `libil2cpp.so`, or `index.android.bundle` (`il2cpp-hermes-miniapp`) rather than DEX!
3. **`signing_schemes`**: Presence of **V2 (`0x7109871a`)** or **V3 (`0xf05368c0`)** inside `APK Sig Block 42` means naive `apktool b` repackaging alters the signing certificate and triggers signature-tamper crashes unless signature checks are also analyzed.
---
## Step 2: Classify Packer Generation & Select Unpacking Path
| Generation | Technical Mechanism | Symptoms in JADX after Basic Memory Dump | Recommended Authorized Unpacking Approach |
| :--- | :--- | :--- | :--- |
| **Gen 1: Dynamic DEX Loading** | Decrypts full `.dex` to file/memory and loads via `DexClassLoader` / `InMemoryDexClassLoader` | Dumped DEX decompiles cleanly with intact method bodies | `frida-dexdump` or hook `art::DexFileLoader::OpenCommon` / `DefineClass` after app reaches home screen. |
| **Gen 2: DEX Header Zeroing / Cookie Hook** | Zeroes `dex\n035\0` magic in memory after `LoadMethod` | `frida-dexdump` misses DEX unless deep-scan mode (`-d`) reconstructs headers | Run `frida-dexdump -U -f <pkg> -d` or hook `libart.so` `OpenCommon` *before* header erasure. |
| **Gen 3: Instruction Extraction (`nop` Filling)** | Method bodies in dumped DEX are filled with `00 00` (`nop`) until each method is actually executed | Class/method names visible in JADX, but target method body throws decompiler errors or shows `return;` / `nop` | **Active Call Unpacking** (`FART` / `Youpk` custom ART ROM, or targeted Frida invocation forcing `LoadMethod` / `ArtMethod::Invoke` on the specific target class, then dumping its `CodeItem` bytecode). |
| **Gen 4: Java-to-Native (`dex2c` / VMP)** | Critical methods marked `native` (`onCreate`, `sign`); Java bytecode compiled to obfuscated C/ARM64 or custom VM bytecode in `.so` | Method has `native` modifier in dumped DEX with no Java bytecode | Pivot immediately to **`so-jni-triage`**:resolve `RegisterNatives` offset in the packer `.so` and trace via Frida / Unidbg. |
---
## Step 3: Post-Dump Verification & JADX Re-Indexing
1. Verify dumped `.dex` integrity: check `file_size == struct.unpack("<I", dex[32:36])[0]` and search for the real `Application` class (inspect `AppComponentFactory` or `Application.attachBaseContext` chain).
2. Load all dumped `classes*.dex` simultaneously into **JADX-GUI** (`File -> Add files` so cross-DEX references resolve cleanly across `jadx-ai-mcp`)!
3. **APK Signature Verification Checkpoints** (when diagnosing repackage crashes):
- Java layer: `PackageManager.getPackageInfo(pkg, GET_SIGNATURES | GET_SIGNING_CERTIFICATES)`.
- Native layer: `openat` reading `/data/app/.../base.apk` directly to parse the ZIP `APK Sig Block 42` X.509 certificate bypassing Java hooks!
Files in this skill
- SKILL.md
- scripts/apk_packer_detector.py
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.