@leejungkiin/awkit 1.5.2 → 1.5.4

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.
Files changed (64) hide show
  1. package/bin/awk.js +141 -141
  2. package/core/GEMINI.md +1 -0
  3. package/package.json +1 -1
  4. package/skill-packs/ads-management/pack.json +8 -0
  5. package/skill-packs/mobile-android/pack.json +2 -6
  6. package/skill-packs/neural-memory/pack.json +2 -2
  7. package/skill-packs/reverse-engineering/pack.json +9 -0
  8. package/workflows/mobile/reverse-android-build.md +0 -222
  9. package/workflows/mobile/reverse-android-design.md +0 -139
  10. package/workflows/mobile/reverse-android-discover.md +0 -150
  11. package/workflows/mobile/reverse-android.md +0 -143
  12. package/workflows/mobile/reverse-ios-build.md +0 -240
  13. package/workflows/mobile/reverse-ios-design.md +0 -112
  14. package/workflows/mobile/reverse-ios-discover.md +0 -120
  15. package/workflows/mobile/reverse-ios.md +0 -152
  16. /package/{skills → skill-packs/ads-management/skills}/admob-roas/SKILL.md +0 -0
  17. /package/{workflows/ads → skill-packs/ads-management/workflows}/ads-analyst.md +0 -0
  18. /package/{workflows/ads → skill-packs/ads-management/workflows}/ads-audit.md +0 -0
  19. /package/{workflows/_uncategorized → skill-packs/ads-management/workflows}/ads-creative.md +0 -0
  20. /package/{workflows/_uncategorized → skill-packs/ads-management/workflows}/ads-full-optimization.md +0 -0
  21. /package/{workflows/ads → skill-packs/ads-management/workflows}/ads-optimize.md +0 -0
  22. /package/{workflows/_uncategorized → skill-packs/ads-management/workflows}/ads-plan.md +0 -0
  23. /package/{workflows/ads → skill-packs/ads-management/workflows}/ads-targeting.md +0 -0
  24. /package/{workflows/_uncategorized → skill-packs/ads-management/workflows}/ads-user-analysis.md +0 -0
  25. /package/{workflows/ads → skill-packs/ads-management/workflows}/adsExpert.md +0 -0
  26. /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/SKILL.md +0 -0
  27. /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/references/api-extraction-patterns.md +0 -0
  28. /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/references/call-flow-analysis.md +0 -0
  29. /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/references/fernflower-usage.md +0 -0
  30. /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/references/jadx-usage.md +0 -0
  31. /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/references/setup-guide.md +0 -0
  32. /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/scripts/check-deps.sh +0 -0
  33. /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/scripts/decompile.sh +0 -0
  34. /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/scripts/find-api-calls.sh +0 -0
  35. /package/{skills → skill-packs/reverse-engineering/skills}/android-re-analyzer/scripts/install-dep.sh +0 -0
  36. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/SKILL.md +0 -0
  37. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/examples/getting-started/tech-stack.md +0 -0
  38. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/examples/pipeline/data-ui-parity.md +0 -0
  39. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/examples/pipeline/scanner-and-bootstrap.md +0 -0
  40. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/library-patterns.md +0 -0
  41. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/phase-0-discovery.md +0 -0
  42. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/phase-1-architecture.md +0 -0
  43. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/phase-2-blueprint-ui.md +0 -0
  44. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/phase-2-blueprint.md +0 -0
  45. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/phase-3-build.md +0 -0
  46. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/phase-3-logic-build.md +0 -0
  47. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/smali-reading-guide.md +0 -0
  48. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/templates/app-map.md +0 -0
  49. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/templates/architecture.md +0 -0
  50. /package/{skills → skill-packs/reverse-engineering/skills}/smali-to-kotlin/templates/blueprint.md +0 -0
  51. /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-android-build.md +0 -0
  52. /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-android-design.md +0 -0
  53. /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-android-discover.md +0 -0
  54. /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-android-scan.md +0 -0
  55. /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-android.md +0 -0
  56. /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-ios-build.md +0 -0
  57. /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-ios-design.md +0 -0
  58. /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-ios-discover.md +0 -0
  59. /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-ios-scan.md +0 -0
  60. /package/{workflows/_uncategorized → skill-packs/reverse-engineering/workflows}/reverse-ios.md +0 -0
  61. /package/{workflows/ads → skill-packs/reverse-engineering/workflows}/smali-ads-config.md +0 -0
  62. /package/{workflows/ads → skill-packs/reverse-engineering/workflows}/smali-ads-flow.md +0 -0
  63. /package/{workflows/ads → skill-packs/reverse-engineering/workflows}/smali-ads-interstitial.md +0 -0
  64. /package/{workflows/ads → skill-packs/reverse-engineering/workflows}/smali-ads-native.md +0 -0
@@ -1,240 +0,0 @@
1
- ---
2
- description: 🔨 RE iOS Phase 2+3+4 — Blueprint + UI Shell → Logic Build → Final Parity (UI-First)
3
- parent: reverse-ios
4
- ---
5
-
6
- # /re-ios-build — Blueprint + UI + Build (Per Feature)
7
-
8
- > **Parent:** [`/reverse-ios`](reverse-ios.md) → Phase 2+3+4
9
- > **Prerequisite:** Completed Architecture from [`/re-ios-design`](reverse-ios-design.md)
10
- > **Skill:** `smali-to-swift` → `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 SwiftUI shell with mock data.
30
-
31
- ### Part A: Contracts (signatures only)
32
-
33
- #### 2.1: Deep Header Reading
34
- Read class-dump headers + Hopper pseudo-code. See `objc-reading-guide.md`.
35
-
36
- **ObjC → Swift Quick Ref:**
37
- ```
38
- @property (copy) NSString *name → let name: String
39
- @property (assign) BOOL active → let active: Bool
40
- - (void)fetchWith:(block)completion → func fetch() async throws -> T
41
- + (instancetype)sharedInstance → static let shared
42
- ```
43
-
44
- #### 2.2–2.5: Define Contracts
45
- ```swift
46
- // 2.2 Domain Model
47
- struct [Model]: Codable, Identifiable, Sendable {
48
- let field: Type
49
- }
50
-
51
- // 2.3 Repository Protocol
52
- protocol [Feature]Repository: Sendable {
53
- func [method](...) async throws -> [Type]
54
- }
55
-
56
- // 2.4 API Endpoint
57
- enum [Feature]Endpoint {
58
- case [action](param: Type)
59
- var path: String { /* ... */ }
60
- }
61
-
62
- // 2.5 UseCase
63
- struct [Action]UseCase {
64
- func execute(...) async throws -> [Type] // TODO
65
- }
66
- ```
67
-
68
- #### 2.6: UI State Design
69
- ```swift
70
- struct [Screen]ViewState {
71
- var field: Type = default
72
- var isLoading: Bool = false
73
- var error: String? = nil
74
- }
75
- enum [Screen]Action { /* user interactions */ }
76
- enum [Screen]Event { /* navigation, alerts */ }
77
-
78
- extension [Screen]ViewState {
79
- static let normal = [Screen]ViewState(/* sample */)
80
- static let loading = [Screen]ViewState(isLoading: true)
81
- static let error = [Screen]ViewState(error: "Error message")
82
- }
83
- ```
84
-
85
- ### Part B: UI Visual Shell
86
-
87
- #### 2.7: Resource Extraction ⭐ (BEFORE UI code!)
88
-
89
- Extract from IPA bundle / Assets.car:
90
- - Images → Assets.xcassets
91
- - Colors → Color extension or asset catalog
92
- - Strings → Localizable.xcstrings
93
- - Fonts → custom fonts
94
-
95
- Copy ONLY needed resources. Verify they build.
96
-
97
- #### 2.8: UI Implementation ⭐ (Visual shell with mock data)
98
-
99
- - Use ViewState from 2.6 with hardcoded defaults
100
- - Use REAL resources from 2.7
101
- - Create `[Screen]Content` view (stateless)
102
- - Match visual parity with original app
103
- - NO ViewModel connection, NO real API calls
104
-
105
- ```swift
106
- struct [Screen]Content: View {
107
- var state: [Screen]ViewState = .normal // Mock
108
- var onAction: ([Screen]Action) -> Void = { _ in } // No-op
109
-
110
- var body: some View {
111
- // Full SwiftUI matching original app
112
- }
113
- }
114
-
115
- #Preview("Normal") { [Screen]Content(state: .normal) }
116
- #Preview("Loading") { [Screen]Content(state: .loading) }
117
- #Preview("Error") { [Screen]Content(state: .error) }
118
- ```
119
-
120
- #### 2.9: Visual Parity Check ⭐
121
-
122
- Compare with original app:
123
- - [ ] Layout structure matches
124
- - [ ] Colors, typography, spacing correct
125
- - [ ] Icons/images positioned correctly
126
- - [ ] All states: normal, loading, error, empty
127
-
128
- ### 🚦 UI + Contracts Gate (MANDATORY)
129
-
130
- ```
131
- "📐🎨 Blueprint + UI cho [Feature] xong:
132
- 📝 Contracts: [N] models, [N] protocols, [N] use cases, [N] endpoints
133
- 🎨 UI: [Screen] with [N] state previews
134
- 📸 Visual Parity: [OK / needs adjustment]
135
-
136
- → ✅ Approve → Phase 3 (Logic Build)
137
- → 🎨 Adjust UI → fix then re-check
138
- → 📝 Adjust contracts → revise"
139
- ```
140
-
141
- > ⚠️ **DO NOT proceed to Phase 3 without user approval.**
142
-
143
- ---
144
-
145
- ## 🔨 Phase 3: Logic Build
146
-
147
- > **Output:** Full Swift code. Wire logic to EXISTING UI.
148
-
149
- ### 3.1: Domain Layer
150
- Models + Repository protocols + UseCases (implement with repo calls)
151
-
152
- ### 3.2: Data Layer
153
- DTOs + APIClient endpoints + SwiftData (if applicable) + Repository implementation
154
-
155
- ### 3.3: DI Container
156
- AppContainer with lazy properties for repos, use cases, view models
157
-
158
- ### 3.4: ViewModel
159
- @Observable with state property + handle(_ action:) + event handler
160
-
161
- ### 3.5: Wire UI ↔ Logic ⭐ (NOT "code new UI")
162
-
163
- The UI already exists from Phase 2.8. Only CONNECT it:
164
-
165
- ```swift
166
- // Keep stateless Content view from Phase 2 (for Preview):
167
- // [Screen]Content(state:, onAction:) — DO NOT MODIFY
168
-
169
- // ADD wrapper that wires ViewModel:
170
- struct [Screen]: View {
171
- @State private var viewModel: [Screen]ViewModel
172
-
173
- init(container: AppContainer) {
174
- _viewModel = State(initialValue: container.make[Screen]ViewModel())
175
- }
176
-
177
- var body: some View {
178
- [Screen]Content(
179
- state: viewModel.state,
180
- onAction: viewModel.handle
181
- )
182
- }
183
- }
184
- ```
185
-
186
- ### 3.6: Integration Test ⭐
187
- - [ ] API calls succeed, data displays
188
- - [ ] Loading/error states work
189
- - [ ] Navigation correct
190
- - [ ] Crypto output matches (if applicable)
191
-
192
- ### 🔒 Crypto (Special)
193
- ```swift
194
- import CryptoKit
195
- import CommonCrypto
196
- // XCTest mandatory for crypto utils
197
- ```
198
- > ⚠️ Crypto MUST match original output.
199
-
200
- ### ✅ Feature Checkpoint
201
-
202
- ```markdown
203
- ## ✅ Feature Complete: [Name]
204
- Files: [list] | Resources: [count] | Tests: [status]
205
- ⏭️ Next Feature: [Name] → Return to Phase 2
206
- ```
207
-
208
- ---
209
-
210
- ## ✅ Phase 4: Final Parity Check (After ALL features)
211
-
212
- ### Checklist
213
- - [ ] API Parity — all endpoints match
214
- - [ ] Data/Crypto Parity — output identical
215
- - [ ] UI Parity — screen-by-screen comparison
216
- - [ ] Edge Cases — empty, error, offline, lifecycle
217
- - [ ] Build: `xcodebuild build && xcodebuild test`
218
-
219
- ### 🎉 Final Summary
220
-
221
- ```markdown
222
- ## ✅ Reverse Engineering Complete!
223
- - Screens: [N] | Features: [N]
224
- - Frameworks reused: [N] | Replaced: [N]
225
- - Tests: [pass/fail]
226
-
227
- ⏭️ Next: /test → /deploy → /code-janitor
228
- ```
229
-
230
- ---
231
-
232
- ## 🔗 Related
233
-
234
- - **Parent:** [`/reverse-ios`](reverse-ios.md)
235
- - **Previous:** [`/re-ios-design`](reverse-ios-design.md) (Phase 1)
236
- - **Skill:** `smali-to-swift` → `phase-2-blueprint-ui.md` + `phase-3-logic-build.md`
237
-
238
- ---
239
-
240
- *re-ios-build v4.0.0 — UI-First Blueprint + Build*
@@ -1,112 +0,0 @@
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*
@@ -1,120 +0,0 @@
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*
@@ -1,152 +0,0 @@
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*