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 +21 -0
- package/README.ar.md +228 -0
- package/README.de.md +226 -0
- package/README.es.md +226 -0
- package/README.fr.md +226 -0
- package/README.hi.md +226 -0
- package/README.id.md +226 -0
- package/README.it.md +226 -0
- package/README.ja.md +226 -0
- package/README.ko.md +226 -0
- package/README.md +258 -3
- package/README.pt-BR.md +226 -0
- package/README.ru.md +226 -0
- package/README.th.md +226 -0
- package/README.tr.md +226 -0
- package/README.vi.md +226 -0
- package/README.zh-CN.md +252 -0
- package/README.zh-TW.md +226 -0
- package/dist/adb.js +89 -0
- package/dist/detect.js +42 -0
- package/dist/entry.js +219 -0
- package/dist/index.js +419 -0
- package/dist/repack.js +189 -0
- package/dist/smali.js +128 -0
- package/dist/smali_patch.js +237 -0
- package/dist/unpack/blackdex.js +119 -0
- package/dist/unpack/frida.js +66 -0
- package/dist/unpack/static.js +50 -0
- package/dist/util.js +61 -0
- package/package.json +56 -6
package/README.it.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** · [Türkçe](./README.tr.md)
|
|
4
|
+
|
|
5
|
+
> ⚠️ **Solo per apprendimento e didattica.** Non usare per attività illegali, cracking non autorizzato, violazione di copyright o elusione di protezioni di terzi. Rispettare le leggi locali e i termini dell’app. L’abuso è responsabilità dell’utente.
|
|
6
|
+
|
|
7
|
+
**MCP Server** per unpacking Android + analisi smali. Da Cursor / Claude: dispositivi, rilevamento packer, unpack statico / BlackDex / Frida, dex→smali, ricerca stringhe API.
|
|
8
|
+
|
|
9
|
+
Repo: [https://github.com/TimeCyber/DexAndroid](https://github.com/TimeCyber/DexAndroid)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Funzionalità
|
|
14
|
+
|
|
15
|
+
| Capacità | Tool MCP | Note |
|
|
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
|
+
### Metodi di unpack
|
|
28
|
+
|
|
29
|
+
| Metodo | Root? | Quando |
|
|
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
|
+
## Requisiti
|
|
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
|
+
## Installazione e 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
|
+
Avvia MCP (stdio):
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm start
|
|
62
|
+
# node dist/index.js
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Modalità dev:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm run dev
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Setup Cursor (MCP)
|
|
74
|
+
|
|
75
|
+
Aggiungi a `.cursor/mcp.json` (**modifica i 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
|
+
Riavvia Cursor / ricarica MCP.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Variabili d’ambiente
|
|
97
|
+
|
|
98
|
+
| Variabile | Significato | 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
|
+
## Flussi tipici
|
|
107
|
+
|
|
108
|
+
### 1. Unpack statico (più veloce)
|
|
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. Senza 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. Esempi 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
|
+
## Struttura
|
|
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
|
+
## Esempi di decompilazione
|
|
167
|
+
|
|
168
|
+
Vedi [`examples/`](./examples/) (smali in zip):
|
|
169
|
+
|
|
170
|
+
| Esempio | Percorso | Contenuto |
|
|
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
|
+
Dopo l’estrazione usa `smali_*`.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Cheatsheet 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
|
+
## Avviso legale
|
|
217
|
+
|
|
218
|
+
Questo progetto è **solo per apprendimento, didattica e ricerca di sicurezza autorizzata**. È vietato usarlo per reati o illegalità (accesso non autorizzato, cracking, pirateria, attacchi, violazione IP). Autori e contributor non rispondono degli abusi. L’uso implica accettazione.
|
|
219
|
+
|
|
220
|
+
> ⚠️ **Solo per apprendimento e didattica.** Non usare per attività illegali, cracking non autorizzato, violazione di copyright o elusione di protezioni di terzi. Rispettare le leggi locali e i termini dell’app. L’abuso è responsabilità dell’utente.
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## License
|
|
225
|
+
|
|
226
|
+
MIT — see [`LICENSE`](./LICENSE).
|
package/README.ja.md
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# DexAndroid
|
|
2
|
+
|
|
3
|
+
[English](./README.md) · [简体中文](./README.zh-CN.md) · [繁體中文](./README.zh-TW.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](./README.tr.md)
|
|
4
|
+
|
|
5
|
+
> ⚠️ **学習・教育目的のみ。** 違法行為、無断クラック、権利侵害、第三者保護の回避には使用しないでください。各国の法令と対象アプリの利用規約を遵守してください。悪用の責任は利用者にあります。
|
|
6
|
+
|
|
7
|
+
Android アンパック + smali 解析用 **MCP Server**。Cursor / Claude などから、端末管理・保護検知・静的/非 Root/Root アンパック・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**(手順は Windows 例)
|
|
40
|
+
- **Node.js** ≥ 18
|
|
41
|
+
- **ADB**(PATH または `ADB_PATH`)
|
|
42
|
+
- **Java 8+**(baksmali)
|
|
43
|
+
- 任意:[BlackDex](https://github.com/CodingGay/BlackDex/releases)、Root + `frida-server`、`pip install frida-tools frida-dexdump`
|
|
44
|
+
|
|
45
|
+
`tools/` に baksmali / frida-server / BlackDex を配置(大きなバイナリは gitignore)。
|
|
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` またはローカル `apkPath`。
|
|
111
|
+
2. `detect_packer`。
|
|
112
|
+
3. `static_unpack` → `classes*.dex`。
|
|
113
|
+
4. `dex_to_smali`。
|
|
114
|
+
5. `smali_search` / `smali_read_class`。
|
|
115
|
+
|
|
116
|
+
**注意:** 保護アプリの静的 dex はシェルのみのことが多いです。業務コードは BlackDex / Frida を。
|
|
117
|
+
|
|
118
|
+
### 2. 非 Root(BlackDex)
|
|
119
|
+
|
|
120
|
+
1. `list_devices`。
|
|
121
|
+
2. `blackdex_prepare`(`blackdexApkPath`)。
|
|
122
|
+
3. 端末の BlackDex で対象アプリをダンプ。
|
|
123
|
+
4. `blackdex_pull`(`targetPkg`)。
|
|
124
|
+
5. `dex_to_smali` → `smali_*`。
|
|
125
|
+
|
|
126
|
+
### 3. Root(Frida)
|
|
127
|
+
|
|
128
|
+
1. Root 済み、`adb` 利用可。
|
|
129
|
+
2. `frida_prepare` で `frida-server` を起動。
|
|
130
|
+
3. ホスト側 `frida` / `frida-dexdump` をバージョン合わせ(推奨 16.x)。
|
|
131
|
+
4. `frida_unpack`(`spawn: true`、`deepSearch: true` 推奨)。
|
|
132
|
+
5. `dex_to_smali` 後に解析。
|
|
133
|
+
|
|
134
|
+
Frida 17 で失敗する場合は 16.x に揃えてください。必要なら一時的に `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 文書 |
|
|
173
|
+
| Huaxi | [`examples/huaxi/`](./examples/huaxi/) | 静的 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: `list_devices` が空?**
|
|
200
|
+
USB デバッグと `adb devices` を確認。複数端末は `serial`。
|
|
201
|
+
|
|
202
|
+
**Q: 静的後に業務クラスがない?**
|
|
203
|
+
保護の可能性大 → BlackDex / Frida。
|
|
204
|
+
|
|
205
|
+
**Q: `dex_to_smali` 失敗?**
|
|
206
|
+
Java と baksmali jar(または `BAKSMALI_JAR`)を確認。
|
|
207
|
+
|
|
208
|
+
**Q: Frida jailed / 版不一致?**
|
|
209
|
+
`frida-server` とホスト `frida` のメジャー版を揃える。
|
|
210
|
+
|
|
211
|
+
**Q: 出力先は?**
|
|
212
|
+
既定は `unpack-output/`。**Git にコミットしないでください。**
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 法令遵守と免責
|
|
217
|
+
|
|
218
|
+
本プロジェクトは**学習・教育および許可されたセキュリティ研究のみ**を目的とします。不正アクセス、クラック、著作権侵害など違法行為への使用を固く禁じます。悪用について作者・貢献者は責任を負いません。利用により本条件に同意したものとみなします。
|
|
219
|
+
|
|
220
|
+
> ⚠️ **学習・教育目的のみ。** 違法行為、無断クラック、権利侵害、第三者保護の回避には使用しないでください。各国の法令と対象アプリの利用規約を遵守してください。悪用の責任は利用者にあります。
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## License
|
|
225
|
+
|
|
226
|
+
MIT — [`LICENSE`](./LICENSE) を参照。
|
package/README.ko.md
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# DexAndroid
|
|
2
|
+
|
|
3
|
+
[English](./README.md) · [简体中文](./README.zh-CN.md) · [繁體中文](./README.zh-TW.md) · [日本語](./README.ja.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](./README.tr.md)
|
|
4
|
+
|
|
5
|
+
> ⚠️ **학습 및 교육 목적으로만 사용하세요.** 불법 행위, 무단 크래킹, 저작권 침해, 제3자 보호 우회에 사용하지 마십시오. 현지 법령과 대상 앱 약관을 준수해야 하며, 오남용 책임은 사용자에게 있습니다.
|
|
6
|
+
|
|
7
|
+
안드로이드 언패킹 + smali 분석 **MCP Server**. Cursor / Claude 등에서 기기 관리, 보호(패커) 탐지, 정적/비루팅/루팅 언패킹, 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** (문서는 Windows 기준)
|
|
40
|
+
- **Node.js** ≥ 18
|
|
41
|
+
- **ADB** (PATH 또는 `ADB_PATH`)
|
|
42
|
+
- **Java 8+** (baksmali)
|
|
43
|
+
- 선택: [BlackDex](https://github.com/CodingGay/BlackDex/releases), 루팅 + `frida-server`, `pip install frida-tools frida-dexdump`
|
|
44
|
+
|
|
45
|
+
`tools/`에 baksmali / frida-server / BlackDex 배치 (대용량은 gitignore).
|
|
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` 또는 로컬 `apkPath`.
|
|
111
|
+
2. `detect_packer`.
|
|
112
|
+
3. `static_unpack` → `classes*.dex`.
|
|
113
|
+
4. `dex_to_smali`.
|
|
114
|
+
5. `smali_search` / `smali_read_class`.
|
|
115
|
+
|
|
116
|
+
**참고:** 보호 앱의 정적 dex는 쉘만일 수 있습니다. 비즈니스 코드는 BlackDex / Frida.
|
|
117
|
+
|
|
118
|
+
### 2. 비루팅 (BlackDex)
|
|
119
|
+
|
|
120
|
+
1. `list_devices`.
|
|
121
|
+
2. `blackdex_prepare` (`blackdexApkPath`).
|
|
122
|
+
3. BlackDex UI에서 대상 앱 덤프.
|
|
123
|
+
4. `blackdex_pull` (`targetPkg`).
|
|
124
|
+
5. `dex_to_smali` 후 `smali_*`.
|
|
125
|
+
|
|
126
|
+
### 3. 루팅 (Frida)
|
|
127
|
+
|
|
128
|
+
1. 루팅된 기기, `adb` 사용 가능.
|
|
129
|
+
2. `frida_prepare`로 `frida-server` 실행.
|
|
130
|
+
3. 호스트 `frida` / `frida-dexdump` 버전 맞춤 (권장 16.x).
|
|
131
|
+
4. `frida_unpack` (`spawn: true`, `deepSearch: true` 권장).
|
|
132
|
+
5. `dex_to_smali` 후 분석.
|
|
133
|
+
|
|
134
|
+
Frida 17 실패 시 16.x로 맞추세요. 일부 기기는 임시 `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: `list_devices`가 비어 있음?**
|
|
200
|
+
USB 디버깅/`adb devices` 확인, 다중 기기는 `serial`.
|
|
201
|
+
|
|
202
|
+
**Q: 정적 후 비즈니스 클래스 없음?**
|
|
203
|
+
패커 가능성 → BlackDex/Frida.
|
|
204
|
+
|
|
205
|
+
**Q: `dex_to_smali` 실패?**
|
|
206
|
+
Java와 baksmali jar/`BAKSMALI_JAR` 확인.
|
|
207
|
+
|
|
208
|
+
**Q: Frida jailed / 버전 불일치?**
|
|
209
|
+
`frida-server`와 호스트 `frida` 메이저 버전 일치.
|
|
210
|
+
|
|
211
|
+
**Q: 출력 위치?**
|
|
212
|
+
기본 `unpack-output/`. **Git에 커밋하지 마세요.**
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 법적 고지 및 면책
|
|
217
|
+
|
|
218
|
+
본 프로젝트는 **학습·교육 및 승인된 보안 연구 전용**입니다. 무단 접근, 크래킹, 불법 복제, 시스템 공격, 지식재산권 침해 등 일체의 불법 행위에 사용하는 것을 엄격히 금지합니다. 오남용에 대해 저자와 기여자는 책임지지 않습니다. 사용 시 본 조건에 동의한 것으로 간주합니다.
|
|
219
|
+
|
|
220
|
+
> ⚠️ **학습 및 교육 목적으로만 사용하세요.** 불법 행위, 무단 크래킹, 저작권 침해, 제3자 보호 우회에 사용하지 마십시오. 현지 법령과 대상 앱 약관을 준수해야 하며, 오남용 책임은 사용자에게 있습니다.
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## License
|
|
225
|
+
|
|
226
|
+
MIT — [`LICENSE`](./LICENSE) 참고.
|