android-decompile-mcp 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.fr.md ADDED
@@ -0,0 +1,226 @@
1
+ # DexAndroid
2
+
3
+ [English](./README.md) · [简体中文](./README.zh-CN.md) · [繁體中文](./README.zh-TW.md) · [日本語](./README.ja.md) · [한국어](./README.ko.md) · [Español](./README.es.md) · **Français** · [Deutsch](./README.de.md) · [Português](./README.pt-BR.md) · [Русский](./README.ru.md) · [العربية](./README.ar.md) · [हिन्दी](./README.hi.md) · [Bahasa Indonesia](./README.id.md) · [Tiếng Việt](./README.vi.md) · [ไทย](./README.th.md) · [Italiano](./README.it.md) · [Türkçe](./README.tr.md)
4
+
5
+ > ⚠️ **Uniquement à des fins d’apprentissage et d’enseignement.** Interdit pour toute activité illégale, crack non autorisé, contrefaçon ou contournement de protections. Respectez les lois locales et les conditions de l’application. Vous êtes responsable des abus.
6
+
7
+ **MCP Server** de dépaquetage Android + analyse smali. Depuis Cursor / Claude : appareils, détection de packers, unpack statique / BlackDex / Frida, dex→smali, recherche d’API.
8
+
9
+ Repo: [https://github.com/TimeCyber/DexAndroid](https://github.com/TimeCyber/DexAndroid)
10
+
11
+ ---
12
+
13
+ ## Fonctionnalités
14
+
15
+ | Capacité | Outil MCP | Notes |
16
+ | --- | --- | --- |
17
+ | Devices | `list_devices` | Connected ADB devices |
18
+ | Packages | `list_packages` | Optional keyword filter |
19
+ | Packer detect | `detect_packer` | 360 / Tencent / Bangcle / ijiami / Alibaba, etc. |
20
+ | Pull APK | `pull_apk` | Installed app (+ splits) |
21
+ | Static unpack | `static_unpack` | Extract `classes*.dex` |
22
+ | No-Root unpack | `blackdex_prepare` / `blackdex_pull` | BlackDex memory dump |
23
+ | Root unpack | `frida_prepare` / `frida_unpack` | frida-server + frida-dexdump |
24
+ | Decompile | `dex_to_smali` | baksmali → smali |
25
+ | Analyze | `smali_list_classes` / `smali_read_class` / `smali_search` | List / read / regex |
26
+
27
+ ### Méthodes d’unpack
28
+
29
+ | Méthode | Root ? | Cas d’usage |
30
+ | --- | --- | --- |
31
+ | Static | No | Unpacked apps or shell/resources only |
32
+ | BlackDex | No | Most protected apps |
33
+ | Frida | **Yes** | Strong packers / fuller dumps |
34
+
35
+ ---
36
+
37
+ ## Prérequis
38
+
39
+ - **Windows / macOS / Linux** (docs use Windows examples)
40
+ - **Node.js** ≥ 18
41
+ - **ADB** on PATH, or set `ADB_PATH`
42
+ - **Java 8+** (for baksmali via `dex_to_smali`)
43
+ - Optional: [BlackDex](https://github.com/CodingGay/BlackDex/releases); rooted device + `frida-server`; `pip install frida-tools frida-dexdump`
44
+
45
+ Place baksmali fat jar / frida-server / BlackDex under local `tools/` (large binaries are gitignored).
46
+
47
+ ---
48
+
49
+ ## Installation et build
50
+
51
+ ```bash
52
+ git clone https://github.com/TimeCyber/DexAndroid.git
53
+ cd DexAndroid
54
+ npm install
55
+ npm run build
56
+ ```
57
+
58
+ Démarrer le MCP (stdio):
59
+
60
+ ```bash
61
+ npm start
62
+ # node dist/index.js
63
+ ```
64
+
65
+ Mode développement:
66
+
67
+ ```bash
68
+ npm run dev
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Intégration Cursor (MCP)
74
+
75
+ Ajoutez dans `.cursor/mcp.json` (**adaptez les chemins**) :
76
+
77
+ ```json
78
+ {
79
+ "mcpServers": {
80
+ "dex-android-unpack": {
81
+ "command": "node",
82
+ "args": ["E:/DexAndroid/dist/index.js"],
83
+ "env": {
84
+ "ADB_PATH": "E:/Android/Sdk/platform-tools/adb.exe",
85
+ "DEX_OUT_DIR": "E:/DexAndroid/unpack-output"
86
+ }
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ Redémarrez Cursor / rechargez le MCP.
93
+
94
+ ---
95
+
96
+ ## Variables d’environnement
97
+
98
+ | Variable | Signification | Défaut |
99
+ | --- | --- | --- |
100
+ | `ADB_PATH` | adb executable | `adb` |
101
+ | `DEX_OUT_DIR` | Default output dir | `<cwd>/unpack-output` |
102
+ | `BAKSMALI_JAR` | baksmali jar | auto-discover under `tools/` |
103
+
104
+ ---
105
+
106
+ ## Flux typiques
107
+
108
+ ### 1. Unpack statique (le plus rapide)
109
+
110
+ 1. `list_devices` or prepare local `apkPath`.
111
+ 2. `detect_packer`.
112
+ 3. `static_unpack` → `classes*.dex`.
113
+ 4. `dex_to_smali` → smali folder.
114
+ 5. `smali_search` / `smali_read_class`.
115
+
116
+ **Note:** Protected apps often yield only the shell via static unpack—use BlackDex / Frida for business code.
117
+
118
+ ### 2. Sans Root (BlackDex)
119
+
120
+ 1. `list_devices`.
121
+ 2. `blackdex_prepare` with `blackdexApkPath`.
122
+ 3. Unpack the target app in BlackDex UI.
123
+ 4. `blackdex_pull` with `targetPkg`.
124
+ 5. `dex_to_smali` then `smali_*`.
125
+
126
+ ### 3. Avec Root (Frida)
127
+
128
+ 1. Rooted device (e.g. Magisk), `adb` ready.
129
+ 2. `frida_prepare` to push/start `tools/frida-server`.
130
+ 3. Matching `frida` / `frida-dexdump` locally (prefer 16.x).
131
+ 4. `frida_unpack` with `pkg`, prefer `spawn: true`, `deepSearch: true`.
132
+ 5. `dex_to_smali` on output, then analyze.
133
+
134
+ If Frida 17 attach fails, align tools to 16.x; some devices need temporary `setenforce 0`.
135
+
136
+ ### 4. Exemples smali
137
+
138
+ ```text
139
+ smali_list_classes smaliDir=.../smali keyword=login
140
+ smali_search smaliDir=.../smali pattern=https?://|/api/|publicClient/
141
+ smali_read_class smaliDir=.../smali className=com.example.api.ApiService
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Structure
147
+
148
+ ```text
149
+ DexAndroid/
150
+ ├── src/ # MCP server (TypeScript)
151
+ │ ├── index.ts
152
+ │ ├── adb.ts
153
+ │ ├── detect.ts
154
+ │ ├── smali.ts
155
+ │ └── unpack/
156
+ ├── dist/
157
+ ├── examples/ # Damai / Huaxi sample smali.zip + docs
158
+ ├── tools/ # baksmali / frida-server / BlackDex (local)
159
+ ├── unpack-output/ # local dumps (gitignored)
160
+ ├── package.json
161
+ └── README.md
162
+ ```
163
+
164
+ ---
165
+
166
+ ## Exemples de décompilation
167
+
168
+ Voir [`examples/`](./examples/) (smali en zip) :
169
+
170
+ | Exemple | Chemin | Contenu |
171
+ | --- | --- | --- |
172
+ | Damai | [`examples/damai/`](./examples/damai/) | Frida smali.zip + API docs |
173
+ | Huaxi Maternity | [`examples/huaxi/`](./examples/huaxi/) | Static smali.zip (`info.cd120.two`) |
174
+
175
+ Après extraction, utilisez `smali_*`.
176
+
177
+ ---
178
+
179
+ ## Aide-mémoire MCP
180
+
181
+ | Tool | Params |
182
+ | --- | --- |
183
+ | `detect_packer` | `apkPath` or `pkg`, optional `serial` |
184
+ | `pull_apk` | `pkg`, optional `outDir` / `serial` |
185
+ | `static_unpack` | `apkPath` or `pkg`, optional `outDir` |
186
+ | `blackdex_prepare` | `blackdexApkPath`, optional `serial` |
187
+ | `blackdex_pull` | `targetPkg`, optional `outDir` / `serial` |
188
+ | `frida_prepare` | optional `serial` / `serverLocalPath` |
189
+ | `frida_unpack` | `pkg`, optional `spawn` / `deepSearch` / `outDir` |
190
+ | `dex_to_smali` | `dexInput`, optional `outDir` |
191
+ | `smali_list_classes` | `smaliDir`, optional `keyword` |
192
+ | `smali_read_class` | `smaliDir`, `className` |
193
+ | `smali_search` | `smaliDir`, `pattern`, optional `flags` / `maxResults` |
194
+
195
+ ---
196
+
197
+ ## FAQ
198
+
199
+ **Q: Empty `list_devices`?**
200
+ Check USB debugging, `adb devices`, pass `serial` if multiple.
201
+
202
+ **Q: No business classes after static unpack?**
203
+ Likely packed—use BlackDex or Frida.
204
+
205
+ **Q: `dex_to_smali` failed?**
206
+ Install Java; put baksmali jar in `tools/` or set `BAKSMALI_JAR`.
207
+
208
+ **Q: Frida jailed / version mismatch?**
209
+ Keep `frida-server` and host `frida` major versions aligned; try 16.x.
210
+
211
+ **Q: Where is output?**
212
+ Default `unpack-output/` (or `DEX_OUT_DIR`). **Do not commit dumps.**
213
+
214
+ ---
215
+
216
+ ## Mentions légales
217
+
218
+ Ce projet est **réservé à l’apprentissage, l’enseignement et la recherche en sécurité autorisée**. Toute utilisation criminelle ou illégale (accès non autorisé, crack, piratage, attaques, atteinte à la PI) est interdite. Les auteurs ne sont pas responsables des abus. L’utilisation vaut acceptation.
219
+
220
+ > ⚠️ **Uniquement à des fins d’apprentissage et d’enseignement.** Interdit pour toute activité illégale, crack non autorisé, contrefaçon ou contournement de protections. Respectez les lois locales et les conditions de l’application. Vous êtes responsable des abus.
221
+
222
+ ---
223
+
224
+ ## License
225
+
226
+ MIT — see [`LICENSE`](./LICENSE).
package/README.hi.md ADDED
@@ -0,0 +1,226 @@
1
+ # DexAndroid
2
+
3
+ [English](./README.md) · [简体中文](./README.zh-CN.md) · [繁體中文](./README.zh-TW.md) · [日本語](./README.ja.md) · [한국어](./README.ko.md) · [Español](./README.es.md) · [Français](./README.fr.md) · [Deutsch](./README.de.md) · [Português](./README.pt-BR.md) · [Русский](./README.ru.md) · [العربية](./README.ar.md) · **हिन्दी** · [Bahasa Indonesia](./README.id.md) · [Tiếng Việt](./README.vi.md) · [ไทย](./README.th.md) · [Italiano](./README.it.md) · [Türkçe](./README.tr.md)
4
+
5
+ > ⚠️ **केवल सीखने और शिक्षण के लिए।** किसी भी अवैध गतिविधि, अनधिकृत क्रैकिंग, कॉपीराइट उल्लंघन या दूसरों की सुरक्षा बायपास करने के लिए उपयोग न करें। स्थानीय कानून और ऐप की शर्तों का पालन करें। दुरुपयोग की ज़िम्मेदारी उपयोगकर्ता की है।
6
+
7
+ Android अनपैकिंग + smali विश्लेषण **MCP Server**। Cursor / Claude से डिवाइस प्रबंधन, पैकर डिटेक्ट, static / BlackDex / Frida अनपैक, dex→smali और API स्ट्रिंग खोज।
8
+
9
+ Repo: [https://github.com/TimeCyber/DexAndroid](https://github.com/TimeCyber/DexAndroid)
10
+
11
+ ---
12
+
13
+ ## विशेषताएँ
14
+
15
+ | क्षमता | MCP टूल | नोट्स |
16
+ | --- | --- | --- |
17
+ | Devices | `list_devices` | Connected ADB devices |
18
+ | Packages | `list_packages` | Optional keyword filter |
19
+ | Packer detect | `detect_packer` | 360 / Tencent / Bangcle / ijiami / Alibaba, etc. |
20
+ | Pull APK | `pull_apk` | Installed app (+ splits) |
21
+ | Static unpack | `static_unpack` | Extract `classes*.dex` |
22
+ | No-Root unpack | `blackdex_prepare` / `blackdex_pull` | BlackDex memory dump |
23
+ | Root unpack | `frida_prepare` / `frida_unpack` | frida-server + frida-dexdump |
24
+ | Decompile | `dex_to_smali` | baksmali → smali |
25
+ | Analyze | `smali_list_classes` / `smali_read_class` / `smali_search` | List / read / regex |
26
+
27
+ ### अनपैक विधियाँ
28
+
29
+ | विधि | Root? | कब |
30
+ | --- | --- | --- |
31
+ | Static | No | Unpacked apps or shell/resources only |
32
+ | BlackDex | No | Most protected apps |
33
+ | Frida | **Yes** | Strong packers / fuller dumps |
34
+
35
+ ---
36
+
37
+ ## आवश्यकताएँ
38
+
39
+ - **Windows / macOS / Linux** (docs use Windows examples)
40
+ - **Node.js** ≥ 18
41
+ - **ADB** on PATH, or set `ADB_PATH`
42
+ - **Java 8+** (for baksmali via `dex_to_smali`)
43
+ - Optional: [BlackDex](https://github.com/CodingGay/BlackDex/releases); rooted device + `frida-server`; `pip install frida-tools frida-dexdump`
44
+
45
+ Place baksmali fat jar / frida-server / BlackDex under local `tools/` (large binaries are gitignored).
46
+
47
+ ---
48
+
49
+ ## इंस्टॉल और बिल्ड
50
+
51
+ ```bash
52
+ git clone https://github.com/TimeCyber/DexAndroid.git
53
+ cd DexAndroid
54
+ npm install
55
+ npm run build
56
+ ```
57
+
58
+ MCP शुरू करें (stdio):
59
+
60
+ ```bash
61
+ npm start
62
+ # node dist/index.js
63
+ ```
64
+
65
+ डेव मोड:
66
+
67
+ ```bash
68
+ npm run dev
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Cursor MCP सेटअप
74
+
75
+ `.cursor/mcp.json` में जोड़ें (**पथ बदलें**):
76
+
77
+ ```json
78
+ {
79
+ "mcpServers": {
80
+ "dex-android-unpack": {
81
+ "command": "node",
82
+ "args": ["E:/DexAndroid/dist/index.js"],
83
+ "env": {
84
+ "ADB_PATH": "E:/Android/Sdk/platform-tools/adb.exe",
85
+ "DEX_OUT_DIR": "E:/DexAndroid/unpack-output"
86
+ }
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ Cursor रीस्टार्ट / MCP रीलोड करें।
93
+
94
+ ---
95
+
96
+ ## एनवायरनमेंट वेरिएबल
97
+
98
+ | वेरिएबल | अर्थ | डिफ़ॉल्ट |
99
+ | --- | --- | --- |
100
+ | `ADB_PATH` | adb executable | `adb` |
101
+ | `DEX_OUT_DIR` | Default output dir | `<cwd>/unpack-output` |
102
+ | `BAKSMALI_JAR` | baksmali jar | auto-discover under `tools/` |
103
+
104
+ ---
105
+
106
+ ## सामान्य वर्कफ़्लो
107
+
108
+ ### 1. स्टैटिक अनपैक (सबसे तेज़)
109
+
110
+ 1. `list_devices` or prepare local `apkPath`.
111
+ 2. `detect_packer`.
112
+ 3. `static_unpack` → `classes*.dex`.
113
+ 4. `dex_to_smali` → smali folder.
114
+ 5. `smali_search` / `smali_read_class`.
115
+
116
+ **Note:** Protected apps often yield only the shell via static unpack—use BlackDex / Frida for business code.
117
+
118
+ ### 2. बिना Root (BlackDex)
119
+
120
+ 1. `list_devices`.
121
+ 2. `blackdex_prepare` with `blackdexApkPath`.
122
+ 3. Unpack the target app in BlackDex UI.
123
+ 4. `blackdex_pull` with `targetPkg`.
124
+ 5. `dex_to_smali` then `smali_*`.
125
+
126
+ ### 3. Root के साथ (Frida)
127
+
128
+ 1. Rooted device (e.g. Magisk), `adb` ready.
129
+ 2. `frida_prepare` to push/start `tools/frida-server`.
130
+ 3. Matching `frida` / `frida-dexdump` locally (prefer 16.x).
131
+ 4. `frida_unpack` with `pkg`, prefer `spawn: true`, `deepSearch: true`.
132
+ 5. `dex_to_smali` on output, then analyze.
133
+
134
+ If Frida 17 attach fails, align tools to 16.x; some devices need temporary `setenforce 0`.
135
+
136
+ ### 4. smali उदाहरण
137
+
138
+ ```text
139
+ smali_list_classes smaliDir=.../smali keyword=login
140
+ smali_search smaliDir=.../smali pattern=https?://|/api/|publicClient/
141
+ smali_read_class smaliDir=.../smali className=com.example.api.ApiService
142
+ ```
143
+
144
+ ---
145
+
146
+ ## संरचना
147
+
148
+ ```text
149
+ DexAndroid/
150
+ ├── src/ # MCP server (TypeScript)
151
+ │ ├── index.ts
152
+ │ ├── adb.ts
153
+ │ ├── detect.ts
154
+ │ ├── smali.ts
155
+ │ └── unpack/
156
+ ├── dist/
157
+ ├── examples/ # Damai / Huaxi sample smali.zip + docs
158
+ ├── tools/ # baksmali / frida-server / BlackDex (local)
159
+ ├── unpack-output/ # local dumps (gitignored)
160
+ ├── package.json
161
+ └── README.md
162
+ ```
163
+
164
+ ---
165
+
166
+ ## डीकंपाइल उदाहरण
167
+
168
+ [`examples/`](./examples/) देखें (smali zip में):
169
+
170
+ | नमूना | पथ | सामग्री |
171
+ | --- | --- | --- |
172
+ | Damai | [`examples/damai/`](./examples/damai/) | Frida smali.zip + API docs |
173
+ | Huaxi Maternity | [`examples/huaxi/`](./examples/huaxi/) | Static smali.zip (`info.cd120.two`) |
174
+
175
+ अनज़िप के बाद `smali_*` चलाएँ।
176
+
177
+ ---
178
+
179
+ ## MCP टूल चीटशीट
180
+
181
+ | Tool | Params |
182
+ | --- | --- |
183
+ | `detect_packer` | `apkPath` or `pkg`, optional `serial` |
184
+ | `pull_apk` | `pkg`, optional `outDir` / `serial` |
185
+ | `static_unpack` | `apkPath` or `pkg`, optional `outDir` |
186
+ | `blackdex_prepare` | `blackdexApkPath`, optional `serial` |
187
+ | `blackdex_pull` | `targetPkg`, optional `outDir` / `serial` |
188
+ | `frida_prepare` | optional `serial` / `serverLocalPath` |
189
+ | `frida_unpack` | `pkg`, optional `spawn` / `deepSearch` / `outDir` |
190
+ | `dex_to_smali` | `dexInput`, optional `outDir` |
191
+ | `smali_list_classes` | `smaliDir`, optional `keyword` |
192
+ | `smali_read_class` | `smaliDir`, `className` |
193
+ | `smali_search` | `smaliDir`, `pattern`, optional `flags` / `maxResults` |
194
+
195
+ ---
196
+
197
+ ## FAQ
198
+
199
+ **Q: Empty `list_devices`?**
200
+ Check USB debugging, `adb devices`, pass `serial` if multiple.
201
+
202
+ **Q: No business classes after static unpack?**
203
+ Likely packed—use BlackDex or Frida.
204
+
205
+ **Q: `dex_to_smali` failed?**
206
+ Install Java; put baksmali jar in `tools/` or set `BAKSMALI_JAR`.
207
+
208
+ **Q: Frida jailed / version mismatch?**
209
+ Keep `frida-server` and host `frida` major versions aligned; try 16.x.
210
+
211
+ **Q: Where is output?**
212
+ Default `unpack-output/` (or `DEX_OUT_DIR`). **Do not commit dumps.**
213
+
214
+ ---
215
+
216
+ ## कानूनी अस्वीकरण
217
+
218
+ यह प्रोजेक्ट **केवल सीखने, शिक्षण और अधिकृत सुरक्षा अनुसंधान** के लिए है। किसी भी आपराधिक/अवैध उपयोग (अनधिकृत पहुँच, क्रैकिंग, पायरेसी, हमले, IP उल्लंघन) पर सख्त प्रतिबंध है। दुरुपयोग के लिए लेखक उत्तरदायी नहीं। उपयोग का अर्थ इन शर्तों से सहमति है।
219
+
220
+ > ⚠️ **केवल सीखने और शिक्षण के लिए।** किसी भी अवैध गतिविधि, अनधिकृत क्रैकिंग, कॉपीराइट उल्लंघन या दूसरों की सुरक्षा बायपास करने के लिए उपयोग न करें। स्थानीय कानून और ऐप की शर्तों का पालन करें। दुरुपयोग की ज़िम्मेदारी उपयोगकर्ता की है।
221
+
222
+ ---
223
+
224
+ ## License
225
+
226
+ MIT — see [`LICENSE`](./LICENSE).
package/README.id.md ADDED
@@ -0,0 +1,226 @@
1
+ # DexAndroid
2
+
3
+ [English](./README.md) · [简体中文](./README.zh-CN.md) · [繁體中文](./README.zh-TW.md) · [日本語](./README.ja.md) · [한국어](./README.ko.md) · [Español](./README.es.md) · [Français](./README.fr.md) · [Deutsch](./README.de.md) · [Português](./README.pt-BR.md) · [Русский](./README.ru.md) · [العربية](./README.ar.md) · [हिन्दी](./README.hi.md) · **Bahasa Indonesia** · [Tiếng Việt](./README.vi.md) · [ไทย](./README.th.md) · [Italiano](./README.it.md) · [Türkçe](./README.tr.md)
4
+
5
+ > ⚠️ **Hanya untuk belajar dan mengajar.** Jangan gunakan untuk kegiatan ilegal, cracking tanpa izin, pelanggaran hak cipta, atau melewati proteksi pihak lain. Patuhi hukum setempat dan syarat aplikasi. Penyalahgunaan menjadi tanggung jawab pengguna.
6
+
7
+ **MCP Server** unpacking Android + analisis smali. Dari Cursor / Claude: perangkat, deteksi packer, unpack statis / BlackDex / Frida, dex→smali, pencarian string API.
8
+
9
+ Repo: [https://github.com/TimeCyber/DexAndroid](https://github.com/TimeCyber/DexAndroid)
10
+
11
+ ---
12
+
13
+ ## Fitur
14
+
15
+ | Kemampuan | Alat MCP | Catatan |
16
+ | --- | --- | --- |
17
+ | Devices | `list_devices` | Connected ADB devices |
18
+ | Packages | `list_packages` | Optional keyword filter |
19
+ | Packer detect | `detect_packer` | 360 / Tencent / Bangcle / ijiami / Alibaba, etc. |
20
+ | Pull APK | `pull_apk` | Installed app (+ splits) |
21
+ | Static unpack | `static_unpack` | Extract `classes*.dex` |
22
+ | No-Root unpack | `blackdex_prepare` / `blackdex_pull` | BlackDex memory dump |
23
+ | Root unpack | `frida_prepare` / `frida_unpack` | frida-server + frida-dexdump |
24
+ | Decompile | `dex_to_smali` | baksmali → smali |
25
+ | Analyze | `smali_list_classes` / `smali_read_class` / `smali_search` | List / read / regex |
26
+
27
+ ### Metode unpack
28
+
29
+ | Metode | Root? | Kapan |
30
+ | --- | --- | --- |
31
+ | Static | No | Unpacked apps or shell/resources only |
32
+ | BlackDex | No | Most protected apps |
33
+ | Frida | **Yes** | Strong packers / fuller dumps |
34
+
35
+ ---
36
+
37
+ ## Persyaratan
38
+
39
+ - **Windows / macOS / Linux** (docs use Windows examples)
40
+ - **Node.js** ≥ 18
41
+ - **ADB** on PATH, or set `ADB_PATH`
42
+ - **Java 8+** (for baksmali via `dex_to_smali`)
43
+ - Optional: [BlackDex](https://github.com/CodingGay/BlackDex/releases); rooted device + `frida-server`; `pip install frida-tools frida-dexdump`
44
+
45
+ Place baksmali fat jar / frida-server / BlackDex under local `tools/` (large binaries are gitignored).
46
+
47
+ ---
48
+
49
+ ## Instalasi & build
50
+
51
+ ```bash
52
+ git clone https://github.com/TimeCyber/DexAndroid.git
53
+ cd DexAndroid
54
+ npm install
55
+ npm run build
56
+ ```
57
+
58
+ Jalankan MCP (stdio):
59
+
60
+ ```bash
61
+ npm start
62
+ # node dist/index.js
63
+ ```
64
+
65
+ Mode dev:
66
+
67
+ ```bash
68
+ npm run dev
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Setup Cursor (MCP)
74
+
75
+ Tambahkan ke `.cursor/mcp.json` (**sesuaikan path**):
76
+
77
+ ```json
78
+ {
79
+ "mcpServers": {
80
+ "dex-android-unpack": {
81
+ "command": "node",
82
+ "args": ["E:/DexAndroid/dist/index.js"],
83
+ "env": {
84
+ "ADB_PATH": "E:/Android/Sdk/platform-tools/adb.exe",
85
+ "DEX_OUT_DIR": "E:/DexAndroid/unpack-output"
86
+ }
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ Restart Cursor / reload MCP.
93
+
94
+ ---
95
+
96
+ ## Variabel lingkungan
97
+
98
+ | Variabel | Arti | Default |
99
+ | --- | --- | --- |
100
+ | `ADB_PATH` | adb executable | `adb` |
101
+ | `DEX_OUT_DIR` | Default output dir | `<cwd>/unpack-output` |
102
+ | `BAKSMALI_JAR` | baksmali jar | auto-discover under `tools/` |
103
+
104
+ ---
105
+
106
+ ## Alur tipikal
107
+
108
+ ### 1. Unpack statis (tercepat)
109
+
110
+ 1. `list_devices` or prepare local `apkPath`.
111
+ 2. `detect_packer`.
112
+ 3. `static_unpack` → `classes*.dex`.
113
+ 4. `dex_to_smali` → smali folder.
114
+ 5. `smali_search` / `smali_read_class`.
115
+
116
+ **Note:** Protected apps often yield only the shell via static unpack—use BlackDex / Frida for business code.
117
+
118
+ ### 2. Tanpa Root (BlackDex)
119
+
120
+ 1. `list_devices`.
121
+ 2. `blackdex_prepare` with `blackdexApkPath`.
122
+ 3. Unpack the target app in BlackDex UI.
123
+ 4. `blackdex_pull` with `targetPkg`.
124
+ 5. `dex_to_smali` then `smali_*`.
125
+
126
+ ### 3. Dengan Root (Frida)
127
+
128
+ 1. Rooted device (e.g. Magisk), `adb` ready.
129
+ 2. `frida_prepare` to push/start `tools/frida-server`.
130
+ 3. Matching `frida` / `frida-dexdump` locally (prefer 16.x).
131
+ 4. `frida_unpack` with `pkg`, prefer `spawn: true`, `deepSearch: true`.
132
+ 5. `dex_to_smali` on output, then analyze.
133
+
134
+ If Frida 17 attach fails, align tools to 16.x; some devices need temporary `setenforce 0`.
135
+
136
+ ### 4. Contoh smali
137
+
138
+ ```text
139
+ smali_list_classes smaliDir=.../smali keyword=login
140
+ smali_search smaliDir=.../smali pattern=https?://|/api/|publicClient/
141
+ smali_read_class smaliDir=.../smali className=com.example.api.ApiService
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Struktur
147
+
148
+ ```text
149
+ DexAndroid/
150
+ ├── src/ # MCP server (TypeScript)
151
+ │ ├── index.ts
152
+ │ ├── adb.ts
153
+ │ ├── detect.ts
154
+ │ ├── smali.ts
155
+ │ └── unpack/
156
+ ├── dist/
157
+ ├── examples/ # Damai / Huaxi sample smali.zip + docs
158
+ ├── tools/ # baksmali / frida-server / BlackDex (local)
159
+ ├── unpack-output/ # local dumps (gitignored)
160
+ ├── package.json
161
+ └── README.md
162
+ ```
163
+
164
+ ---
165
+
166
+ ## Contoh dekompilasi
167
+
168
+ Lihat [`examples/`](./examples/) (smali sebagai zip):
169
+
170
+ | Contoh | Path | Isi |
171
+ | --- | --- | --- |
172
+ | Damai | [`examples/damai/`](./examples/damai/) | Frida smali.zip + API docs |
173
+ | Huaxi Maternity | [`examples/huaxi/`](./examples/huaxi/) | Static smali.zip (`info.cd120.two`) |
174
+
175
+ Setelah unzip, jalankan `smali_*`.
176
+
177
+ ---
178
+
179
+ ## Cheatsheet alat MCP
180
+
181
+ | Tool | Params |
182
+ | --- | --- |
183
+ | `detect_packer` | `apkPath` or `pkg`, optional `serial` |
184
+ | `pull_apk` | `pkg`, optional `outDir` / `serial` |
185
+ | `static_unpack` | `apkPath` or `pkg`, optional `outDir` |
186
+ | `blackdex_prepare` | `blackdexApkPath`, optional `serial` |
187
+ | `blackdex_pull` | `targetPkg`, optional `outDir` / `serial` |
188
+ | `frida_prepare` | optional `serial` / `serverLocalPath` |
189
+ | `frida_unpack` | `pkg`, optional `spawn` / `deepSearch` / `outDir` |
190
+ | `dex_to_smali` | `dexInput`, optional `outDir` |
191
+ | `smali_list_classes` | `smaliDir`, optional `keyword` |
192
+ | `smali_read_class` | `smaliDir`, `className` |
193
+ | `smali_search` | `smaliDir`, `pattern`, optional `flags` / `maxResults` |
194
+
195
+ ---
196
+
197
+ ## FAQ
198
+
199
+ **Q: Empty `list_devices`?**
200
+ Check USB debugging, `adb devices`, pass `serial` if multiple.
201
+
202
+ **Q: No business classes after static unpack?**
203
+ Likely packed—use BlackDex or Frida.
204
+
205
+ **Q: `dex_to_smali` failed?**
206
+ Install Java; put baksmali jar in `tools/` or set `BAKSMALI_JAR`.
207
+
208
+ **Q: Frida jailed / version mismatch?**
209
+ Keep `frida-server` and host `frida` major versions aligned; try 16.x.
210
+
211
+ **Q: Where is output?**
212
+ Default `unpack-output/` (or `DEX_OUT_DIR`). **Do not commit dumps.**
213
+
214
+ ---
215
+
216
+ ## Pernyataan hukum
217
+
218
+ Proyek ini **hanya untuk pembelajaran, pengajaran, dan riset keamanan yang diizinkan**. Dilarang keras untuk kejahatan atau ilegalitas (akses tanpa izin, cracking, pembajakan, serangan, pelanggaran IP). Penulis tidak bertanggung jawab atas penyalahgunaan. Dengan menggunakan, Anda menyetujui syarat ini.
219
+
220
+ > ⚠️ **Hanya untuk belajar dan mengajar.** Jangan gunakan untuk kegiatan ilegal, cracking tanpa izin, pelanggaran hak cipta, atau melewati proteksi pihak lain. Patuhi hukum setempat dan syarat aplikasi. Penyalahgunaan menjadi tanggung jawab pengguna.
221
+
222
+ ---
223
+
224
+ ## License
225
+
226
+ MIT — see [`LICENSE`](./LICENSE).