@leejungkiin/awkit 1.1.0 → 1.1.2
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.md +3 -3
- package/VERSION +1 -1
- package/bin/awf.js +1 -1
- package/bin/awk.js +237 -26
- package/core/AGENTS.md +8 -9
- package/core/GEMINI.md +74 -199
- package/package.json +3 -2
- package/skill-packs/neural-memory/skills/nm-memory-sync/SKILL.md +2 -2
- package/skills/CATALOG.md +3 -2
- package/skills/README.md +109 -0
- package/skills/android-re-analyzer/SKILL.md +238 -0
- package/skills/android-re-analyzer/references/api-extraction-patterns.md +119 -0
- package/skills/android-re-analyzer/references/call-flow-analysis.md +176 -0
- package/skills/android-re-analyzer/references/fernflower-usage.md +115 -0
- package/skills/android-re-analyzer/references/jadx-usage.md +116 -0
- package/skills/android-re-analyzer/references/setup-guide.md +221 -0
- package/skills/android-re-analyzer/scripts/check-deps.sh +129 -0
- package/skills/android-re-analyzer/scripts/decompile.sh +375 -0
- package/skills/android-re-analyzer/scripts/find-api-calls.sh +118 -0
- package/skills/android-re-analyzer/scripts/install-dep.sh +448 -0
- package/skills/awf-session-restore/SKILL.md +108 -184
- package/skills/beads-manager/SKILL.md +2 -2
- package/skills/brainstorm-agent/SKILL.md +47 -2
- package/skills/gemini-conductor/SKILL.md +234 -0
- package/skills/memory-sync/SKILL.md +29 -1
- package/skills/nm-memory-sync/SKILL.md +2 -2
- package/skills/orchestrator/SKILL.md +29 -155
- package/skills/skills/nm-memory-sync/SKILL.md +2 -2
- package/skills/smali-to-kotlin/SKILL.md +1 -1
- package/skills/smali-to-swift/SKILL.md +1 -1
- package/skills/swiftui-pro/SKILL.md +108 -0
- package/skills/swiftui-pro/agents/openai.yaml +10 -0
- package/skills/swiftui-pro/assets/swiftui-pro-icon.png +0 -0
- package/skills/swiftui-pro/assets/swiftui-pro-icon.svg +29 -0
- package/skills/swiftui-pro/references/accessibility.md +13 -0
- package/skills/swiftui-pro/references/api.md +39 -0
- package/skills/swiftui-pro/references/data.md +43 -0
- package/skills/swiftui-pro/references/design.md +31 -0
- package/skills/swiftui-pro/references/hygiene.md +9 -0
- package/skills/swiftui-pro/references/navigation.md +14 -0
- package/skills/swiftui-pro/references/performance.md +46 -0
- package/skills/swiftui-pro/references/swift.md +56 -0
- package/skills/swiftui-pro/references/views.md +35 -0
- package/skills/symphony-enforcer/SKILL.md +362 -0
- package/skills/symphony-orchestrator/SKILL.md +301 -0
- package/skills/telegram-notify/SKILL.md +57 -0
- package/symphony/LICENSE +21 -0
- package/symphony/README.md +178 -0
- package/symphony/app/api/agents/route.js +152 -0
- package/symphony/app/api/events/route.js +22 -0
- package/symphony/app/api/knowledge/route.js +253 -0
- package/symphony/app/api/locks/route.js +29 -0
- package/symphony/app/api/notes/route.js +125 -0
- package/symphony/app/api/preflight/route.js +23 -0
- package/symphony/app/api/projects/route.js +116 -0
- package/symphony/app/api/roles/route.js +134 -0
- package/symphony/app/api/skills/route.js +82 -0
- package/symphony/app/api/status/route.js +18 -0
- package/symphony/app/api/tasks/route.js +157 -0
- package/symphony/app/api/workflows/route.js +61 -0
- package/symphony/app/api/workspaces/route.js +15 -0
- package/symphony/app/globals.css +2605 -0
- package/symphony/app/layout.js +20 -0
- package/symphony/app/page.js +2122 -0
- package/symphony/cli/index.js +1060 -0
- package/symphony/core/agent-manager.js +357 -0
- package/symphony/core/context-bus.js +100 -0
- package/symphony/core/db.js +223 -0
- package/symphony/core/file-lock-manager.js +154 -0
- package/symphony/core/merge-pipeline.js +234 -0
- package/symphony/core/orchestrator.js +236 -0
- package/symphony/core/task-manager.js +335 -0
- package/symphony/core/workspace-manager.js +168 -0
- package/symphony/jsconfig.json +7 -0
- package/symphony/lib/core.mjs +1034 -0
- package/symphony/mcp/index.js +29 -0
- package/symphony/mcp/server.js +110 -0
- package/symphony/mcp/tools/context.js +80 -0
- package/symphony/mcp/tools/locks.js +99 -0
- package/symphony/mcp/tools/status.js +82 -0
- package/symphony/mcp/tools/tasks.js +216 -0
- package/symphony/mcp/tools/workspace.js +143 -0
- package/symphony/next.config.mjs +7 -0
- package/symphony/package.json +53 -0
- package/symphony/scripts/postinstall.js +49 -0
- package/symphony/symphony.config.js +41 -0
- package/templates/conductor-tracks.md +38 -0
- package/templates/specs/PROJECT.md +50 -0
- package/templates/specs/ROADMAP.md +79 -0
- package/templates/specs/TECH-SPEC.md +81 -0
- package/templates/specs/task-spec-template.xml +65 -0
- package/templates/workflow_dual_mode_template.md +5 -5
- package/workflows/_uncategorized/AGENTS.md +38 -0
- package/workflows/_uncategorized/decompile.md +67 -0
- package/workflows/_uncategorized/skill-health.md +7 -7
- package/workflows/ads/ads-audit.md +5 -5
- package/workflows/ads/ads-optimize.md +10 -10
- package/workflows/ads/adsExpert.md +7 -7
- package/workflows/conductor.md +97 -0
- package/workflows/context/auto-implement.md +4 -4
- package/workflows/context/codebase-sync.md +19 -8
- package/workflows/context/next.md +27 -27
- package/workflows/context/user-intent-analysis-workflow.md +4 -4
- package/workflows/expert/codeExpert.md +28 -31
- package/workflows/expert/debugExpert.md +11 -11
- package/workflows/expert/planExpert.md +21 -36
- package/workflows/git/smart-git-ops.md +49 -6
- package/workflows/lifecycle/debug.md +7 -7
- package/workflows/lifecycle/deploy.md +10 -10
- package/workflows/lifecycle/init.md +103 -91
- package/workflows/lifecycle/master-code-workflow.md +3 -3
- package/workflows/lifecycle/plan.md +19 -21
- package/workflows/quality/audit.md +1 -1
- package/workflows/quality/project-audit.md +1 -1
- package/workflows/roles/vibe-coding-master-workflow.md +2 -2
- package/workflows/smart-git-ops.md +146 -0
- package/workflows/ui/app-screen-analyzer.md +4 -4
- package/workflows/ui/create-feature.md +8 -8
- package/workflows/ui/create-spec-architect.md +11 -11
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# jadx CLI Reference
|
|
2
|
+
|
|
3
|
+
## Basic Usage
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
jadx [options] <input-file>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Input can be an `.apk`, `.jar`, `.aar`, `.dex`, or `.zip` file.
|
|
10
|
+
|
|
11
|
+
## Key Options
|
|
12
|
+
|
|
13
|
+
| Option | Description |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `-d <dir>` | Output directory for decompiled sources |
|
|
16
|
+
| `--deobf` | Enable deobfuscation — renames obfuscated classes/methods to readable names |
|
|
17
|
+
| `--show-bad-code` | Show partially decompiled code instead of error comments |
|
|
18
|
+
| `--no-res` | Skip resource decoding — faster when you only need code |
|
|
19
|
+
| `--no-src` | Skip source decompilation — only decode resources |
|
|
20
|
+
| `--export-gradle` | Generate a Gradle project structure (useful for importing into IDE) |
|
|
21
|
+
| `-e` | Same as `--export-gradle` |
|
|
22
|
+
| `--threads-count <N>` | Number of processing threads (default: CPU count) |
|
|
23
|
+
| `-Xmx<size>` | Set maximum Java heap (e.g., `-Xmx4g` for large APKs) |
|
|
24
|
+
|
|
25
|
+
## Decompiling Different File Types
|
|
26
|
+
|
|
27
|
+
### APK (Android Application Package)
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
jadx -d output-dir app.apk
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Produces:
|
|
34
|
+
- `output-dir/sources/` — Decompiled Java source files
|
|
35
|
+
- `output-dir/resources/` — Decoded resources (AndroidManifest.xml, layouts, drawables, etc.)
|
|
36
|
+
|
|
37
|
+
### JAR (Java Archive)
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
jadx -d output-dir library.jar
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Useful for analyzing third-party libraries bundled within an APK.
|
|
44
|
+
|
|
45
|
+
### AAR (Android Archive)
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
jadx -d output-dir library.aar
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
AAR files contain both compiled code and Android resources. jadx handles them directly.
|
|
52
|
+
|
|
53
|
+
## Handling Obfuscated Code
|
|
54
|
+
|
|
55
|
+
Apps built with ProGuard or R8 produce obfuscated bytecode with single-letter class and method names.
|
|
56
|
+
|
|
57
|
+
### Strategies
|
|
58
|
+
|
|
59
|
+
1. **Use `--deobf`** to generate readable replacement names:
|
|
60
|
+
```bash
|
|
61
|
+
jadx --deobf -d output-dir app.apk
|
|
62
|
+
```
|
|
63
|
+
jadx creates a mapping file at `output-dir/deobf-mapping.txt` that maps original obfuscated names to generated names.
|
|
64
|
+
|
|
65
|
+
2. **Use the ProGuard mapping file** if available (sometimes shipped in the APK under `assets/` or obtainable from build artifacts):
|
|
66
|
+
```bash
|
|
67
|
+
jadx --deobf-map mapping.txt -d output-dir app.apk
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
3. **Focus on string constants and API calls** rather than class names when navigating obfuscated code. URL strings, annotation values, and library classes are not obfuscated.
|
|
71
|
+
|
|
72
|
+
## jadx-gui
|
|
73
|
+
|
|
74
|
+
For interactive exploration, use the GUI version:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
jadx-gui app.apk
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Features:
|
|
81
|
+
- Full-text search across all decompiled sources
|
|
82
|
+
- Click-through navigation (jump to definition)
|
|
83
|
+
- Deobfuscation with live renaming
|
|
84
|
+
- Smali view alongside Java
|
|
85
|
+
|
|
86
|
+
jadx-gui is included in the same distribution as the CLI tool.
|
|
87
|
+
|
|
88
|
+
## Common Workflows
|
|
89
|
+
|
|
90
|
+
### Code-only decompilation (fastest)
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
jadx --no-res --show-bad-code -d output app.apk
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Full decompilation with deobfuscation
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
jadx --deobf --show-bad-code -d output app.apk
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Export as Gradle project for IDE import
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
jadx -e -d output app.apk
|
|
106
|
+
# Then open output/ in Android Studio or IntelliJ
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Decompile a specific DEX from a multi-dex APK
|
|
110
|
+
|
|
111
|
+
Extract the APK (it's a ZIP), then target individual DEX files:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
unzip app.apk -d extracted/
|
|
115
|
+
jadx -d output extracted/classes2.dex
|
|
116
|
+
```
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Setup Guide: Dependencies for Android Reverse Engineering
|
|
2
|
+
|
|
3
|
+
## Java JDK 17+
|
|
4
|
+
|
|
5
|
+
jadx requires Java 17 or later.
|
|
6
|
+
|
|
7
|
+
### Ubuntu / Debian
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
sudo apt update
|
|
11
|
+
sudo apt install openjdk-17-jdk
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Fedora
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
sudo dnf install java-17-openjdk-devel
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Arch Linux
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
sudo pacman -S jdk17-openjdk
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### macOS (Homebrew)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
brew install openjdk@17
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
After installation on macOS, follow the symlink instructions printed by Homebrew, or add to your shell profile:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Verify
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
java -version
|
|
42
|
+
# Should show version 17.x or higher
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## jadx
|
|
48
|
+
|
|
49
|
+
jadx is the Java decompiler used to convert APK/JAR/AAR files to readable Java source.
|
|
50
|
+
|
|
51
|
+
### Option 1: GitHub Releases (recommended)
|
|
52
|
+
|
|
53
|
+
1. Go to <https://github.com/skylot/jadx/releases/latest>
|
|
54
|
+
2. Download the `jadx-<version>.zip` file (not the source archive)
|
|
55
|
+
3. Extract and add to PATH:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
unzip jadx-*.zip -d ~/jadx
|
|
59
|
+
export PATH="$HOME/jadx/bin:$PATH"
|
|
60
|
+
# Add the export line to your ~/.bashrc or ~/.zshrc for persistence
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Option 2: Homebrew (macOS / Linux)
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
brew install jadx
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Option 3: Build from source
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
git clone https://github.com/skylot/jadx.git
|
|
73
|
+
cd jadx
|
|
74
|
+
./gradlew dist
|
|
75
|
+
# Binaries will be in build/jadx/bin/
|
|
76
|
+
export PATH="$(pwd)/build/jadx/bin:$PATH"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Verify
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
jadx --version
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Fernflower / Vineflower (optional, recommended)
|
|
88
|
+
|
|
89
|
+
Fernflower is the JetBrains Java decompiler. It produces better output than jadx on complex Java constructs, lambdas, and generics. [Vineflower](https://github.com/Vineflower/vineflower) is the actively maintained community fork with published releases — prefer it over upstream Fernflower.
|
|
90
|
+
|
|
91
|
+
### Option 1: Vineflower from GitHub Releases (recommended)
|
|
92
|
+
|
|
93
|
+
1. Go to <https://github.com/Vineflower/vineflower/releases/latest>
|
|
94
|
+
2. Download `vineflower-<version>.jar`
|
|
95
|
+
3. Place it and set the environment variable:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
mkdir -p ~/vineflower
|
|
99
|
+
mv vineflower-*.jar ~/vineflower/vineflower.jar
|
|
100
|
+
export FERNFLOWER_JAR_PATH="$HOME/vineflower/vineflower.jar"
|
|
101
|
+
# Add the export to ~/.bashrc or ~/.zshrc for persistence
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Option 2: Build Fernflower from source
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
git clone https://github.com/JetBrains/fernflower.git
|
|
108
|
+
cd fernflower
|
|
109
|
+
./gradlew jar
|
|
110
|
+
# Produces: build/libs/fernflower.jar
|
|
111
|
+
export FERNFLOWER_JAR_PATH="$(pwd)/build/libs/fernflower.jar"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Option 3: Homebrew (Vineflower)
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
brew install vineflower
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Verify
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
java -jar "$FERNFLOWER_JAR_PATH" --version
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
> **Note**: Fernflower only works on JVM bytecode (JAR, class files). For APK/DEX files, you also need **dex2jar** (see below) as an intermediate conversion step.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## dex2jar (optional, needed for Fernflower on APK files)
|
|
131
|
+
|
|
132
|
+
Converts Android DEX bytecode to standard Java JAR files.
|
|
133
|
+
|
|
134
|
+
### GitHub Releases
|
|
135
|
+
|
|
136
|
+
1. Go to <https://github.com/pxb1988/dex2jar/releases/latest>
|
|
137
|
+
2. Download and extract:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
unzip dex-tools-*.zip -d ~/dex2jar
|
|
141
|
+
export PATH="$HOME/dex2jar:$PATH"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Homebrew
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
brew install dex2jar
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Verify
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
d2j-dex2jar --help
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Usage
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Convert APK (or DEX) to JAR
|
|
160
|
+
d2j-dex2jar -f -o output.jar app.apk
|
|
161
|
+
|
|
162
|
+
# Then decompile with Fernflower
|
|
163
|
+
java -jar vineflower.jar output.jar decompiled/
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Optional Tools
|
|
169
|
+
|
|
170
|
+
### apktool
|
|
171
|
+
|
|
172
|
+
Useful for decoding resources (XML layouts, drawables) that jadx sometimes handles poorly.
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Ubuntu/Debian
|
|
176
|
+
sudo apt install apktool
|
|
177
|
+
|
|
178
|
+
# macOS
|
|
179
|
+
brew install apktool
|
|
180
|
+
|
|
181
|
+
# Manual: https://apktool.org/docs/install
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### adb (Android Debug Bridge)
|
|
185
|
+
|
|
186
|
+
Useful for pulling APKs directly from a connected Android device.
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
# Ubuntu/Debian
|
|
190
|
+
sudo apt install adb
|
|
191
|
+
|
|
192
|
+
# macOS
|
|
193
|
+
brew install android-platform-tools
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Pull an APK from a device:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
# List installed packages
|
|
200
|
+
adb shell pm list packages | grep <keyword>
|
|
201
|
+
|
|
202
|
+
# Get APK path
|
|
203
|
+
adb shell pm path com.example.app
|
|
204
|
+
|
|
205
|
+
# Pull the APK
|
|
206
|
+
adb pull /data/app/com.example.app-xxxx/base.apk ./app.apk
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Troubleshooting
|
|
212
|
+
|
|
213
|
+
| Problem | Solution |
|
|
214
|
+
|---|---|
|
|
215
|
+
| `jadx: command not found` | Ensure the jadx `bin/` directory is in your `$PATH` |
|
|
216
|
+
| `Error: Could not find or load main class` | Java is missing or wrong version — verify with `java -version` |
|
|
217
|
+
| jadx runs out of memory on large APKs | Increase heap: `jadx -Xmx4g -d output app.apk` or set `JAVA_OPTS="-Xmx4g"` |
|
|
218
|
+
| Decompiled code has many `// Error` comments | Try `--show-bad-code` to see partial output, or use `--deobf` for obfuscated apps |
|
|
219
|
+
| Fernflower hangs on a method | Use `-mpm=60` to set a 60-second timeout per method |
|
|
220
|
+
| Fernflower JAR not found | Set `FERNFLOWER_JAR_PATH` env variable to the full path of the JAR |
|
|
221
|
+
| dex2jar fails with `ZipException` | The APK may have a non-standard ZIP structure — try `jadx` instead |
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# check-deps.sh — Verify dependencies and report what's missing
|
|
3
|
+
# Output includes machine-readable INSTALL:<dep> lines for each missing dependency.
|
|
4
|
+
# The install-dep.sh script can install each one.
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
REQUIRED_JAVA_MAJOR=17
|
|
8
|
+
errors=0
|
|
9
|
+
missing_required=()
|
|
10
|
+
missing_optional=()
|
|
11
|
+
|
|
12
|
+
echo "=== Android Reverse Engineering: Dependency Check ==="
|
|
13
|
+
echo
|
|
14
|
+
|
|
15
|
+
# --- Java ---
|
|
16
|
+
java_ok=false
|
|
17
|
+
if command -v java &>/dev/null; then
|
|
18
|
+
java_version_output=$(java -version 2>&1 | head -1)
|
|
19
|
+
java_version=$(echo "$java_version_output" | sed -n 's/.*"\([0-9]*\)\..*/\1/p')
|
|
20
|
+
if [[ -z "$java_version" ]]; then
|
|
21
|
+
java_version=$(echo "$java_version_output" | grep -oP '\d+' | head -1)
|
|
22
|
+
fi
|
|
23
|
+
if [[ "$java_version" == "1" ]]; then
|
|
24
|
+
java_version=$(echo "$java_version_output" | sed -n 's/.*"1\.\([0-9]*\)\..*/\1/p')
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
if [[ -n "$java_version" ]] && (( java_version >= REQUIRED_JAVA_MAJOR )); then
|
|
28
|
+
echo "[OK] Java $java_version detected"
|
|
29
|
+
java_ok=true
|
|
30
|
+
else
|
|
31
|
+
echo "[WARN] Java detected but version $java_version is below $REQUIRED_JAVA_MAJOR"
|
|
32
|
+
errors=$((errors + 1))
|
|
33
|
+
missing_required+=("java")
|
|
34
|
+
fi
|
|
35
|
+
else
|
|
36
|
+
echo "[MISSING] Java is not installed or not in PATH"
|
|
37
|
+
errors=$((errors + 1))
|
|
38
|
+
missing_required+=("java")
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# --- jadx ---
|
|
42
|
+
if command -v jadx &>/dev/null; then
|
|
43
|
+
jadx_version=$(jadx --version 2>/dev/null || echo "unknown")
|
|
44
|
+
echo "[OK] jadx $jadx_version detected"
|
|
45
|
+
else
|
|
46
|
+
echo "[MISSING] jadx is not installed or not in PATH"
|
|
47
|
+
errors=$((errors + 1))
|
|
48
|
+
missing_required+=("jadx")
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# --- Fernflower / Vineflower ---
|
|
52
|
+
ff_found=false
|
|
53
|
+
if command -v vineflower &>/dev/null; then
|
|
54
|
+
echo "[OK] vineflower CLI detected"
|
|
55
|
+
ff_found=true
|
|
56
|
+
elif command -v fernflower &>/dev/null; then
|
|
57
|
+
echo "[OK] fernflower CLI detected"
|
|
58
|
+
ff_found=true
|
|
59
|
+
else
|
|
60
|
+
for candidate in \
|
|
61
|
+
"${FERNFLOWER_JAR_PATH:-}" \
|
|
62
|
+
"$HOME/.local/share/vineflower/vineflower.jar" \
|
|
63
|
+
"$HOME/fernflower/build/libs/fernflower.jar" \
|
|
64
|
+
"$HOME/vineflower/build/libs/vineflower.jar" \
|
|
65
|
+
"$HOME/fernflower/fernflower.jar" \
|
|
66
|
+
"$HOME/vineflower/vineflower.jar"; do
|
|
67
|
+
if [[ -n "$candidate" ]] && [[ -f "$candidate" ]]; then
|
|
68
|
+
echo "[OK] Fernflower/Vineflower JAR found: $candidate"
|
|
69
|
+
ff_found=true
|
|
70
|
+
break
|
|
71
|
+
fi
|
|
72
|
+
done
|
|
73
|
+
fi
|
|
74
|
+
if [[ "$ff_found" == false ]]; then
|
|
75
|
+
echo "[MISSING] Fernflower/Vineflower not found (optional — better output on complex Java code)"
|
|
76
|
+
missing_optional+=("vineflower")
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
# --- dex2jar ---
|
|
80
|
+
if command -v d2j-dex2jar &>/dev/null || command -v d2j-dex2jar.sh &>/dev/null; then
|
|
81
|
+
echo "[OK] dex2jar detected"
|
|
82
|
+
else
|
|
83
|
+
echo "[MISSING] dex2jar not found (optional — needed to use Fernflower on APK/DEX files)"
|
|
84
|
+
missing_optional+=("dex2jar")
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
# --- Optional: apktool ---
|
|
88
|
+
if command -v apktool &>/dev/null; then
|
|
89
|
+
echo "[OK] apktool detected (optional)"
|
|
90
|
+
else
|
|
91
|
+
echo "[MISSING] apktool not found (optional — useful for resource decoding)"
|
|
92
|
+
missing_optional+=("apktool")
|
|
93
|
+
fi
|
|
94
|
+
|
|
95
|
+
# --- Optional: adb ---
|
|
96
|
+
if command -v adb &>/dev/null; then
|
|
97
|
+
echo "[OK] adb detected (optional)"
|
|
98
|
+
else
|
|
99
|
+
echo "[MISSING] adb not found (optional — useful for pulling APKs from devices)"
|
|
100
|
+
missing_optional+=("adb")
|
|
101
|
+
fi
|
|
102
|
+
|
|
103
|
+
# --- Machine-readable summary ---
|
|
104
|
+
echo
|
|
105
|
+
if [[ ${#missing_required[@]} -gt 0 ]]; then
|
|
106
|
+
for dep in "${missing_required[@]}"; do
|
|
107
|
+
echo "INSTALL_REQUIRED:$dep"
|
|
108
|
+
done
|
|
109
|
+
fi
|
|
110
|
+
if [[ ${#missing_optional[@]} -gt 0 ]]; then
|
|
111
|
+
for dep in "${missing_optional[@]}"; do
|
|
112
|
+
echo "INSTALL_OPTIONAL:$dep"
|
|
113
|
+
done
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
echo
|
|
117
|
+
if (( errors > 0 )); then
|
|
118
|
+
echo "*** ${#missing_required[@]} required dependency/ies missing. ***"
|
|
119
|
+
echo "Run install-dep.sh <name> to install, or see references/setup-guide.md."
|
|
120
|
+
exit 1
|
|
121
|
+
else
|
|
122
|
+
if [[ ${#missing_optional[@]} -gt 0 ]]; then
|
|
123
|
+
echo "Required dependencies OK. ${#missing_optional[@]} optional dependency/ies missing."
|
|
124
|
+
echo "Run install-dep.sh <name> to install optional tools."
|
|
125
|
+
else
|
|
126
|
+
echo "All dependencies are installed. Ready to decompile."
|
|
127
|
+
fi
|
|
128
|
+
exit 0
|
|
129
|
+
fi
|