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.ru.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.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
+ > ⚠️ **Только для обучения и преподавания.** Запрещено использовать для преступлений, несанкционированного взлома, нарушения авторских прав или обхода чужих защит. Соблюдайте законы и условия приложения. Ответственность за злоупотребления — на пользователе.
6
+
7
+ **MCP Server** для распаковки Android и анализа smali. В 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
+ Проект **только для обучения, преподавания и уполномоченных исследований безопасности**. Запрещено использовать для преступлений и незаконных действий (несанкционированный доступ, взлом, пиратство, атаки, нарушение ИП). Авторы не несут ответственности за злоупотребления. Использование означает согласие.
219
+
220
+ > ⚠️ **Только для обучения и преподавания.** Запрещено использовать для преступлений, несанкционированного взлома, нарушения авторских прав или обхода чужих защит. Соблюдайте законы и условия приложения. Ответственность за злоупотребления — на пользователе.
221
+
222
+ ---
223
+
224
+ ## License
225
+
226
+ MIT — see [`LICENSE`](./LICENSE).
package/README.th.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](./README.id.md) · [Tiếng Việt](./README.vi.md) · **ไทย** · [Italiano](./README.it.md) · [Türkçe](./README.tr.md)
4
+
5
+ > ⚠️ **ใช้เพื่อการเรียนรู้และการสอนเท่านั้น** ห้ามใช้เพื่อการกระทำผิดกฎหมาย การแคร็กโดยไม่ได้รับอนุญาต การละเมิดลิขสิทธิ์ หรือการเลี่ยงการป้องกันของผู้อื่น ต้องปฏิบัติตามกฎหมายท้องถิ่นและข้อกำหนดของแอป ผู้ใช้รับผิดชอบต่อการใช้ในทางที่ผิด
6
+
7
+ **MCP Server** สำหรับ unpack Android + วิเคราะห์ smali จาก Cursor / Claude: จัดการอุปกรณ์ ตรวจจับ packer unpack แบบ 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
+ ### วิธี unpack
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
+ ## ติดตั้งและ 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 (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. Static unpack (เร็วสุด)
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
+ ## ตัวอย่าง decompile
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
+ ## คำถามที่พบบ่อย
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
+ โปรเจกต์นี้ **เพื่อการเรียนรู้ การสอน และการวิจัยความปลอดภัยที่ได้รับอนุญาตเท่านั้น** ห้ามใช้เพื่ออาชญากรรมหรือกิจกรรมผิดกฎหมาย (เข้าถึงโดยไม่ได้รับอนุญาต แคร็ก ละเมิดลิขสิทธิ์ โจมตีระบบ หรือละเมิดทรัพย์สินทางปัญญา) ผู้เขียนไม่รับผิดต่อการใช้ในทางที่ผิด การใช้งานถือว่ายอมรับเงื่อนไขนี้
219
+
220
+ > ⚠️ **ใช้เพื่อการเรียนรู้และการสอนเท่านั้น** ห้ามใช้เพื่อการกระทำผิดกฎหมาย การแคร็กโดยไม่ได้รับอนุญาต การละเมิดลิขสิทธิ์ หรือการเลี่ยงการป้องกันของผู้อื่น ต้องปฏิบัติตามกฎหมายท้องถิ่นและข้อกำหนดของแอป ผู้ใช้รับผิดชอบต่อการใช้ในทางที่ผิด
221
+
222
+ ---
223
+
224
+ ## License
225
+
226
+ MIT — see [`LICENSE`](./LICENSE).
package/README.tr.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](./README.id.md) · [Tiếng Việt](./README.vi.md) · [ไทย](./README.th.md) · [Italiano](./README.it.md) · **Türkçe**
4
+
5
+ > ⚠️ **Yalnızca öğrenme ve öğretim amaçlıdır.** Yasadışı faaliyet, yetkisiz crack, telif ihlali veya üçüncü taraf korumalarını aşmak için kullanmayın. Yerel yasalara ve uygulamanın şartlarına uyun. Kötüye kullanımdan kullanıcı sorumludur.
6
+
7
+ Android unpack + smali analiz **MCP Server**. Cursor / Claude ile cihaz yönetimi, packer tespiti, statik / BlackDex / Frida unpack, dex→smali ve API dizesi arama.
8
+
9
+ Repo: [https://github.com/TimeCyber/DexAndroid](https://github.com/TimeCyber/DexAndroid)
10
+
11
+ ---
12
+
13
+ ## Özellikler
14
+
15
+ | Yetenek | MCP aracı | Notlar |
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 yöntemleri
28
+
29
+ | Yöntem | Root? | Ne zaman |
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
+ ## Gereksinimler
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
+ ## Kurulum ve derleme
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 başlat (stdio):
59
+
60
+ ```bash
61
+ npm start
62
+ # node dist/index.js
63
+ ```
64
+
65
+ Geliştirme modu:
66
+
67
+ ```bash
68
+ npm run dev
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Cursor MCP kurulumu
74
+
75
+ `.cursor/mcp.json` dosyasına ekleyin (**yolları değiştirin**):
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’ı yeniden başlatın / MCP’yi yenileyin.
93
+
94
+ ---
95
+
96
+ ## Ortam değişkenleri
97
+
98
+ | Değişken | Anlam | Varsayılan |
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
+ ## Tipik akışlar
107
+
108
+ ### 1. Statik unpack (en hızlı)
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. Rootsuz (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 ile (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 örnekleri
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
+ ## Yapı
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 örnekleri
167
+
168
+ [`examples/`](./examples/) klasörüne bakın (smali zip):
169
+
170
+ | Örnek | Yol | İçerik |
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
+ Açtıktan sonra `smali_*` çalıştırın.
176
+
177
+ ---
178
+
179
+ ## MCP araç özeti
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
+ ## SSS
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
+ ## Yasal uyarı
217
+
218
+ Bu proje **yalnızca öğrenme, öğretim ve yetkili güvenlik araştırması** içindir. Suç veya yasadışı kullanım (yetkisiz erişim, crack, korsanlık, saldırı, fikri mülkiyet ihlali) kesinlikle yasaktır. Yazarlar kötüye kullanımdan sorumlu değildir. Kullanım bu şartları kabul anlamına gelir.
219
+
220
+ > ⚠️ **Yalnızca öğrenme ve öğretim amaçlıdır.** Yasadışı faaliyet, yetkisiz crack, telif ihlali veya üçüncü taraf korumalarını aşmak için kullanmayın. Yerel yasalara ve uygulamanın şartlarına uyun. Kötüye kullanımdan kullanıcı sorumludur.
221
+
222
+ ---
223
+
224
+ ## License
225
+
226
+ MIT — see [`LICENSE`](./LICENSE).