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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 TimeCyber
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.ar.md ADDED
@@ -0,0 +1,228 @@
1
+ dir="rtl"
2
+
3
+ # DexAndroid
4
+
5
+ [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.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)
6
+
7
+ > ⚠️ **للتعلّم والتعليم فقط.** يُحظر الاستخدام في أي نشاط غير قانوني أو اختراق غير مصرّح أو انتهاك حقوق أو تجاوز حماية الغير. التزم بالقوانين المحلية وشروط التطبيق. المسؤولية عن إساءة الاستخدام على المستخدم.
8
+
9
+ **خادم MCP** لفك حزم أندرويد وتحليل smali. من Cursor / Claude: إدارة الأجهزة، كشف الحماية، فك ثابت / BlackDex / Frida، dex→smali، والبحث عن واجهات API.
10
+
11
+ Repo: [https://github.com/TimeCyber/DexAndroid](https://github.com/TimeCyber/DexAndroid)
12
+
13
+ ---
14
+
15
+ ## الميزات
16
+
17
+ | القدرة | أداة MCP | ملاحظات |
18
+ | --- | --- | --- |
19
+ | Devices | `list_devices` | Connected ADB devices |
20
+ | Packages | `list_packages` | Optional keyword filter |
21
+ | Packer detect | `detect_packer` | 360 / Tencent / Bangcle / ijiami / Alibaba, etc. |
22
+ | Pull APK | `pull_apk` | Installed app (+ splits) |
23
+ | Static unpack | `static_unpack` | Extract `classes*.dex` |
24
+ | No-Root unpack | `blackdex_prepare` / `blackdex_pull` | BlackDex memory dump |
25
+ | Root unpack | `frida_prepare` / `frida_unpack` | frida-server + frida-dexdump |
26
+ | Decompile | `dex_to_smali` | baksmali → smali |
27
+ | Analyze | `smali_list_classes` / `smali_read_class` / `smali_search` | List / read / regex |
28
+
29
+ ### طرق فك الحماية
30
+
31
+ | الطريقة | Root؟ | متى |
32
+ | --- | --- | --- |
33
+ | Static | No | Unpacked apps or shell/resources only |
34
+ | BlackDex | No | Most protected apps |
35
+ | Frida | **Yes** | Strong packers / fuller dumps |
36
+
37
+ ---
38
+
39
+ ## المتطلبات
40
+
41
+ - **Windows / macOS / Linux** (docs use Windows examples)
42
+ - **Node.js** ≥ 18
43
+ - **ADB** on PATH, or set `ADB_PATH`
44
+ - **Java 8+** (for baksmali via `dex_to_smali`)
45
+ - Optional: [BlackDex](https://github.com/CodingGay/BlackDex/releases); rooted device + `frida-server`; `pip install frida-tools frida-dexdump`
46
+
47
+ Place baksmali fat jar / frida-server / BlackDex under local `tools/` (large binaries are gitignored).
48
+
49
+ ---
50
+
51
+ ## التثبيت والبناء
52
+
53
+ ```bash
54
+ git clone https://github.com/TimeCyber/DexAndroid.git
55
+ cd DexAndroid
56
+ npm install
57
+ npm run build
58
+ ```
59
+
60
+ تشغيل MCP (stdio):
61
+
62
+ ```bash
63
+ npm start
64
+ # node dist/index.js
65
+ ```
66
+
67
+ وضع التطوير:
68
+
69
+ ```bash
70
+ npm run dev
71
+ ```
72
+
73
+ ---
74
+
75
+ ## إعداد Cursor (MCP)
76
+
77
+ أضف إلى `.cursor/mcp.json` (**عدّل المسارات**):
78
+
79
+ ```json
80
+ {
81
+ "mcpServers": {
82
+ "dex-android-unpack": {
83
+ "command": "node",
84
+ "args": ["E:/DexAndroid/dist/index.js"],
85
+ "env": {
86
+ "ADB_PATH": "E:/Android/Sdk/platform-tools/adb.exe",
87
+ "DEX_OUT_DIR": "E:/DexAndroid/unpack-output"
88
+ }
89
+ }
90
+ }
91
+ }
92
+ ```
93
+
94
+ أعد تشغيل Cursor / أعد تحميل MCP.
95
+
96
+ ---
97
+
98
+ ## متغيرات البيئة
99
+
100
+ | المتغير | المعنى | الافتراضي |
101
+ | --- | --- | --- |
102
+ | `ADB_PATH` | adb executable | `adb` |
103
+ | `DEX_OUT_DIR` | Default output dir | `<cwd>/unpack-output` |
104
+ | `BAKSMALI_JAR` | baksmali jar | auto-discover under `tools/` |
105
+
106
+ ---
107
+
108
+ ## مسارات العمل النموذجية
109
+
110
+ ### 1. فك ثابت (الأسرع)
111
+
112
+ 1. `list_devices` or prepare local `apkPath`.
113
+ 2. `detect_packer`.
114
+ 3. `static_unpack` → `classes*.dex`.
115
+ 4. `dex_to_smali` → smali folder.
116
+ 5. `smali_search` / `smali_read_class`.
117
+
118
+ **Note:** Protected apps often yield only the shell via static unpack—use BlackDex / Frida for business code.
119
+
120
+ ### 2. بدون Root (BlackDex)
121
+
122
+ 1. `list_devices`.
123
+ 2. `blackdex_prepare` with `blackdexApkPath`.
124
+ 3. Unpack the target app in BlackDex UI.
125
+ 4. `blackdex_pull` with `targetPkg`.
126
+ 5. `dex_to_smali` then `smali_*`.
127
+
128
+ ### 3. مع Root (Frida)
129
+
130
+ 1. Rooted device (e.g. Magisk), `adb` ready.
131
+ 2. `frida_prepare` to push/start `tools/frida-server`.
132
+ 3. Matching `frida` / `frida-dexdump` locally (prefer 16.x).
133
+ 4. `frida_unpack` with `pkg`, prefer `spawn: true`, `deepSearch: true`.
134
+ 5. `dex_to_smali` on output, then analyze.
135
+
136
+ If Frida 17 attach fails, align tools to 16.x; some devices need temporary `setenforce 0`.
137
+
138
+ ### 4. أمثلة smali
139
+
140
+ ```text
141
+ smali_list_classes smaliDir=.../smali keyword=login
142
+ smali_search smaliDir=.../smali pattern=https?://|/api/|publicClient/
143
+ smali_read_class smaliDir=.../smali className=com.example.api.ApiService
144
+ ```
145
+
146
+ ---
147
+
148
+ ## هيكل المشروع
149
+
150
+ ```text
151
+ DexAndroid/
152
+ ├── src/ # MCP server (TypeScript)
153
+ │ ├── index.ts
154
+ │ ├── adb.ts
155
+ │ ├── detect.ts
156
+ │ ├── smali.ts
157
+ │ └── unpack/
158
+ ├── dist/
159
+ ├── examples/ # Damai / Huaxi sample smali.zip + docs
160
+ ├── tools/ # baksmali / frida-server / BlackDex (local)
161
+ ├── unpack-output/ # local dumps (gitignored)
162
+ ├── package.json
163
+ └── README.md
164
+ ```
165
+
166
+ ---
167
+
168
+ ## أمثلة فك التجميع
169
+
170
+ انظر [`examples/`](./examples/) (smali كـ zip):
171
+
172
+ | مثال | المسار | المحتوى |
173
+ | --- | --- | --- |
174
+ | Damai | [`examples/damai/`](./examples/damai/) | Frida smali.zip + API docs |
175
+ | Huaxi Maternity | [`examples/huaxi/`](./examples/huaxi/) | Static smali.zip (`info.cd120.two`) |
176
+
177
+ بعد الفك استخدم `smali_*`.
178
+
179
+ ---
180
+
181
+ ## مرجع سريع لأدوات MCP
182
+
183
+ | Tool | Params |
184
+ | --- | --- |
185
+ | `detect_packer` | `apkPath` or `pkg`, optional `serial` |
186
+ | `pull_apk` | `pkg`, optional `outDir` / `serial` |
187
+ | `static_unpack` | `apkPath` or `pkg`, optional `outDir` |
188
+ | `blackdex_prepare` | `blackdexApkPath`, optional `serial` |
189
+ | `blackdex_pull` | `targetPkg`, optional `outDir` / `serial` |
190
+ | `frida_prepare` | optional `serial` / `serverLocalPath` |
191
+ | `frida_unpack` | `pkg`, optional `spawn` / `deepSearch` / `outDir` |
192
+ | `dex_to_smali` | `dexInput`, optional `outDir` |
193
+ | `smali_list_classes` | `smaliDir`, optional `keyword` |
194
+ | `smali_read_class` | `smaliDir`, `className` |
195
+ | `smali_search` | `smaliDir`, `pattern`, optional `flags` / `maxResults` |
196
+
197
+ ---
198
+
199
+ ## الأسئلة الشائعة
200
+
201
+ **Q: Empty `list_devices`?**
202
+ Check USB debugging, `adb devices`, pass `serial` if multiple.
203
+
204
+ **Q: No business classes after static unpack?**
205
+ Likely packed—use BlackDex or Frida.
206
+
207
+ **Q: `dex_to_smali` failed?**
208
+ Install Java; put baksmali jar in `tools/` or set `BAKSMALI_JAR`.
209
+
210
+ **Q: Frida jailed / version mismatch?**
211
+ Keep `frida-server` and host `frida` major versions aligned; try 16.x.
212
+
213
+ **Q: Where is output?**
214
+ Default `unpack-output/` (or `DEX_OUT_DIR`). **Do not commit dumps.**
215
+
216
+ ---
217
+
218
+ ## إخلاء المسؤولية القانوني
219
+
220
+ هذا المشروع **للتعلّم والتعليم والبحث الأمني المصرّح به فقط**. يُحظر استخدامه في أي جريمة أو نشاط غير قانوني (وصول غير مصرّح، اختراق، قرصنة، هجمات، انتهاك الملكية الفكرية). المؤلفون غير مسؤولين عن إساءة الاستخدام. باستخدامك توافق على هذه الشروط.
221
+
222
+ > ⚠️ **للتعلّم والتعليم فقط.** يُحظر الاستخدام في أي نشاط غير قانوني أو اختراق غير مصرّح أو انتهاك حقوق أو تجاوز حماية الغير. التزم بالقوانين المحلية وشروط التطبيق. المسؤولية عن إساءة الاستخدام على المستخدم.
223
+
224
+ ---
225
+
226
+ ## License
227
+
228
+ MIT — see [`LICENSE`](./LICENSE).
package/README.de.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** · [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
+ > ⚠️ **Nur für Lern- und Lehrzwecke.** Nicht für illegale Aktivitäten, unautorisiertes Cracken, Urheberrechtsverletzung oder das Umgehen fremder Schutzmaßnahmen verwenden. Beachten Sie lokale Gesetze und die Nutzungsbedingungen der App. Missbrauch liegt in Ihrer Verantwortung.
6
+
7
+ Android-Unpacking + Smali-Analyse **MCP Server**. Über Cursor / Claude: Geräte, Packer-Erkennung, statisches / BlackDex / Frida-Unpacking, dex→smali, API-String-Suche.
8
+
9
+ Repo: [https://github.com/TimeCyber/DexAndroid](https://github.com/TimeCyber/DexAndroid)
10
+
11
+ ---
12
+
13
+ ## Funktionen
14
+
15
+ | Fähigkeit | MCP-Tool | Hinweise |
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
+ ### Unpack-Methoden
28
+
29
+ | Methode | Root? | Einsatz |
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
+ ## Voraussetzungen
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 & 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
+ MCP starten (stdio):
59
+
60
+ ```bash
61
+ npm start
62
+ # node dist/index.js
63
+ ```
64
+
65
+ Entwicklungsmodus:
66
+
67
+ ```bash
68
+ npm run dev
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Cursor-MCP einrichten
74
+
75
+ In `.cursor/mcp.json` eintragen (**Pfade anpassen**):
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 neu starten / MCP neu laden.
93
+
94
+ ---
95
+
96
+ ## Umgebungsvariablen
97
+
98
+ | Variable | Bedeutung | Standard |
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
+ ## Typische Abläufe
107
+
108
+ ### 1. Statisches Unpack (schnellste)
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. Ohne 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. Mit 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-Beispiele
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
+ ## Decompile-Beispiele
167
+
168
+ Siehe [`examples/`](./examples/) (Smali als Zip):
169
+
170
+ | Beispiel | Pfad | Inhalt |
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
+ Nach dem Entpacken `smali_*` nutzen.
176
+
177
+ ---
178
+
179
+ ## MCP-Kurzreferenz
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
+ ## Rechtlicher Hinweis
217
+
218
+ Dieses Projekt dient **ausschließlich dem Lernen, der Lehre und autorisierter Sicherheitsforschung**. Die Nutzung für Straftaten oder illegale Handlungen (unautorisierter Zugriff, Cracking, Piraterie, Angriffe, IP-Verletzung) ist streng untersagt. Autoren und Mitwirkende haften nicht für Missbrauch. Nutzung gilt als Zustimmung.
219
+
220
+ > ⚠️ **Nur für Lern- und Lehrzwecke.** Nicht für illegale Aktivitäten, unautorisiertes Cracken, Urheberrechtsverletzung oder das Umgehen fremder Schutzmaßnahmen verwenden. Beachten Sie lokale Gesetze und die Nutzungsbedingungen der App. Missbrauch liegt in Ihrer Verantwortung.
221
+
222
+ ---
223
+
224
+ ## License
225
+
226
+ MIT — see [`LICENSE`](./LICENSE).
package/README.es.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** · [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](./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
+ > ⚠️ **Solo para aprendizaje y enseñanza.** No lo use para actividades ilegales, cracking no autorizado, infracción de derechos ni elusión de protecciones de terceros. Cumpla las leyes locales y los términos de la app. Usted es responsable del mal uso.
6
+
7
+ **MCP Server** de desempaquetado Android + análisis smali. Desde Cursor / Claude: dispositivos, detección de protectores, unpack estático / BlackDex / Frida, dex→smali y búsqueda de APIs.
8
+
9
+ Repo: [https://github.com/TimeCyber/DexAndroid](https://github.com/TimeCyber/DexAndroid)
10
+
11
+ ---
12
+
13
+ ## Funciones
14
+
15
+ | Capacidad | Herramienta MCP | Notas |
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étodos de unpack
28
+
29
+ | Método | ¿Root? | Cuándo |
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
+ ## Requisitos
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
+ ## Instalación y compilación
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
+ Iniciar MCP (stdio):
59
+
60
+ ```bash
61
+ npm start
62
+ # node dist/index.js
63
+ ```
64
+
65
+ Modo desarrollo:
66
+
67
+ ```bash
68
+ npm run dev
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Integración Cursor (MCP)
74
+
75
+ Añada a `.cursor/mcp.json` (**ajuste las rutas**):
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
+ Reinicie Cursor / recargue MCP.
93
+
94
+ ---
95
+
96
+ ## Variables de entorno
97
+
98
+ | Variable | Significado | Por defecto |
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
+ ## Flujos típicos
107
+
108
+ ### 1. Unpack estático (más rápido)
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. Sin 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. Con 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. Ejemplos 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
+ ## Estructura
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
+ ## Ejemplos de decompilación
167
+
168
+ Vea [`examples/`](./examples/) (smali en zip):
169
+
170
+ | Ejemplo | Ruta | Contenido |
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
+ Tras descomprimir, use `smali_*`.
176
+
177
+ ---
178
+
179
+ ## Referencia rápida 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
+ ## Preguntas frecuentes
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
+ ## Aviso legal
217
+
218
+ Este proyecto es **solo para aprendizaje, enseñanza e investigación de seguridad autorizada**. Queda prohibido usarlo para delitos o ilegalidades (acceso no autorizado, cracking, piratería, ataques o infracción de PI). Autores y contribuidores no responden por abusos. Al usarlo acepta estos términos.
219
+
220
+ > ⚠️ **Solo para aprendizaje y enseñanza.** No lo use para actividades ilegales, cracking no autorizado, infracción de derechos ni elusión de protecciones de terceros. Cumpla las leyes locales y los términos de la app. Usted es responsable del mal uso.
221
+
222
+ ---
223
+
224
+ ## License
225
+
226
+ MIT — see [`LICENSE`](./LICENSE).