@leejungkiin/awkit 1.5.2 → 1.5.3
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/bin/awk.js +141 -141
- package/package.json +1 -1
- package/skill-packs/ads-management/pack.json +8 -0
- package/skill-packs/mobile-android/pack.json +2 -6
- package/skill-packs/neural-memory/pack.json +2 -2
- package/skill-packs/reverse-engineering/pack.json +9 -0
- package/workflows/mobile/reverse-android-build.md +0 -222
- package/workflows/mobile/reverse-android-design.md +0 -139
- package/workflows/mobile/reverse-android-discover.md +0 -150
- package/workflows/mobile/reverse-android.md +0 -143
- package/workflows/mobile/reverse-ios-build.md +0 -240
- package/workflows/mobile/reverse-ios-design.md +0 -112
- package/workflows/mobile/reverse-ios-discover.md +0 -120
- package/workflows/mobile/reverse-ios.md +0 -152
- /package/{skills → skill-packs/ads-management/skills}/admob-roas/SKILL.md +0 -0
- /package/{workflows/ads → skill-packs/ads-management/workflows}/ads-analyst.md +0 -0
- /package/{workflows/ads → skill-packs/ads-management/workflows}/ads-audit.md +0 -0
- /package/{workflows/_uncategorized → skill-packs/ads-management/workflows}/ads-creative.md +0 -0
- /package/{workflows/_uncategorized → skill-packs/ads-management/workflows}/ads-full-optimization.md +0 -0
- /package/{workflows/ads → skill-packs/ads-management/workflows}/ads-optimize.md +0 -0
- /package/{workflows/_uncategorized → skill-packs/ads-management/workflows}/ads-plan.md +0 -0
- /package/{workflows/ads → skill-packs/ads-management/workflows}/ads-targeting.md +0 -0
- /package/{workflows/_uncategorized → skill-packs/ads-management/workflows}/ads-user-analysis.md +0 -0
- /package/{workflows/ads → skill-packs/ads-management/workflows}/adsExpert.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/SKILL.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/references/api-extraction-patterns.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/references/call-flow-analysis.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/references/fernflower-usage.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/references/jadx-usage.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/references/setup-guide.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/scripts/check-deps.sh +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/scripts/decompile.sh +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/scripts/find-api-calls.sh +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/scripts/install-dep.sh +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/SKILL.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/examples/getting-started/tech-stack.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/examples/pipeline/data-ui-parity.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/examples/pipeline/scanner-and-bootstrap.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/library-patterns.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/phase-0-discovery.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/phase-1-architecture.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/phase-2-blueprint-ui.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/phase-2-blueprint.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/phase-3-build.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/phase-3-logic-build.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/smali-reading-guide.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/templates/app-map.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/templates/architecture.md +0 -0
- /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/templates/blueprint.md +0 -0
- /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-android-build.md +0 -0
- /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-android-design.md +0 -0
- /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-android-discover.md +0 -0
- /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-android-scan.md +0 -0
- /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-android.md +0 -0
- /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-ios-build.md +0 -0
- /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-ios-design.md +0 -0
- /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-ios-discover.md +0 -0
- /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-ios-scan.md +0 -0
- /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-ios.md +0 -0
- /package/{workflows/ads → skill-packs/reverse-engineering/workflows}/smali-ads-config.md +0 -0
- /package/{workflows/ads → skill-packs/reverse-engineering/workflows}/smali-ads-flow.md +0 -0
- /package/{workflows/ads → skill-packs/reverse-engineering/workflows}/smali-ads-interstitial.md +0 -0
- /package/{workflows/ads → skill-packs/reverse-engineering/workflows}/smali-ads-native.md +0 -0
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 🔨 RE Android Phase 2+3+4 — Blueprint + UI Shell → Logic Build → Final Parity (UI-First)
|
|
3
|
-
parent: reverse-android
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# /re-android-build — Blueprint + UI + Build (Per Feature)
|
|
7
|
-
|
|
8
|
-
> **Parent:** [`/reverse-android`](reverse-android.md) → Phase 2+3+4
|
|
9
|
-
> **Prerequisite:** Completed Architecture from [`/re-android-design`](reverse-android-design.md)
|
|
10
|
-
> **Skill:** `smali-to-kotlin` → `phase-2-blueprint-ui.md` + `phase-3-logic-build.md`
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## 🔄 Feature Loop (UI-First)
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
For each feature (from Architecture Build Order):
|
|
18
|
-
Phase 2: Blueprint + UI (contracts + visual shell)
|
|
19
|
-
↓ 🚦 GATE: User approves UI + contracts
|
|
20
|
-
Phase 3: Logic Build (domain → data → wire)
|
|
21
|
-
↓ 📊 CHECKPOINT
|
|
22
|
-
→ Next feature
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## 📐🎨 Phase 2: Blueprint + UI Design
|
|
28
|
-
|
|
29
|
-
> **Output:** Approved contracts + Working Compose UI shell with mock data.
|
|
30
|
-
|
|
31
|
-
### Part A: Contracts (signatures only)
|
|
32
|
-
|
|
33
|
-
#### 2.1: Deep Smali Reading
|
|
34
|
-
Read Smali files for the chosen feature. Extract class hierarchy, fields, method signatures,
|
|
35
|
-
string constants, control flow. See `smali-reading-guide.md`.
|
|
36
|
-
|
|
37
|
-
#### 2.2–2.5: Define Contracts
|
|
38
|
-
```kotlin
|
|
39
|
-
// 2.2 Domain Model
|
|
40
|
-
data class [Model](val field: Type, ...)
|
|
41
|
-
|
|
42
|
-
// 2.3 Repository Interface
|
|
43
|
-
interface [Feature]Repository {
|
|
44
|
-
suspend fun [method](...): Result<[Type]>
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// 2.4 API Interface
|
|
48
|
-
interface [Feature]Api {
|
|
49
|
-
@[METHOD]("[endpoint]")
|
|
50
|
-
suspend fun [method](...): [Response]
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// 2.5 UseCase
|
|
54
|
-
class [Action]UseCase(repo: [Feature]Repository) {
|
|
55
|
-
suspend operator fun invoke(...): Result<[Type]> // TODO()
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
#### 2.6: UI State Design
|
|
60
|
-
```kotlin
|
|
61
|
-
data class [Screen]UiState(
|
|
62
|
-
val field: Type = default,
|
|
63
|
-
val isLoading: Boolean = false,
|
|
64
|
-
val error: String? = null
|
|
65
|
-
)
|
|
66
|
-
sealed interface [Screen]Event { /* navigation, snackbar */ }
|
|
67
|
-
sealed interface [Screen]Action { /* user interactions */ }
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Part B: UI Visual Shell
|
|
71
|
-
|
|
72
|
-
#### 2.7: Resource Extraction ⭐ (BEFORE UI code!)
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
# Only resources for THIS screen
|
|
76
|
-
grep -o '@drawable/[a-z_]*' [apktool_dir]/res/layout/activity_[screen].xml | sort -u
|
|
77
|
-
grep -o '@color/[a-z_]*' [apktool_dir]/res/layout/activity_[screen].xml | sort -u
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
Copy ONLY needed resources. Verify they compile.
|
|
81
|
-
|
|
82
|
-
#### 2.8: UI Implementation ⭐ (Visual shell with mock data)
|
|
83
|
-
|
|
84
|
-
- Use UiState from 2.6 with hardcoded defaults
|
|
85
|
-
- Use REAL resources from 2.7
|
|
86
|
-
- Create `[Screen]Content` composable (stateless)
|
|
87
|
-
- Match visual parity with original app
|
|
88
|
-
- NO ViewModel connection, NO real API calls
|
|
89
|
-
|
|
90
|
-
```kotlin
|
|
91
|
-
@Composable
|
|
92
|
-
fun [Screen]Content(
|
|
93
|
-
uiState: [Screen]UiState = [Screen]UiState(), // Mock
|
|
94
|
-
onAction: ([Screen]Action) -> Unit = {} // No-op
|
|
95
|
-
) {
|
|
96
|
-
// Full Compose UI matching original app
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
@Preview @Composable
|
|
100
|
-
private fun NormalPreview() { AppTheme { [Screen]Content() } }
|
|
101
|
-
|
|
102
|
-
@Preview @Composable
|
|
103
|
-
private fun LoadingPreview() { AppTheme { [Screen]Content([Screen]UiState(isLoading = true)) } }
|
|
104
|
-
|
|
105
|
-
@Preview @Composable
|
|
106
|
-
private fun ErrorPreview() { AppTheme { [Screen]Content([Screen]UiState(error = "Error")) } }
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
#### 2.9: Visual Parity Check ⭐
|
|
110
|
-
|
|
111
|
-
Compare with original app:
|
|
112
|
-
- [ ] Layout structure matches
|
|
113
|
-
- [ ] Colors, typography, spacing correct
|
|
114
|
-
- [ ] Icons/images positioned correctly
|
|
115
|
-
- [ ] All states: normal, loading, error, empty
|
|
116
|
-
|
|
117
|
-
### 🚦 UI + Contracts Gate (MANDATORY)
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
"📐🎨 Blueprint + UI cho [Feature] xong:
|
|
121
|
-
📝 Contracts: [N] models, [N] repos, [N] use cases, [N] APIs
|
|
122
|
-
🎨 UI: [Screen] with [N] state previews
|
|
123
|
-
📸 Visual Parity: [OK / needs adjustment]
|
|
124
|
-
|
|
125
|
-
→ ✅ Approve → Phase 3 (Logic Build)
|
|
126
|
-
→ 🎨 Adjust UI → fix then re-check
|
|
127
|
-
→ 📝 Adjust contracts → revise"
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
> ⚠️ **DO NOT proceed to Phase 3 without user approval.**
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## 🔨 Phase 3: Logic Build
|
|
135
|
-
|
|
136
|
-
> **Output:** Full production-quality Kotlin code. Wire logic to EXISTING UI.
|
|
137
|
-
|
|
138
|
-
### 3.1: Domain Layer
|
|
139
|
-
Models + Repository interfaces + UseCases (implement invoke with repo calls)
|
|
140
|
-
|
|
141
|
-
### 3.2: Data Layer
|
|
142
|
-
DTOs + Retrofit API + Room (if applicable) + Repository implementation
|
|
143
|
-
|
|
144
|
-
### 3.3: DI Module
|
|
145
|
-
Hilt @Module with @Binds for repository
|
|
146
|
-
|
|
147
|
-
### 3.4: ViewModel
|
|
148
|
-
@HiltViewModel with StateFlow + SharedFlow, implements onAction()
|
|
149
|
-
|
|
150
|
-
### 3.5: Wire UI ↔ Logic ⭐ (NOT "code new UI")
|
|
151
|
-
|
|
152
|
-
The UI already exists from Phase 2.8. Only CONNECT it:
|
|
153
|
-
|
|
154
|
-
```kotlin
|
|
155
|
-
// Keep stateless Content composable from Phase 2 (for Preview):
|
|
156
|
-
// [Screen]Content(uiState, onAction) — DO NOT MODIFY
|
|
157
|
-
|
|
158
|
-
// ADD wrapper that wires ViewModel:
|
|
159
|
-
@Composable
|
|
160
|
-
fun [Screen](
|
|
161
|
-
viewModel: [Screen]ViewModel = hiltViewModel(),
|
|
162
|
-
onNavigate: () -> Unit
|
|
163
|
-
) {
|
|
164
|
-
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
|
|
165
|
-
LaunchedEffect(Unit) {
|
|
166
|
-
viewModel.events.collect { event -> /* handle navigation */ }
|
|
167
|
-
}
|
|
168
|
-
[Screen]Content(uiState = uiState, onAction = viewModel::onAction)
|
|
169
|
-
}
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### 3.6: Integration Test ⭐
|
|
173
|
-
- [ ] API calls succeed, data displays
|
|
174
|
-
- [ ] Loading/error states work
|
|
175
|
-
- [ ] Navigation correct
|
|
176
|
-
- [ ] Crypto output matches (if applicable)
|
|
177
|
-
|
|
178
|
-
### 🔒 Crypto Utils (Special)
|
|
179
|
-
If crypto involved: implement + unit test IMMEDIATELY with known pairs.
|
|
180
|
-
> ⚠️ MUST produce identical output.
|
|
181
|
-
|
|
182
|
-
### ✅ Feature Checkpoint
|
|
183
|
-
|
|
184
|
-
```markdown
|
|
185
|
-
## ✅ Feature Complete: [Name]
|
|
186
|
-
Files: [list] | Resources: [count] | Tests: [status]
|
|
187
|
-
⏭️ Next Feature: [Name] → Return to Phase 2
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
---
|
|
191
|
-
|
|
192
|
-
## ✅ Phase 4: Final Parity Check (After ALL features)
|
|
193
|
-
|
|
194
|
-
### Checklist
|
|
195
|
-
- [ ] API Parity — all endpoints match (headers, body, encoding)
|
|
196
|
-
- [ ] Data Parity — crypto/hash output identical
|
|
197
|
-
- [ ] UI Parity — screen-by-screen comparison
|
|
198
|
-
- [ ] Edge Cases — empty states, errors, offline, lifecycle
|
|
199
|
-
- [ ] Build: `./gradlew assembleDebug && ./gradlew test && ./gradlew lint`
|
|
200
|
-
|
|
201
|
-
### 🎉 Final Summary
|
|
202
|
-
|
|
203
|
-
```markdown
|
|
204
|
-
## ✅ Reverse Engineering Complete!
|
|
205
|
-
- Screens: [N] | Features: [N]
|
|
206
|
-
- Libs reused: [N] | Replaced: [N]
|
|
207
|
-
- Tests: [pass/fail] | Lint: [warnings]
|
|
208
|
-
|
|
209
|
-
⏭️ Next: /test → /deploy → /code-janitor
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
---
|
|
213
|
-
|
|
214
|
-
## 🔗 Related
|
|
215
|
-
|
|
216
|
-
- **Parent:** [`/reverse-android`](reverse-android.md)
|
|
217
|
-
- **Previous:** [`/re-android-design`](reverse-android-design.md) (Phase 1)
|
|
218
|
-
- **Skill:** `smali-to-kotlin` → `phase-2-blueprint-ui.md` + `phase-3-logic-build.md`
|
|
219
|
-
|
|
220
|
-
---
|
|
221
|
-
|
|
222
|
-
*re-android-build v4.0.0 — UI-First Blueprint + Build*
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 🏗️ RE Android Phase 1 — Architecture Design (NO CODE BODIES)
|
|
3
|
-
parent: reverse-android
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# /re-android-design — Architecture Blueprint
|
|
7
|
-
|
|
8
|
-
> **Parent:** [`/reverse-android`](reverse-android.md) → Phase 1
|
|
9
|
-
> **Prerequisite:** Completed App Map from [`/re-android-discover`](reverse-android-discover.md)
|
|
10
|
-
> **Skill:** `smali-to-kotlin` → `phase-1-architecture.md`
|
|
11
|
-
> **Zoom Level:** 1 — District View
|
|
12
|
-
> **Output:** Architecture Blueprint (diagrams, tables, NO CODE BODIES)
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## ⛔ ZOOM 1 RULE
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
This workflow produces NO CODE BODIES.
|
|
20
|
-
Allowed: Architecture diagrams, layer maps, feature tables, file paths, API endpoint lists.
|
|
21
|
-
Allowed: build.gradle.kts plugin/dependency declarations (declaration only).
|
|
22
|
-
If you are about to write a function body → STOP → wrong zoom level.
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## 📐 Step 1: Layer Design
|
|
28
|
-
|
|
29
|
-
Design Clean Architecture layers based on App Map:
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
┌─────────────────────────────────────┐
|
|
33
|
-
│ Presentation │
|
|
34
|
-
│ ├── screens/ ([N] screens) │
|
|
35
|
-
│ ├── navigation/ (NavGraph + Routes) │
|
|
36
|
-
│ ├── theme/ (Material 3) │
|
|
37
|
-
│ └── components/ (Shared UI) │
|
|
38
|
-
├─────────────────────────────────────┤
|
|
39
|
-
│ Domain │
|
|
40
|
-
│ ├── model/ ([N] models) │
|
|
41
|
-
│ ├── repository/ ([N] interfaces) │
|
|
42
|
-
│ └── usecase/ ([N] use cases) │
|
|
43
|
-
├─────────────────────────────────────┤
|
|
44
|
-
│ Data │
|
|
45
|
-
│ ├── remote/ ([N] API services) │
|
|
46
|
-
│ ├── local/ (Room, DataStore) │
|
|
47
|
-
│ └── repository/ (implementations) │
|
|
48
|
-
├─────────────────────────────────────┤
|
|
49
|
-
│ DI (Hilt) │
|
|
50
|
-
│ └── modules/ (Network, DB, Repo) │
|
|
51
|
-
└─────────────────────────────────────┘
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## 📋 Step 2: Feature → File Mapping
|
|
55
|
-
|
|
56
|
-
Map mỗi feature tới Clean Architecture components:
|
|
57
|
-
|
|
58
|
-
| Feature | Domain Model | Repository | UseCase | Screen(s) | ViewModel |
|
|
59
|
-
|---------|-------------|-----------|---------|-----------|-----------|
|
|
60
|
-
|
|
61
|
-
## 🌐 Step 3: API Endpoint Inventory
|
|
62
|
-
|
|
63
|
-
Trích xuất TẤT CẢ API endpoints từ Smali:
|
|
64
|
-
|
|
65
|
-
| # | Method | Endpoint | Auth | Notes |
|
|
66
|
-
|---|--------|----------|------|-------|
|
|
67
|
-
|
|
68
|
-
**Base URL:** `[from Smali const-string]`
|
|
69
|
-
|
|
70
|
-
## 💾 Step 4: Data Schema
|
|
71
|
-
|
|
72
|
-
| Model | Key Fields | Source | Storage |
|
|
73
|
-
|-------|-----------|--------|---------|
|
|
74
|
-
|
|
75
|
-
## 📁 Step 5: Project Structure
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
app/src/main/java/[package]/
|
|
79
|
-
├── App.kt
|
|
80
|
-
├── di/
|
|
81
|
-
├── data/remote/ + data/local/ + data/repository/
|
|
82
|
-
├── domain/model/ + domain/repository/ + domain/usecase/
|
|
83
|
-
├── presentation/navigation/ + screens/ + theme/
|
|
84
|
-
└── util/
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## 🔢 Step 6: Build Order (UI-First) ⭐
|
|
88
|
-
|
|
89
|
-
| # | Phase | Scope | Complexity |
|
|
90
|
-
|---|-------|-------|-----------|
|
|
91
|
-
| 1 | 🟢 Foundation | Project + DI skeleton + Theme/Design System | Low |
|
|
92
|
-
| 2 | 🟢 Navigation | Routes, tab bar, NavGraph | Low |
|
|
93
|
-
| 3 | 🔵 Per Feature | Blueprint (contracts) + UI Shell (visual) | Medium |
|
|
94
|
-
| 4 | 🚦 UI Gate | User approves UI before logic | — |
|
|
95
|
-
| 5 | 🟡 Per Feature | Logic Build (Domain → Data → VM → Wire UI) | High |
|
|
96
|
-
| 6 | 📦 SDKs | Third-party SDK + Native libs integration | Medium |
|
|
97
|
-
| N | 🔴 Final | Full Parity Check | High |
|
|
98
|
-
|
|
99
|
-
> **UI-First:** Design and approve UI before coding logic for each feature.
|
|
100
|
-
|
|
101
|
-
## 🔧 Step 7: Tech Stack Confirmation
|
|
102
|
-
|
|
103
|
-
| Decision | Choice | Rationale |
|
|
104
|
-
|----------|--------|-----------|
|
|
105
|
-
| UI | Jetpack Compose + M3 | Modern |
|
|
106
|
-
| DI | Hilt | Standard |
|
|
107
|
-
| ... | ... | ... |
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## 📊 Output: Architecture Blueprint
|
|
112
|
-
|
|
113
|
-
Sử dụng template từ `skills/smali-to-kotlin/templates/architecture.md`.
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
## ✅ Gate: Chuyển sang Phase 2
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
"🏗️ Architecture Blueprint xong!
|
|
121
|
-
Anh muốn bắt đầu từ feature nào?
|
|
122
|
-
Em suggest: [Feature X] vì [reason]."
|
|
123
|
-
|
|
124
|
-
→ User picks feature → /re-android-build (Phase 2: Blueprint for that feature)
|
|
125
|
-
→ User wants changes → adjust architecture
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## 🔗 Related
|
|
131
|
-
|
|
132
|
-
- **Previous:** [`/re-android-discover`](reverse-android-discover.md) (Phase 0)
|
|
133
|
-
- **Next:** [`/re-android-build`](reverse-android-build.md) (Phase 2+3)
|
|
134
|
-
- **Parent:** [`/reverse-android`](reverse-android.md)
|
|
135
|
-
- **Skill:** `skills/smali-to-kotlin/phase-1-architecture.md`
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
*re-android-design v3.0.0 — Phase 1: Architecture Blueprint*
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 🗺️ RE Android Phase 0 — Discovery & App Map (NO CODE output)
|
|
3
|
-
parent: reverse-android
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# /re-android-discover — Discovery & App Map
|
|
7
|
-
|
|
8
|
-
> **Parent:** [`/reverse-android`](reverse-android.md) → Phase 0
|
|
9
|
-
> **Skill:** `smali-to-kotlin` → `phase-0-discovery.md`
|
|
10
|
-
> **Zoom Level:** 0 — Satellite View
|
|
11
|
-
> **Output:** App Map (diagrams, tables, NO CODE)
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## ⛔ ZOOM 0 RULE
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
This workflow produces NO CODE output.
|
|
19
|
-
Only: diagrams, tables, bullet lists, bash scan commands.
|
|
20
|
-
If you are about to write Kotlin code → STOP → you are at wrong zoom level.
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## 📦 Step 0: Library Scanner
|
|
26
|
-
|
|
27
|
-
> Nhận diện toàn bộ thư viện **trước khi làm bất kỳ thứ gì**.
|
|
28
|
-
|
|
29
|
-
### 0.1: Quét structure
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
# Top-level packages
|
|
33
|
-
find [apktool_dir]/smali -maxdepth 3 -type d | sed 's|.*/smali/||' | sort
|
|
34
|
-
|
|
35
|
-
# Multi-dex check
|
|
36
|
-
find [apktool_dir] -name "smali*" -maxdepth 1 -type d
|
|
37
|
-
|
|
38
|
-
# Resource counts
|
|
39
|
-
ls [apktool_dir]/res/layout/ 2>/dev/null | wc -l
|
|
40
|
-
ls [apktool_dir]/res/drawable*/ 2>/dev/null | wc -l
|
|
41
|
-
|
|
42
|
-
# Native + Assets
|
|
43
|
-
find [apktool_dir]/lib -name "*.so" 2>/dev/null
|
|
44
|
-
ls [apktool_dir]/assets/ 2>/dev/null
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 0.2: Phân loại thư viện
|
|
48
|
-
|
|
49
|
-
Dùng patterns từ `library-patterns.md`, phân thành 5 nhóm:
|
|
50
|
-
|
|
51
|
-
| Category | Example | Action |
|
|
52
|
-
|----------|---------|--------|
|
|
53
|
-
| ✅ Reuse | Retrofit, OkHttp | Add to build.gradle |
|
|
54
|
-
| 🔄 Replace | Volley, AsyncTask | Map to modern |
|
|
55
|
-
| 🔵 Google/Firebase | FCM, Analytics | Use latest |
|
|
56
|
-
| 📱 Native | .so files | Keep, JNI bridge |
|
|
57
|
-
| 🏷️ App Code | com.app.* | Rebuild |
|
|
58
|
-
|
|
59
|
-
### 0.3: User approval
|
|
60
|
-
|
|
61
|
-
> **GATE:** Hiển thị Library Report → User approve trước khi tiếp.
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## 📄 Step 1: Manifest Analysis
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
cat [apktool_dir]/AndroidManifest.xml
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### 1.1: Trích xuất
|
|
72
|
-
|
|
73
|
-
- Application ID + Package name
|
|
74
|
-
- Min/Target SDK
|
|
75
|
-
- Permissions (phân nhóm: network, storage, camera, location, other)
|
|
76
|
-
- Entry points: Application class, Launcher Activity, MainActivity
|
|
77
|
-
- Components: Activities (→ future screens), Services, Receivers, Providers
|
|
78
|
-
- Deep links / Intent filters
|
|
79
|
-
|
|
80
|
-
### 1.2: Screen Map
|
|
81
|
-
|
|
82
|
-
Map Activities → future Compose screens:
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
SplashActivity → presentation/screens/splash/
|
|
86
|
-
LoginActivity → presentation/screens/auth/
|
|
87
|
-
MainActivity → presentation/screens/main/
|
|
88
|
-
DetailActivity → presentation/screens/detail/
|
|
89
|
-
SettingsActivity → presentation/screens/settings/
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Draw navigation flow (ASCII or Mermaid).
|
|
93
|
-
|
|
94
|
-
### 1.3: Complexity Estimate
|
|
95
|
-
|
|
96
|
-
| Area | Rating | Notes |
|
|
97
|
-
|------|--------|-------|
|
|
98
|
-
| Data Layer | ●●●○○ | [evidence] |
|
|
99
|
-
| Core Logic | ●●○○○ | [evidence] |
|
|
100
|
-
| UI Screens | ●●●●○ | [evidence] |
|
|
101
|
-
| SDK Integration | ●●○○○ | [evidence] |
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## 📊 Output: App Map
|
|
106
|
-
|
|
107
|
-
Sử dụng template từ `skills/smali-to-kotlin/templates/app-map.md`:
|
|
108
|
-
|
|
109
|
-
```markdown
|
|
110
|
-
## 🗺️ App Map: [App Name]
|
|
111
|
-
|
|
112
|
-
### Identity
|
|
113
|
-
[package, SDK, counts]
|
|
114
|
-
|
|
115
|
-
### Screen Flow
|
|
116
|
-
[navigation graph]
|
|
117
|
-
|
|
118
|
-
### Library Landscape
|
|
119
|
-
[categorized table]
|
|
120
|
-
|
|
121
|
-
### Complexity Estimate
|
|
122
|
-
[rating dots]
|
|
123
|
-
|
|
124
|
-
### Key Observations
|
|
125
|
-
[notable findings]
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## ✅ Gate: Chuyển sang Phase 1
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
"🗺️ App Map xong! Anh review map này.
|
|
134
|
-
Có gì cần điều chỉnh không? OK → em sẽ thiết kế Architecture."
|
|
135
|
-
|
|
136
|
-
→ User approves → /re-android-design (Phase 1)
|
|
137
|
-
→ User has questions → investigate và update map
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
## 🔗 Related
|
|
143
|
-
|
|
144
|
-
- **Next:** [`/re-android-design`](reverse-android-design.md) (Phase 1: Architecture)
|
|
145
|
-
- **Parent:** [`/reverse-android`](reverse-android.md)
|
|
146
|
-
- **Skill reference:** `skills/smali-to-kotlin/phase-0-discovery.md`
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
*re-android-discover v3.0.0 — Phase 0: Discovery & App Map*
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 🔧 Dịch ngược APK Android (Apktool output) → App Kotlin hiện đại với Jetpack Compose, Clean Architecture, và UI-First methodology.
|
|
3
|
-
skill: smali-to-kotlin
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# /reverse-android — Android APK Reverse Engineering Workflow
|
|
7
|
-
|
|
8
|
-
> **Skill:** `smali-to-kotlin` v2.0 | **Tech:** Kotlin + Compose + Hilt + Retrofit + Room
|
|
9
|
-
> **Philosophy:** "Map → Blueprint → UI First → Logic Behind"
|
|
10
|
-
> **Key:** UI is designed and approved BEFORE coding any business logic.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## ⚡ QUICK START
|
|
15
|
-
|
|
16
|
-
User cung cấp: Apktool output dir, `AndroidManifest.xml`, hoặc nói "reverse engineer APK này".
|
|
17
|
-
Workflow dẫn dắt qua **5 phases** — UI-First approach, **không bao giờ nhảy cóc**.
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## 🔵 Session Setup
|
|
22
|
-
|
|
23
|
-
### Bước 0.1: Khởi tạo session state
|
|
24
|
-
|
|
25
|
-
```yaml
|
|
26
|
-
reverse_session:
|
|
27
|
-
project_name: "[TBD - từ manifest]"
|
|
28
|
-
apktool_dir: "[path]"
|
|
29
|
-
current_phase: 0
|
|
30
|
-
current_feature: null
|
|
31
|
-
phase_2_status:
|
|
32
|
-
contracts: pending
|
|
33
|
-
ui_shell: pending
|
|
34
|
-
resources: pending
|
|
35
|
-
completed_features: []
|
|
36
|
-
pending_features: []
|
|
37
|
-
decisions: []
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Bước 0.2: Xác nhận input
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
🔧 Android Reverse Engineering v2.0 — UI-First Pipeline
|
|
44
|
-
|
|
45
|
-
Em cần biết:
|
|
46
|
-
1. Thư mục Apktool output ở đâu?
|
|
47
|
-
2. Tên app gốc? Package name?
|
|
48
|
-
|
|
49
|
-
Chưa chạy Apktool? → apktool d your-app.apk -o ./decompiled/
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## 📋 Pipeline Overview (5 Phases — UI-First)
|
|
55
|
-
|
|
56
|
-
| Phase | Name | Sub-workflow | Code? | Gate |
|
|
57
|
-
|-------|------|-------------|-------|------|
|
|
58
|
-
| 0 | 🗺️ Discovery | [`/re-android-discover`](reverse-android-discover.md) | ❌ | User approves Map |
|
|
59
|
-
| 1 | 🏗️ Architecture | [`/re-android-design`](reverse-android-design.md) | ❌ | User approves Architecture |
|
|
60
|
-
| 2 | 📐🎨 Blueprint + UI | [`/re-android-build`](reverse-android-build.md) | UI code | User approves UI + Contracts |
|
|
61
|
-
| 3 | 🔨 Logic Build | [`/re-android-build`](reverse-android-build.md) | Full logic | Feature checkpoint |
|
|
62
|
-
| 4 | ✅ Final Parity | [`/re-android-build`](reverse-android-build.md) | — | Final check |
|
|
63
|
-
|
|
64
|
-
### Execution Flow
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
Session Setup
|
|
68
|
-
↓
|
|
69
|
-
Phase 0: Discovery (/re-android-discover) → App Map
|
|
70
|
-
↓ [User approves]
|
|
71
|
-
Phase 1: Architecture (/re-android-design) → Architecture Blueprint
|
|
72
|
-
↓ [User approves + picks feature]
|
|
73
|
-
Feature Loop (/re-android-build):
|
|
74
|
-
Phase 2: Blueprint + UI (contracts + visual shell + resources)
|
|
75
|
-
↓ 🚦 GATE: User approves UI + contracts
|
|
76
|
-
Phase 3: Logic Build (domain → data → DI → VM → wire UI)
|
|
77
|
-
↓ 📊 CHECKPOINT: Feature done
|
|
78
|
-
→ Repeat for next feature
|
|
79
|
-
↓
|
|
80
|
-
Phase 4: Final Parity Check & Quality Gate
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## 🔭 ZOOM CONTROL
|
|
86
|
-
|
|
87
|
-
```yaml
|
|
88
|
-
pre_output_check:
|
|
89
|
-
- "Đang ở phase nào?"
|
|
90
|
-
- "Output có đúng phase rule không?"
|
|
91
|
-
- "Phase 0/1: NO CODE BODIES"
|
|
92
|
-
- "Phase 2: UI code + signatures (no logic bodies)"
|
|
93
|
-
- "Phase 3: Full implementation code"
|
|
94
|
-
|
|
95
|
-
phase_rules:
|
|
96
|
-
phase_0: "NO CODE. Only diagrams, tables, maps."
|
|
97
|
-
phase_1: "NO CODE BODIES. Only architecture diagrams, file lists."
|
|
98
|
-
phase_2_contracts: "SIGNATURES ONLY. Interfaces, data classes, sealed classes."
|
|
99
|
-
phase_2_ui: "FULL UI CODE. Compose with hardcoded mock data + @Preview."
|
|
100
|
-
phase_3: "FULL LOGIC CODE. Domain → Data → DI → VM → Wire UI."
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## 🚫 WORKFLOW RULES
|
|
106
|
-
|
|
107
|
-
```yaml
|
|
108
|
-
never_skip:
|
|
109
|
-
- Phase 0 (Discovery) — always first
|
|
110
|
-
- Phase 1 (Architecture) — design before coding
|
|
111
|
-
- Phase 2 UI Gate — user MUST approve UI before Phase 3
|
|
112
|
-
- Per-feature Blueprint before Logic Build
|
|
113
|
-
|
|
114
|
-
never_do:
|
|
115
|
-
- Write logic code before UI is approved
|
|
116
|
-
- Mass-copy resources from APK (on-demand only)
|
|
117
|
-
- Implement multiple features simultaneously
|
|
118
|
-
- Modify UI significantly in Phase 3 (only wire, don't redesign)
|
|
119
|
-
- Skip crypto parity check
|
|
120
|
-
|
|
121
|
-
always_do:
|
|
122
|
-
- Extract resources BEFORE coding UI (Phase 2.7 → 2.8)
|
|
123
|
-
- Create @Preview for ALL states
|
|
124
|
-
- Keep stateless composable (LoginScreenContent) after wiring
|
|
125
|
-
- Checkpoint after each feature
|
|
126
|
-
- Document all decisions
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## 🔗 Related
|
|
132
|
-
|
|
133
|
-
- **Sub-workflows:**
|
|
134
|
-
- [`/re-android-discover`](reverse-android-discover.md) — Phase 0: Discovery
|
|
135
|
-
- [`/re-android-design`](reverse-android-design.md) — Phase 1: Architecture
|
|
136
|
-
- [`/re-android-build`](reverse-android-build.md) — Phase 2+3+4: Blueprint + UI + Build
|
|
137
|
-
- **Skill:** `smali-to-kotlin` v2.0 (UI-First pipeline)
|
|
138
|
-
- **Sibling:** `/reverse-ios` (iOS counterpart)
|
|
139
|
-
- **After RE done:** `/test`, `/deploy`, `/code-janitor`
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
*reverse-android workflow v4.0.0 — UI-First RE Pipeline*
|