@leejungkiin/awkit 1.0.3 → 1.0.5
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 +0 -10
- package/package.json +3 -9
- package/workflows/mobile/reverse-android-build.md +106 -156
- package/workflows/mobile/reverse-android-design.md +136 -0
- package/workflows/mobile/reverse-android-discover.md +150 -0
- package/workflows/mobile/reverse-android.md +68 -37
- package/workflows/mobile/reverse-ios-build.md +72 -191
- package/workflows/mobile/reverse-ios-design.md +103 -0
- package/workflows/mobile/reverse-ios-discover.md +120 -0
- package/workflows/mobile/reverse-ios.md +64 -38
- package/workflows/mobile/reverse-android-scan.md +0 -158
- package/workflows/mobile/reverse-ios-scan.md +0 -155
package/README.md
CHANGED
|
@@ -15,16 +15,6 @@ awkit install
|
|
|
15
15
|
awkit doctor
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
### Cài đặt từ Source Github (Dành cho Developer)
|
|
19
|
-
```bash
|
|
20
|
-
git clone https://github.com/babyskill/awk.git ~/Dev/NodeJS/main-awf
|
|
21
|
-
cd ~/Dev/NodeJS/main-awf
|
|
22
|
-
node bin/awk.js install
|
|
23
|
-
|
|
24
|
-
# Verify
|
|
25
|
-
node bin/awk.js doctor
|
|
26
|
-
```
|
|
27
|
-
|
|
28
18
|
|
|
29
19
|
## 📦 Commands
|
|
30
20
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leejungkiin/awkit",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "AWKit v1.0 — Antigravity Workflow Kit. Unified AI agent orchestration system.",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "AWKit v1.0.5 — Antigravity Workflow Kit. Unified AI agent orchestration system.",
|
|
5
5
|
"main": "bin/awk.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"awkit": "bin/awk.js",
|
|
@@ -17,13 +17,7 @@
|
|
|
17
17
|
"harvest-dry": "node scripts/harvest.js --dry-run"
|
|
18
18
|
},
|
|
19
19
|
"keywords": [
|
|
20
|
-
"awkit"
|
|
21
|
-
"awk",
|
|
22
|
-
"antigravity-workflow-kit",
|
|
23
|
-
"ai-agent",
|
|
24
|
-
"workflow",
|
|
25
|
-
"gemini",
|
|
26
|
-
"claude"
|
|
20
|
+
"awkit"
|
|
27
21
|
],
|
|
28
22
|
"author": "Kien AI",
|
|
29
23
|
"license": "MIT",
|
|
@@ -1,219 +1,169 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: 🔨 RE Android Phase 2+3 — Per-feature Blueprint → Implementation → Parity Check
|
|
3
3
|
parent: reverse-android
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# /re-android-build —
|
|
6
|
+
# /re-android-build — Blueprint & Build (Per Feature)
|
|
7
7
|
|
|
8
|
-
> **Parent:** [`/reverse-android`](reverse-android.md) →
|
|
9
|
-
> **Prerequisite:**
|
|
10
|
-
> **Skill:** `smali-to-kotlin`
|
|
8
|
+
> **Parent:** [`/reverse-android`](reverse-android.md) → Phase 2+3
|
|
9
|
+
> **Prerequisite:** Completed Architecture from [`/re-android-design`](reverse-android-design.md)
|
|
10
|
+
> **Skill:** `smali-to-kotlin` → `phase-2-blueprint.md` + `phase-3-build.md`
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## 🔄 Feature Loop
|
|
15
15
|
|
|
16
|
-
> **Input:** Smali files cho network, models, database logic
|
|
17
|
-
|
|
18
|
-
### 2.1: Network Layer → Retrofit interfaces
|
|
19
|
-
|
|
20
|
-
```kotlin
|
|
21
|
-
interface UserApi {
|
|
22
|
-
@GET("users/{id}")
|
|
23
|
-
suspend fun getUser(@Path("id") id: String): UserDto
|
|
24
|
-
|
|
25
|
-
@POST("auth/login")
|
|
26
|
-
suspend fun login(@Body request: LoginRequest): TokenDto
|
|
27
|
-
}
|
|
28
16
|
```
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
@SerialName("user_id") val userId: String,
|
|
36
|
-
@SerialName("full_name") val fullName: String,
|
|
37
|
-
@SerialName("email") val email: String,
|
|
38
|
-
)
|
|
17
|
+
For each feature (from Architecture Build Order):
|
|
18
|
+
Phase 2: Blueprint (Zoom 2 — signatures only)
|
|
19
|
+
↓ [User approves]
|
|
20
|
+
Phase 3: Implementation (Zoom 3 — full code)
|
|
21
|
+
↓ [Checkpoint]
|
|
22
|
+
→ Next feature
|
|
39
23
|
```
|
|
40
24
|
|
|
41
|
-
### 2.3: Room Database (nếu có local DB)
|
|
42
|
-
|
|
43
|
-
- Entity với `@Entity` + `@PrimaryKey`
|
|
44
|
-
- DAO với `@Dao` + `Flow<>` return types
|
|
45
|
-
- `OnConflictStrategy.REPLACE` cho upsert
|
|
46
|
-
|
|
47
|
-
### 2.4: Repository Pattern
|
|
48
|
-
|
|
49
|
-
- Domain: `interface UserRepository` (Flows + Results)
|
|
50
|
-
- Data: `UserRepositoryImpl @Inject constructor(api, dao)` — offline-first
|
|
51
|
-
|
|
52
|
-
### ✅ Checkpoint Step 2
|
|
53
|
-
|
|
54
25
|
---
|
|
55
26
|
|
|
56
|
-
##
|
|
27
|
+
## 📐 Phase 2: Feature Blueprint (Zoom 2)
|
|
57
28
|
|
|
58
|
-
> **
|
|
29
|
+
> **Output:** Contracts, interfaces, state design. **Signatures only, no bodies.**
|
|
59
30
|
|
|
60
|
-
###
|
|
31
|
+
### 2.1: Deep Smali Reading
|
|
61
32
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
Custom XOR/shift loops → Custom obfuscation
|
|
67
|
-
```
|
|
33
|
+
Read Smali files for the chosen feature. Extract:
|
|
34
|
+
- Class hierarchy, fields, method signatures
|
|
35
|
+
- String constants (URLs, keys, messages)
|
|
36
|
+
- Control flow → business rules (document, don't code)
|
|
68
37
|
|
|
69
|
-
###
|
|
38
|
+
### 2.2: Contracts
|
|
39
|
+
|
|
40
|
+
Define for this feature:
|
|
70
41
|
|
|
71
42
|
```kotlin
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
fun
|
|
43
|
+
// Domain Model
|
|
44
|
+
data class [Model](val field1: Type, ...)
|
|
45
|
+
|
|
46
|
+
// Repository Interface
|
|
47
|
+
interface [Feature]Repository {
|
|
48
|
+
suspend fun [method](...): Result<[Type]>
|
|
49
|
+
fun [stream](): Flow<[Type]>
|
|
79
50
|
}
|
|
80
|
-
```
|
|
81
51
|
|
|
82
|
-
|
|
52
|
+
// API Interface
|
|
53
|
+
interface [Feature]Api {
|
|
54
|
+
@[METHOD]("[endpoint]")
|
|
55
|
+
suspend fun [method](...): [Response]
|
|
56
|
+
}
|
|
83
57
|
|
|
84
|
-
|
|
85
|
-
class
|
|
86
|
-
|
|
87
|
-
fun `md5 hash matches original`() {
|
|
88
|
-
assertEquals("expected_hash", CryptoUtils.hashMd5("test_input"))
|
|
89
|
-
}
|
|
58
|
+
// UseCase
|
|
59
|
+
class [Action]UseCase(repo: [Feature]Repository) {
|
|
60
|
+
suspend operator fun invoke(...): Result<[Type]> // TODO()
|
|
90
61
|
}
|
|
91
62
|
```
|
|
92
63
|
|
|
93
|
-
###
|
|
64
|
+
### 2.3: UI State Design
|
|
94
65
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
66
|
+
```kotlin
|
|
67
|
+
data class [Screen]UiState(
|
|
68
|
+
val field: Type = default,
|
|
69
|
+
val isLoading: Boolean = false,
|
|
70
|
+
val error: String? = null
|
|
71
|
+
)
|
|
98
72
|
|
|
99
|
-
|
|
100
|
-
|
|
73
|
+
sealed interface [Screen]Event { /* navigation, snackbar */ }
|
|
74
|
+
sealed interface [Screen]Action { /* user interactions */ }
|
|
75
|
+
```
|
|
101
76
|
|
|
102
|
-
### 4
|
|
77
|
+
### 2.4: Wireframe + File List
|
|
103
78
|
|
|
104
|
-
|
|
79
|
+
ASCII wireframe + list of files to create.
|
|
105
80
|
|
|
106
|
-
###
|
|
81
|
+
### ✅ Blueprint Gate
|
|
107
82
|
|
|
108
|
-
|
|
83
|
+
```
|
|
84
|
+
"📐 Blueprint cho [Feature] xong. Anh xem OK không? → Em bắt đầu code."
|
|
85
|
+
```
|
|
109
86
|
|
|
110
|
-
|
|
87
|
+
---
|
|
111
88
|
|
|
112
|
-
|
|
89
|
+
## 🔨 Phase 3: Implementation (Zoom 3)
|
|
113
90
|
|
|
114
|
-
|
|
115
|
-
@Composable
|
|
116
|
-
fun [Screen]Screen(
|
|
117
|
-
viewModel: [Screen]ViewModel = hiltViewModel(),
|
|
118
|
-
onNavigateTo[Next]: () -> Unit
|
|
119
|
-
) {
|
|
120
|
-
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
|
|
121
|
-
// LaunchedEffect for events
|
|
122
|
-
// Scaffold with content
|
|
123
|
-
}
|
|
124
|
-
```
|
|
91
|
+
> **Output:** Full production-quality Kotlin code for THIS feature only.
|
|
125
92
|
|
|
126
|
-
###
|
|
93
|
+
### 3.1: Domain Layer
|
|
127
94
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
private val useCase: [Feature]UseCase
|
|
132
|
-
) : ViewModel() {
|
|
133
|
-
private val _uiState = MutableStateFlow([Screen]UiState())
|
|
134
|
-
val uiState = _uiState.asStateFlow()
|
|
135
|
-
|
|
136
|
-
private val _events = MutableSharedFlow<[Screen]Event>()
|
|
137
|
-
val events = _events.asSharedFlow()
|
|
138
|
-
}
|
|
95
|
+
- Models (data classes from Blueprint)
|
|
96
|
+
- Repository interfaces (from Blueprint)
|
|
97
|
+
- UseCases (implement invoke with repo calls)
|
|
139
98
|
|
|
140
|
-
|
|
141
|
-
sealed interface [Screen]Event { /* navigation, snackbar */ }
|
|
142
|
-
```
|
|
99
|
+
### 3.2: Data Layer
|
|
143
100
|
|
|
144
|
-
|
|
101
|
+
- DTOs (@Serializable)
|
|
102
|
+
- Retrofit API interface
|
|
103
|
+
- Room entities + DAOs (if applicable)
|
|
104
|
+
- Repository implementation (offline-first)
|
|
145
105
|
|
|
146
|
-
|
|
106
|
+
### 3.3: DI Module
|
|
147
107
|
|
|
148
|
-
|
|
108
|
+
- Hilt @Module with @Binds for repository
|
|
149
109
|
|
|
150
|
-
|
|
110
|
+
### 3.4: ViewModel
|
|
151
111
|
|
|
152
|
-
|
|
112
|
+
- @HiltViewModel with StateFlow + SharedFlow
|
|
113
|
+
- Implement onAction() handler from Blueprint actions
|
|
153
114
|
|
|
154
|
-
### 5
|
|
115
|
+
### 3.5: Compose Screen
|
|
155
116
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
external fun nativeMethod(param: String): ByteArray
|
|
160
|
-
}
|
|
161
|
-
```
|
|
117
|
+
- Collect state with collectAsStateWithLifecycle()
|
|
118
|
+
- UI from wireframe
|
|
119
|
+
- LaunchedEffect for events
|
|
162
120
|
|
|
163
|
-
###
|
|
121
|
+
### 3.6: Resource Extraction (On-Demand only)
|
|
164
122
|
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
override fun onCreate() { super.onCreate(); setupTimber(); setupFirebase() }
|
|
169
|
-
}
|
|
123
|
+
```bash
|
|
124
|
+
# Only resources for THIS screen
|
|
125
|
+
grep -o '@drawable/[a-z_]*' [apktool_dir]/res/layout/activity_[screen].xml | sort -u
|
|
170
126
|
```
|
|
171
127
|
|
|
172
|
-
###
|
|
128
|
+
### 🔒 Crypto Utils (Special)
|
|
173
129
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
### ✅ Checkpoint Step 5
|
|
179
|
-
|
|
180
|
-
---
|
|
130
|
+
If feature involves crypto/hashing:
|
|
131
|
+
1. Read Smali carefully (exact algorithm)
|
|
132
|
+
2. Implement in Kotlin
|
|
133
|
+
3. Unit test IMMEDIATELY with known pairs
|
|
181
134
|
|
|
182
|
-
|
|
135
|
+
> ⚠️ Crypto MUST produce identical output to original app.
|
|
183
136
|
|
|
184
|
-
###
|
|
137
|
+
### ✅ Feature Checkpoint
|
|
185
138
|
|
|
186
139
|
```markdown
|
|
187
|
-
|
|
188
|
-
- [ ] Network timeout/offline
|
|
189
|
-
- [ ] Empty list states
|
|
190
|
-
- [ ] Null server responses
|
|
191
|
-
- [ ] App lifecycle (bg/fg)
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### 6.2: API Parity
|
|
140
|
+
## ✅ Feature Complete: [Name]
|
|
195
141
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
142
|
+
### Files created: [list]
|
|
143
|
+
### Resources extracted: [only needed]
|
|
144
|
+
### Tests: [crypto verified? API matches?]
|
|
199
145
|
|
|
200
|
-
###
|
|
146
|
+
### ⏭️ Next Feature: [Name]
|
|
147
|
+
→ Return to Phase 2 (Blueprint) for next feature
|
|
148
|
+
```
|
|
201
149
|
|
|
202
|
-
|
|
203
|
-
- [ ] Date formatting matches
|
|
204
|
-
- [ ] Local storage works correctly
|
|
150
|
+
---
|
|
205
151
|
|
|
206
|
-
|
|
152
|
+
## ✅ Final Parity Check (After ALL features)
|
|
207
153
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
154
|
+
### Checklist
|
|
155
|
+
- [ ] API Parity — all endpoints match (headers, body, encoding)
|
|
156
|
+
- [ ] Data Parity — crypto/hash output identical
|
|
157
|
+
- [ ] UI Parity — screen-by-screen comparison
|
|
158
|
+
- [ ] Edge Cases — empty states, errors, offline, lifecycle
|
|
159
|
+
- [ ] Build & Test: `./gradlew assembleDebug && ./gradlew test && ./gradlew lint`
|
|
211
160
|
|
|
212
161
|
### 🎉 Final Summary
|
|
213
162
|
|
|
214
163
|
```markdown
|
|
215
|
-
## Complete!
|
|
216
|
-
- Screens: [count] |
|
|
164
|
+
## ✅ Reverse Engineering Complete!
|
|
165
|
+
- Screens: [count] | Features: [count]
|
|
166
|
+
- Libs reused: [count] | Replaced: [count]
|
|
217
167
|
- Tests: [pass/fail] | Lint: [pass/warnings]
|
|
218
168
|
|
|
219
169
|
⏭️ Next: /test → /deploy → /code-janitor
|
|
@@ -224,9 +174,9 @@ class App : Application() {
|
|
|
224
174
|
## 🔗 Related
|
|
225
175
|
|
|
226
176
|
- **Parent:** [`/reverse-android`](reverse-android.md)
|
|
227
|
-
- **Previous:** [`/re-android-
|
|
228
|
-
- **
|
|
177
|
+
- **Previous:** [`/re-android-design`](reverse-android-design.md) (Phase 1)
|
|
178
|
+
- **Skill:** `smali-to-kotlin` → `phase-2-blueprint.md` + `phase-3-build.md`
|
|
229
179
|
|
|
230
180
|
---
|
|
231
181
|
|
|
232
|
-
*re-android-build
|
|
182
|
+
*re-android-build v3.0.0 — Phase 2+3: Blueprint & Build*
|
|
@@ -0,0 +1,136 @@
|
|
|
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
|
|
88
|
+
|
|
89
|
+
| # | Phase | Scope | Complexity |
|
|
90
|
+
|---|-------|-------|-----------|
|
|
91
|
+
| 1 | 🟢 Setup | Project + DI + Theme | Low |
|
|
92
|
+
| 2 | 🟢 Models | Domain data classes | Low |
|
|
93
|
+
| 3 | 🟡 Data | API + Room + DataStore | Medium |
|
|
94
|
+
| 4 | 🟡 Utils | Crypto, formatters | Medium |
|
|
95
|
+
| 5 | 🔴 Features | Per-feature Blueprint→Build | High |
|
|
96
|
+
| N | 🔴 Final | Parity check | High |
|
|
97
|
+
|
|
98
|
+
## 🔧 Step 7: Tech Stack Confirmation
|
|
99
|
+
|
|
100
|
+
| Decision | Choice | Rationale |
|
|
101
|
+
|----------|--------|-----------|
|
|
102
|
+
| UI | Jetpack Compose + M3 | Modern |
|
|
103
|
+
| DI | Hilt | Standard |
|
|
104
|
+
| ... | ... | ... |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 📊 Output: Architecture Blueprint
|
|
109
|
+
|
|
110
|
+
Sử dụng template từ `skills/smali-to-kotlin/templates/architecture.md`.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## ✅ Gate: Chuyển sang Phase 2
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
"🏗️ Architecture Blueprint xong!
|
|
118
|
+
Anh muốn bắt đầu từ feature nào?
|
|
119
|
+
Em suggest: [Feature X] vì [reason]."
|
|
120
|
+
|
|
121
|
+
→ User picks feature → /re-android-build (Phase 2: Blueprint for that feature)
|
|
122
|
+
→ User wants changes → adjust architecture
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 🔗 Related
|
|
128
|
+
|
|
129
|
+
- **Previous:** [`/re-android-discover`](reverse-android-discover.md) (Phase 0)
|
|
130
|
+
- **Next:** [`/re-android-build`](reverse-android-build.md) (Phase 2+3)
|
|
131
|
+
- **Parent:** [`/reverse-android`](reverse-android.md)
|
|
132
|
+
- **Skill:** `skills/smali-to-kotlin/phase-1-architecture.md`
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
*re-android-design v3.0.0 — Phase 1: Architecture Blueprint*
|
|
@@ -0,0 +1,150 @@
|
|
|
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*
|