@leejungkiin/awkit 1.0.7 → 1.0.8
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/core/GEMINI.md.bak +168 -181
- package/package.json +2 -2
- package/schemas/brain-snapshot.json +167 -0
- package/skills/CATALOG.md +70 -0
- package/skills/beads-manager/SKILL.md +20 -1
- package/skills/memory-sync/SKILL.md +20 -2
- package/skills/nm-memory-audit/SKILL.md +157 -0
- package/skills/nm-memory-evolution/SKILL.md +202 -0
- package/skills/nm-memory-intake/SKILL.md +135 -0
- package/skills/nm-memory-sync/SKILL.md +184 -0
- package/skills/orchestrator/SKILL.md +41 -50
- package/skills/schemas/brain-snapshot.json +167 -0
- package/skills/skills/nm-memory-audit/SKILL.md +157 -0
- package/skills/skills/nm-memory-evolution/SKILL.md +202 -0
- package/skills/skills/nm-memory-intake/SKILL.md +135 -0
- package/skills/skills/nm-memory-sync/SKILL.md +184 -0
- package/skills/smali-to-kotlin/SKILL.md +331 -85
- package/skills/smali-to-kotlin/phase-0-discovery.md +93 -94
- package/skills/smali-to-kotlin/phase-1-architecture.md +67 -58
- package/skills/smali-to-kotlin/phase-2-blueprint.md +228 -0
- package/skills/smali-to-kotlin/phase-3-build.md +248 -0
- package/skills/smali-to-kotlin/templates/app-map.md +101 -0
- package/skills/smali-to-kotlin/templates/architecture.md +142 -0
- package/skills/smali-to-kotlin/templates/blueprint.md +145 -0
- package/skills/smali-to-swift/SKILL.md +532 -91
- package/skills/smali-to-swift/phase-0-discovery.md +101 -118
- package/skills/smali-to-swift/phase-1-architecture.md +62 -67
- package/skills/smali-to-swift/phase-2-blueprint.md +173 -0
- package/skills/smali-to-swift/phase-3-build.md +257 -0
- package/skills/smali-to-swift/templates/app-map.md +82 -0
- package/skills/smali-to-swift/templates/architecture.md +97 -0
- package/skills/smali-to-swift/templates/blueprint.md +82 -0
- package/skills/workflows/nm-import.md +73 -0
- package/skills/workflows/nm-recall.md +67 -0
- package/skills/workflows/nm-snapshot.md +69 -0
- package/workflows/_uncategorized/nm-import.md +73 -0
- package/workflows/_uncategorized/nm-recall.md +67 -0
- package/workflows/_uncategorized/nm-snapshot.md +69 -0
- package/workflows/_uncategorized/reverse-android-build.md +222 -0
- package/workflows/_uncategorized/reverse-android-design.md +139 -0
- package/workflows/_uncategorized/reverse-android-discover.md +150 -0
- package/workflows/_uncategorized/reverse-android-scan.md +158 -0
- package/workflows/_uncategorized/reverse-android.md +143 -0
- package/workflows/_uncategorized/reverse-ios-build.md +240 -0
- package/workflows/_uncategorized/reverse-ios-design.md +112 -0
- package/workflows/_uncategorized/reverse-ios-discover.md +120 -0
- package/workflows/_uncategorized/reverse-ios-scan.md +155 -0
- package/workflows/_uncategorized/reverse-ios.md +152 -0
- package/skills/adaptive-language/SKILL.md +0 -189
- package/skills/ambient-brain/SKILL.md +0 -314
- package/skills/ambient-brain/brain-router.md +0 -185
- package/skills/ambient-brain/brain-templates.md +0 -201
- package/skills/context-help/SKILL.md +0 -180
- package/skills/error-translator/SKILL.md +0 -153
- package/skills/session-restore/SKILL.md +0 -240
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 🏗️ RE iOS Phase 1 — Architecture Design (NO CODE BODIES)
|
|
3
|
+
parent: reverse-ios
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /re-ios-design — Architecture Blueprint
|
|
7
|
+
|
|
8
|
+
> **Parent:** [`/reverse-ios`](reverse-ios.md) → Phase 1
|
|
9
|
+
> **Prerequisite:** Completed App Map from [`/re-ios-discover`](reverse-ios-discover.md)
|
|
10
|
+
> **Skill:** `smali-to-swift` → `phase-1-architecture.md`
|
|
11
|
+
> **Zoom Level:** 1 — District View
|
|
12
|
+
> **Output:** Architecture Blueprint (NO CODE BODIES)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## ⛔ ZOOM 1 RULE
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
NO CODE BODIES. Only architecture diagrams, file paths, tables, SPM declarations.
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 📐 Architecture Steps
|
|
25
|
+
|
|
26
|
+
### Step 1: Layer Design
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
┌────────────────────────────────┐
|
|
30
|
+
│ Presentation (SwiftUI) │
|
|
31
|
+
├────────────────────────────────┤
|
|
32
|
+
│ Domain (Models, Protocols, UC) │
|
|
33
|
+
├────────────────────────────────┤
|
|
34
|
+
│ Data (Network, Local, Repos) │
|
|
35
|
+
├────────────────────────────────┤
|
|
36
|
+
│ DI (AppContainer) │
|
|
37
|
+
└────────────────────────────────┘
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Step 2: Feature → File Mapping
|
|
41
|
+
|
|
42
|
+
| Feature | Model | Repository | UseCase | Screen | ViewModel |
|
|
43
|
+
|---------|-------|-----------|---------|--------|-----------|
|
|
44
|
+
|
|
45
|
+
### Step 3: API Inventory
|
|
46
|
+
|
|
47
|
+
| # | Method | Endpoint | Auth | Notes |
|
|
48
|
+
|---|--------|----------|------|-------|
|
|
49
|
+
|
|
50
|
+
### Step 4: Data Schema
|
|
51
|
+
|
|
52
|
+
| Model | Key Fields | Source | Storage |
|
|
53
|
+
|-------|-----------|--------|---------|
|
|
54
|
+
|
|
55
|
+
### Step 5: Xcode Structure
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
App/
|
|
59
|
+
├── App.swift
|
|
60
|
+
├── DI/
|
|
61
|
+
├── Data/Network/ + Local/ + Repositories/
|
|
62
|
+
├── Domain/Models/ + Repositories/ + UseCases/
|
|
63
|
+
├── Presentation/Navigation/ + Screens/ + Theme/
|
|
64
|
+
├── Utilities/
|
|
65
|
+
└── Resources/
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Step 6: Build Order (UI-First) ⭐
|
|
69
|
+
|
|
70
|
+
| # | Phase | Scope | Complexity |
|
|
71
|
+
|---|-------|-------|-----------|
|
|
72
|
+
| 1 | 🟢 Foundation | Xcode project + DI skeleton + Theme | Low |
|
|
73
|
+
| 2 | 🟢 Navigation | NavigationStack, TabView, routes | Low |
|
|
74
|
+
| 3 | 🔵 Per Feature | Blueprint (contracts) + UI Shell (visual) | Medium |
|
|
75
|
+
| 4 | 🚦 UI Gate | User approves UI before logic | — |
|
|
76
|
+
| 5 | 🟡 Per Feature | Logic Build (Domain → Data → VM → Wire UI) | High |
|
|
77
|
+
| 6 | 📦 SDKs | Third-party SDK + Native libs integration | Medium |
|
|
78
|
+
| N | 🔴 Final | Full Parity Check | High |
|
|
79
|
+
|
|
80
|
+
> **UI-First:** Design and approve UI before coding logic for each feature.
|
|
81
|
+
|
|
82
|
+
### Step 7: Tech Decisions
|
|
83
|
+
|
|
84
|
+
| Decision | Choice | Rationale |
|
|
85
|
+
|----------|--------|-----------|
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 📊 Output
|
|
90
|
+
|
|
91
|
+
Template: `skills/smali-to-swift/templates/architecture.md`
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## ✅ Gate
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
"🏗️ Architecture xong! Anh chọn feature nào làm trước?"
|
|
99
|
+
→ /re-ios-build (Phase 2: Blueprint)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 🔗 Related
|
|
105
|
+
|
|
106
|
+
- **Previous:** [`/re-ios-discover`](reverse-ios-discover.md)
|
|
107
|
+
- **Next:** [`/re-ios-build`](reverse-ios-build.md)
|
|
108
|
+
- **Parent:** [`/reverse-ios`](reverse-ios.md)
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
*re-ios-design v3.0.0 — Phase 1: Architecture Blueprint*
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 🗺️ RE iOS Phase 0 — Discovery & App Map (NO CODE output)
|
|
3
|
+
parent: reverse-ios
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /re-ios-discover — Discovery & App Map
|
|
7
|
+
|
|
8
|
+
> **Parent:** [`/reverse-ios`](reverse-ios.md) → Phase 0
|
|
9
|
+
> **Skill:** `smali-to-swift` → `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 Swift code → STOP → wrong zoom level.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 📦 Step 0: Framework Scanner
|
|
26
|
+
|
|
27
|
+
### 0.1: Quét IPA structure
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Embedded frameworks
|
|
31
|
+
ls [app_bundle]/Frameworks/ 2>/dev/null
|
|
32
|
+
|
|
33
|
+
# Non-system linked libs
|
|
34
|
+
otool -L [app_bundle]/[AppName] | grep -v /System | grep -v /usr/lib
|
|
35
|
+
|
|
36
|
+
# Header imports
|
|
37
|
+
grep -rh "#import <" [headers_dir]/ | sort -u | head -30
|
|
38
|
+
grep -rh "@import " [headers_dir]/ | sort -u
|
|
39
|
+
|
|
40
|
+
# VC count
|
|
41
|
+
grep -rl "UIViewController" [headers_dir]/ | wc -l
|
|
42
|
+
|
|
43
|
+
# Resources
|
|
44
|
+
ls [app_bundle]/*.car [app_bundle]/*.momd [app_bundle]/*.storyboardc 2>/dev/null
|
|
45
|
+
find [app_bundle] -name "*.json" -o -name "*.plist" | grep -v Info.plist | sort
|
|
46
|
+
|
|
47
|
+
# SDK markers
|
|
48
|
+
strings [app_bundle]/[AppName] | grep -i "cocoapods\|carthage\|firebase\|facebook" | head -20
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 0.2: Phân loại frameworks
|
|
52
|
+
|
|
53
|
+
| Category | Action |
|
|
54
|
+
|----------|--------|
|
|
55
|
+
| ✅ Reuse | Add via SPM |
|
|
56
|
+
| 🔄 Replace | Map to modern Swift |
|
|
57
|
+
| 🍏 Apple | Use SwiftUI equivalents |
|
|
58
|
+
| 📱 Native | Keep, bridging header |
|
|
59
|
+
| 🏷️ App Code | Rebuild in Swift |
|
|
60
|
+
|
|
61
|
+
### 0.3: User approval
|
|
62
|
+
|
|
63
|
+
> **GATE:** Framework Report → User approve.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 📄 Step 1: Info.plist & Entitlements
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
plutil -p [app_bundle]/Info.plist
|
|
71
|
+
codesign -d --entitlements :- [app_bundle]/[AppName] 2>/dev/null
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 1.1: Trích xuất
|
|
75
|
+
|
|
76
|
+
- Bundle ID, Display Name, Min iOS
|
|
77
|
+
- Privacy permissions (NSCameraUsageDescription, etc.)
|
|
78
|
+
- URL Schemes, Universal Links
|
|
79
|
+
- Capabilities (push, Apple Pay, Sign In with Apple)
|
|
80
|
+
|
|
81
|
+
### 1.2: Screen Map
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
grep -rl "UIViewController" [headers_dir]/ | sort
|
|
85
|
+
grep -rl "UITabBarController" [headers_dir]/
|
|
86
|
+
grep -rl "UINavigationController" [headers_dir]/
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Mapping VCs → SwiftUI screens + navigation flow.
|
|
90
|
+
|
|
91
|
+
### 1.3: Complexity Estimate
|
|
92
|
+
|
|
93
|
+
| Area | Rating | Notes |
|
|
94
|
+
|------|--------|-------|
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 📊 Output: App Map
|
|
99
|
+
|
|
100
|
+
Template: `skills/smali-to-swift/templates/app-map.md`
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## ✅ Gate
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
"🗺️ App Map xong! Anh review → OK → Phase 1 (Architecture)."
|
|
108
|
+
→ /re-ios-design
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 🔗 Related
|
|
114
|
+
|
|
115
|
+
- **Next:** [`/re-ios-design`](reverse-ios-design.md)
|
|
116
|
+
- **Parent:** [`/reverse-ios`](reverse-ios.md)
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
*re-ios-discover v3.0.0 — Phase 0: Discovery & App Map*
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 📦 RE iOS Phase 1 — Framework Scanner + Info.plist Analysis + Project Bootstrap
|
|
3
|
+
parent: reverse-ios
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /re-ios-scan — Framework Scanner & Plist Analysis
|
|
7
|
+
|
|
8
|
+
> **Parent:** [`/reverse-ios`](reverse-ios.md) → Step 0 + Step 1
|
|
9
|
+
> **Skill:** `smali-to-swift` | **Reference:** `skills/smali-to-swift/framework-patterns.md`
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 📦 Step 0: Framework Scanner (BẮT BUỘC)
|
|
14
|
+
|
|
15
|
+
> Nhận diện toàn bộ frameworks **trước khi code bất kỳ thứ gì**.
|
|
16
|
+
|
|
17
|
+
### 0.3: Quét IPA structure
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Embedded frameworks
|
|
21
|
+
ls [app_bundle]/Frameworks/
|
|
22
|
+
|
|
23
|
+
# Linked libraries (Mach-O)
|
|
24
|
+
otool -L [app_bundle]/App | grep -v /System | grep -v /usr/lib
|
|
25
|
+
|
|
26
|
+
# Header imports
|
|
27
|
+
grep -rh "#import <" [headers_dir]/ | sort -u
|
|
28
|
+
grep -rh "@import " [headers_dir]/ | sort -u
|
|
29
|
+
|
|
30
|
+
# SDK identifiers
|
|
31
|
+
strings [app_bundle]/App | grep -i "cocoapods\|carthage\|firebase\|facebook\|google"
|
|
32
|
+
|
|
33
|
+
# Assets & resources
|
|
34
|
+
ls [app_bundle]/*.car [app_bundle]/*.momd [app_bundle]/*.storyboardc 2>/dev/null
|
|
35
|
+
find [app_bundle] -name "*.json" -o -name "*.plist" | grep -v Info.plist | sort
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 0.4: Tạo Framework Detection Report
|
|
39
|
+
|
|
40
|
+
Dùng patterns từ `framework-patterns.md`:
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
## 📦 Framework Detection Report — [App Name]
|
|
44
|
+
|
|
45
|
+
### ✅ Reuse (Add via SPM)
|
|
46
|
+
| Framework | Detected | Version | Notes |
|
|
47
|
+
|-----------|----------|---------|-------|
|
|
48
|
+
|
|
49
|
+
### 🔄 Replace (Legacy → Modern Swift)
|
|
50
|
+
| Old Framework | Detected | Replacement |
|
|
51
|
+
|---------------|----------|-------------|
|
|
52
|
+
| AFNetworking | Frameworks/ | URLSession async/await |
|
|
53
|
+
| SDWebImage | imports | AsyncImage + Kingfisher |
|
|
54
|
+
| SnapKit | imports | SwiftUI layout |
|
|
55
|
+
|
|
56
|
+
### 🍏 Apple Frameworks
|
|
57
|
+
| Framework | Purpose | SwiftUI Equivalent |
|
|
58
|
+
|-----------|---------|-------------------|
|
|
59
|
+
| MapKit | Maps | Map (SwiftUI) |
|
|
60
|
+
| CoreData | Database | SwiftData |
|
|
61
|
+
|
|
62
|
+
### 📱 Native Libraries
|
|
63
|
+
| File | Notes |
|
|
64
|
+
|------|-------|
|
|
65
|
+
|
|
66
|
+
### 🏷️ App Code (Rewrite in Swift)
|
|
67
|
+
| Class Prefix | Module |
|
|
68
|
+
|-------------|--------|
|
|
69
|
+
|
|
70
|
+
### ❓ Unknown
|
|
71
|
+
| Framework | Notes |
|
|
72
|
+
|-----------|-------|
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 0.5: User approval
|
|
76
|
+
|
|
77
|
+
> **GATE:** Không tiếp tục khi chưa có user approval.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 📄 Step 1: Info.plist & Entitlements + Project Bootstrap
|
|
82
|
+
|
|
83
|
+
> **Input:** `[app_bundle]/Info.plist` + entitlements
|
|
84
|
+
|
|
85
|
+
### 1.1: Đọc Info.plist
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
plutil -p [app_bundle]/Info.plist
|
|
89
|
+
codesign -d --entitlements :- [app_bundle]/App 2>/dev/null
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Trích xuất:
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
extract:
|
|
96
|
+
- bundle_id, display_name, min_ios_version
|
|
97
|
+
- permissions: [camera, photos, location, microphone, notifications, tracking]
|
|
98
|
+
- url_schemes, universal_links
|
|
99
|
+
- capabilities: [push, apple_pay, sign_in_apple, app_groups]
|
|
100
|
+
- supported_orientations
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 1.2: Phân tích class hierarchy
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
grep -rl "UIViewController" [headers_dir]/ | sort
|
|
107
|
+
grep -rl "UITabBarController" [headers_dir]/
|
|
108
|
+
grep -rl "UINavigationController" [headers_dir]/
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Mapping VCs → SwiftUI:
|
|
112
|
+
```
|
|
113
|
+
SplashViewController → SplashScreen.swift
|
|
114
|
+
LoginViewController → Auth/LoginScreen.swift
|
|
115
|
+
MainTabBarController → TabView in ContentView.swift
|
|
116
|
+
HomeViewController → Home/HomeScreen.swift
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### 1.3: Xcode project structure
|
|
120
|
+
|
|
121
|
+
Đề xuất Clean Architecture structure (xem SKILL.md Step 1).
|
|
122
|
+
|
|
123
|
+
### 1.4: SPM Dependencies (từ Framework Report)
|
|
124
|
+
|
|
125
|
+
```swift
|
|
126
|
+
// Firebase: firebase/firebase-ios-sdk 11.0+
|
|
127
|
+
// Kingfisher: onevcat/Kingfisher 7.12+
|
|
128
|
+
// KeychainAccess: kishikawakatsumi/KeychainAccess 4.2+
|
|
129
|
+
// Lottie: airbnb/lottie-ios 4.4+
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### ✅ Checkpoint Step 1
|
|
133
|
+
|
|
134
|
+
```markdown
|
|
135
|
+
## ✅ Step 1 Complete
|
|
136
|
+
|
|
137
|
+
- Bundle ID: [bundle_id]
|
|
138
|
+
- Permissions: [count] | Screens: [count]
|
|
139
|
+
- URL Schemes: [list]
|
|
140
|
+
|
|
141
|
+
⏭️ Next: `/re-ios-build` — Step 2 (Data Layer)
|
|
142
|
+
Cung cấp headers: *Service, *Manager, *Client, *API, *Model
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 🔗 Related
|
|
148
|
+
|
|
149
|
+
- **Next:** [`/re-ios-build`](reverse-ios-build.md) (Step 2-6)
|
|
150
|
+
- **Parent:** [`/reverse-ios`](reverse-ios.md)
|
|
151
|
+
- **Framework patterns:** `skills/smali-to-swift/framework-patterns.md`
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
*re-ios-scan v2.0.0 — Phase 1: Discovery & Bootstrap*
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 🍎 Dịch ngược IPA iOS (class-dump, Hopper output) → App Swift hiện đại với SwiftUI, Clean Architecture, và UI-First methodology.
|
|
3
|
+
skill: smali-to-swift
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /reverse-ios — iOS IPA Reverse Engineering Workflow
|
|
7
|
+
|
|
8
|
+
> **Skill:** `smali-to-swift` v2.0 | **Tech:** Swift + SwiftUI + async/await + URLSession + SwiftData
|
|
9
|
+
> **Philosophy:** "Map → Blueprint → UI First → Logic Behind"
|
|
10
|
+
> **Key:** UI is designed and approved BEFORE coding any business logic.
|
|
11
|
+
> **Sibling:** `/reverse-android`
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## ⚡ QUICK START
|
|
16
|
+
|
|
17
|
+
User cung cấp: Decrypted `.app` bundle, class-dump headers, Hopper pseudo-code, hoặc nói "reverse engineer IPA này".
|
|
18
|
+
Workflow dẫn dắt qua **5 phases** — UI-First approach, **không bao giờ nhảy cóc**.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 🔵 Session Setup
|
|
23
|
+
|
|
24
|
+
### Bước 0.1: Khởi tạo session state
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
reverse_ios_session:
|
|
28
|
+
project_name: "[TBD - từ Info.plist]"
|
|
29
|
+
app_bundle_dir: "[path]"
|
|
30
|
+
headers_dir: "[class-dump output]"
|
|
31
|
+
current_phase: 0
|
|
32
|
+
current_feature: null
|
|
33
|
+
phase_2_status:
|
|
34
|
+
contracts: pending
|
|
35
|
+
ui_shell: pending
|
|
36
|
+
resources: pending
|
|
37
|
+
completed_features: []
|
|
38
|
+
pending_features: []
|
|
39
|
+
decisions: []
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Bước 0.2: Xác nhận input
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
🍎 iOS Reverse Engineering v2.0 — UI-First Pipeline
|
|
46
|
+
|
|
47
|
+
Em cần biết:
|
|
48
|
+
1. Decrypted .app bundle ở đâu?
|
|
49
|
+
2. Class-dump headers ở đâu?
|
|
50
|
+
3. Tên app gốc? Bundle ID?
|
|
51
|
+
|
|
52
|
+
Chưa chuẩn bị?
|
|
53
|
+
→ bagbak -o ~/decrypted/ com.example.app
|
|
54
|
+
→ class-dump -H ~/decrypted/App.app -o ~/headers/
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 📋 Pipeline Overview (5 Phases — UI-First)
|
|
60
|
+
|
|
61
|
+
| Phase | Name | Sub-workflow | Code? | Gate |
|
|
62
|
+
|-------|------|-------------|-------|------|
|
|
63
|
+
| 0 | 🗺️ Discovery | [`/re-ios-discover`](reverse-ios-discover.md) | ❌ | User approves Map |
|
|
64
|
+
| 1 | 🏗️ Architecture | [`/re-ios-design`](reverse-ios-design.md) | ❌ | User approves Architecture |
|
|
65
|
+
| 2 | 📐🎨 Blueprint + UI | [`/re-ios-build`](reverse-ios-build.md) | UI code | User approves UI + Contracts |
|
|
66
|
+
| 3 | 🔨 Logic Build | [`/re-ios-build`](reverse-ios-build.md) | Full logic | Feature checkpoint |
|
|
67
|
+
| 4 | ✅ Final Parity | [`/re-ios-build`](reverse-ios-build.md) | — | Final check |
|
|
68
|
+
|
|
69
|
+
### Execution Flow
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
Session Setup
|
|
73
|
+
↓
|
|
74
|
+
Phase 0: Discovery (/re-ios-discover) → App Map
|
|
75
|
+
↓ [User approves]
|
|
76
|
+
Phase 1: Architecture (/re-ios-design) → Architecture Blueprint
|
|
77
|
+
↓ [User approves + picks feature]
|
|
78
|
+
Feature Loop (/re-ios-build):
|
|
79
|
+
Phase 2: Blueprint + UI (contracts + visual shell + resources)
|
|
80
|
+
↓ 🚦 GATE: User approves UI + contracts
|
|
81
|
+
Phase 3: Logic Build (domain → data → DI → VM → wire UI)
|
|
82
|
+
↓ 📊 CHECKPOINT: Feature done
|
|
83
|
+
→ Repeat for next feature
|
|
84
|
+
↓
|
|
85
|
+
Phase 4: Final Parity Check & Quality Gate
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 🔭 ZOOM CONTROL
|
|
91
|
+
|
|
92
|
+
```yaml
|
|
93
|
+
pre_output_check:
|
|
94
|
+
- "Đang ở phase nào?"
|
|
95
|
+
- "Output có đúng phase rule không?"
|
|
96
|
+
- "Phase 0/1: NO CODE BODIES"
|
|
97
|
+
- "Phase 2: UI code + signatures (no logic bodies)"
|
|
98
|
+
- "Phase 3: Full implementation code"
|
|
99
|
+
|
|
100
|
+
phase_rules:
|
|
101
|
+
phase_0: "NO CODE. Only diagrams, tables, maps."
|
|
102
|
+
phase_1: "NO CODE BODIES. Only architecture, file lists."
|
|
103
|
+
phase_2_contracts: "SIGNATURES ONLY. Protocols, structs, enums."
|
|
104
|
+
phase_2_ui: "FULL UI CODE. SwiftUI with hardcoded mock data + #Preview."
|
|
105
|
+
phase_3: "FULL LOGIC CODE. Domain → Data → DI → VM → Wire UI."
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 🚫 WORKFLOW RULES
|
|
111
|
+
|
|
112
|
+
```yaml
|
|
113
|
+
never_skip:
|
|
114
|
+
- Phase 0 (Discovery) — always first
|
|
115
|
+
- Phase 1 (Architecture) — design before coding
|
|
116
|
+
- Phase 2 UI Gate — user MUST approve UI before Phase 3
|
|
117
|
+
- Per-feature Blueprint before Logic Build
|
|
118
|
+
|
|
119
|
+
never_do:
|
|
120
|
+
- Write logic code before UI is approved
|
|
121
|
+
- Mass-copy assets from IPA (on-demand only)
|
|
122
|
+
- Use UIKit when SwiftUI equivalent exists
|
|
123
|
+
- Use GCD for new async code (use async/await)
|
|
124
|
+
- Use ObjC in new code (Swift only)
|
|
125
|
+
- Modify UI significantly in Phase 3 (only wire, don't redesign)
|
|
126
|
+
- Implement multiple features simultaneously
|
|
127
|
+
|
|
128
|
+
always_do:
|
|
129
|
+
- Extract resources BEFORE coding UI (Phase 2.7 → 2.8)
|
|
130
|
+
- Create #Preview for ALL states
|
|
131
|
+
- Keep stateless View (LoginScreenContent) after wiring
|
|
132
|
+
- XCTest all crypto/hash functions
|
|
133
|
+
- Use @Observable for ViewModels
|
|
134
|
+
- Use NavigationStack, SPM
|
|
135
|
+
- Checkpoint after each feature
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 🔗 Related
|
|
141
|
+
|
|
142
|
+
- **Sub-workflows:**
|
|
143
|
+
- [`/re-ios-discover`](reverse-ios-discover.md) — Phase 0: Discovery
|
|
144
|
+
- [`/re-ios-design`](reverse-ios-design.md) — Phase 1: Architecture
|
|
145
|
+
- [`/re-ios-build`](reverse-ios-build.md) — Phase 2+3+4: Blueprint + UI + Build
|
|
146
|
+
- **Skill:** `smali-to-swift` v2.0 (UI-First pipeline)
|
|
147
|
+
- **Sibling:** `/reverse-android`
|
|
148
|
+
- **After RE done:** `/test`, `/deploy`, `/code-janitor`
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
*reverse-ios workflow v4.0.0 — UI-First RE Pipeline*
|