@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
|
@@ -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*
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: 🍎 Dịch ngược IPA iOS (class-dump, Hopper output) → App Swift hiện đại với SwiftUI, Clean Architecture
|
|
2
|
+
description: 🍎 Dịch ngược IPA iOS (class-dump, Hopper output) → App Swift hiện đại với SwiftUI, Clean Architecture. Progressive Disclosure: Map → Blueprint → Build.
|
|
3
3
|
skill: smali-to-swift
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /reverse-ios — iOS IPA Reverse Engineering Workflow
|
|
7
7
|
|
|
8
|
-
> **Skill:** `smali-to-swift` | **Tech:** Swift + SwiftUI + async/await + URLSession + SwiftData
|
|
9
|
-
> **Philosophy:** "
|
|
8
|
+
> **Skill:** `smali-to-swift` v2.0 | **Tech:** Swift + SwiftUI + async/await + URLSession + SwiftData
|
|
9
|
+
> **Philosophy:** "Treat decompiled code as a MAP, not a TODO list"
|
|
10
|
+
> **Approach:** Map → Blueprint → Build (progressive disclosure)
|
|
10
11
|
> **Sibling:** `/reverse-android`
|
|
11
12
|
|
|
12
13
|
---
|
|
@@ -14,7 +15,7 @@ skill: smali-to-swift
|
|
|
14
15
|
## ⚡ QUICK START
|
|
15
16
|
|
|
16
17
|
User cung cấp: Decrypted `.app` bundle, class-dump headers, Hopper pseudo-code, hoặc nói "reverse engineer IPA này".
|
|
17
|
-
Workflow dẫn dắt
|
|
18
|
+
Workflow dẫn dắt qua **4 phases** — mỗi phase có zoom level riêng, **không bao giờ nhảy cóc**.
|
|
18
19
|
|
|
19
20
|
---
|
|
20
21
|
|
|
@@ -27,18 +28,20 @@ reverse_ios_session:
|
|
|
27
28
|
project_name: "[TBD - từ Info.plist]"
|
|
28
29
|
app_bundle_dir: "[path]"
|
|
29
30
|
headers_dir: "[class-dump output]"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
current_phase: 0
|
|
32
|
+
current_zoom: 0
|
|
33
|
+
current_feature: null
|
|
34
|
+
app_map_done: false
|
|
35
|
+
architecture_done: false
|
|
36
|
+
completed_features: []
|
|
37
|
+
pending_features: []
|
|
35
38
|
decisions: []
|
|
36
39
|
```
|
|
37
40
|
|
|
38
41
|
### Bước 0.2: Xác nhận input
|
|
39
42
|
|
|
40
43
|
```
|
|
41
|
-
🍎 iOS Reverse Engineering
|
|
44
|
+
🍎 iOS Reverse Engineering v2.0 — Map → Blueprint → Build
|
|
42
45
|
|
|
43
46
|
Em cần biết:
|
|
44
47
|
1. Decrypted .app bundle ở đâu?
|
|
@@ -52,25 +55,47 @@ Chưa chuẩn bị?
|
|
|
52
55
|
|
|
53
56
|
---
|
|
54
57
|
|
|
55
|
-
## 📋 Pipeline Overview (
|
|
58
|
+
## 📋 Pipeline Overview (4 Phases)
|
|
56
59
|
|
|
57
|
-
|
|
|
58
|
-
|
|
59
|
-
| 0 |
|
|
60
|
-
| 1 |
|
|
61
|
-
| 2 |
|
|
62
|
-
| 3 |
|
|
63
|
-
| 4 | 🎨 UI & ViewModel | [`/re-ios-build`](reverse-ios-build.md) | Per-screen loop |
|
|
64
|
-
| 5 | 📦 SDK Integration | [`/re-ios-build`](reverse-ios-build.md) | Checkpoint |
|
|
65
|
-
| 6 | ✅ Parity Check | [`/re-ios-build`](reverse-ios-build.md) | Final QA |
|
|
60
|
+
| Phase | Name | Sub-workflow | Zoom | Code? | Gate |
|
|
61
|
+
|-------|------|-------------|------|-------|------|
|
|
62
|
+
| 0 | 🗺️ Discovery | [`/re-ios-discover`](reverse-ios-discover.md) | Satellite | ❌ | User approves Map |
|
|
63
|
+
| 1 | 🏗️ Architecture | [`/re-ios-design`](reverse-ios-design.md) | District | ❌ | User approves Architecture |
|
|
64
|
+
| 2 | 📐 Blueprint | [`/re-ios-build`](reverse-ios-build.md) | Block | Signatures | Per-feature approval |
|
|
65
|
+
| 3 | 🔨 Implementation | [`/re-ios-build`](reverse-ios-build.md) | Ground | Full | Per-feature checkpoint |
|
|
66
66
|
|
|
67
67
|
### Execution Flow
|
|
68
68
|
|
|
69
69
|
```
|
|
70
|
-
Session Setup
|
|
70
|
+
Session Setup
|
|
71
|
+
↓
|
|
72
|
+
Phase 0: Discovery (/re-ios-discover) → App Map
|
|
73
|
+
↓ [User approves]
|
|
74
|
+
Phase 1: Architecture (/re-ios-design) → Architecture Blueprint
|
|
75
|
+
↓ [User approves + picks feature]
|
|
76
|
+
Phase 2+3 Loop (/re-ios-build):
|
|
77
|
+
→ Blueprint Feature X → Build Feature X → Checkpoint
|
|
78
|
+
→ Blueprint Feature Y → Build Feature Y → Checkpoint
|
|
79
|
+
↓
|
|
80
|
+
Final: Parity Check & Quality Gate
|
|
71
81
|
```
|
|
72
82
|
|
|
73
|
-
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 🔭 ZOOM CONTROL
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
pre_output_check:
|
|
89
|
+
- "Đang ở zoom level nào?"
|
|
90
|
+
- "Output có đúng zoom level không?"
|
|
91
|
+
- "Có function body trong Phase 0/1 không? → REMOVE"
|
|
92
|
+
|
|
93
|
+
zoom_rules:
|
|
94
|
+
zoom_0: "NO CODE. Only diagrams, tables, maps."
|
|
95
|
+
zoom_1: "NO CODE BODIES. Only architecture, file lists."
|
|
96
|
+
zoom_2: "SIGNATURES ONLY. Protocols, structs, enums."
|
|
97
|
+
zoom_3: "FULL CODE. Implementation for ONE feature."
|
|
98
|
+
```
|
|
74
99
|
|
|
75
100
|
---
|
|
76
101
|
|
|
@@ -78,37 +103,38 @@ Session Setup → Step 0+1 (/re-ios-scan) → Step 2-6 (/re-ios-build)
|
|
|
78
103
|
|
|
79
104
|
```yaml
|
|
80
105
|
never_skip:
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
106
|
+
- Phase 0 (Discovery) — always first
|
|
107
|
+
- Phase 1 (Architecture) — design before code
|
|
108
|
+
- Per-feature Blueprint before Implementation
|
|
84
109
|
|
|
85
110
|
never_do:
|
|
111
|
+
- Write code in Phase 0 or Phase 1
|
|
86
112
|
- Mass-copy assets from IPA
|
|
87
113
|
- Use UIKit when SwiftUI equivalent exists
|
|
88
114
|
- Use GCD for new async code (use async/await)
|
|
89
|
-
- Use ObjC in new code (Swift only
|
|
90
|
-
-
|
|
115
|
+
- Use ObjC in new code (Swift only)
|
|
116
|
+
- Implement multiple features simultaneously
|
|
91
117
|
|
|
92
118
|
always_do:
|
|
93
|
-
-
|
|
94
|
-
-
|
|
119
|
+
- Start with App Map
|
|
120
|
+
- Create Blueprint before each feature
|
|
95
121
|
- XCTest all crypto/hash functions
|
|
96
|
-
- Use @Observable for ViewModels
|
|
97
|
-
- Use NavigationStack
|
|
98
|
-
- Use SPM for all dependencies
|
|
122
|
+
- Use @Observable for ViewModels
|
|
123
|
+
- Use NavigationStack, SPM
|
|
99
124
|
```
|
|
100
125
|
|
|
101
126
|
---
|
|
102
127
|
|
|
103
128
|
## 🔗 Related
|
|
104
129
|
|
|
105
|
-
- **Sub-workflows:**
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
- **
|
|
130
|
+
- **Sub-workflows:**
|
|
131
|
+
- [`/re-ios-discover`](reverse-ios-discover.md) — Phase 0: Discovery
|
|
132
|
+
- [`/re-ios-design`](reverse-ios-design.md) — Phase 1: Architecture
|
|
133
|
+
- [`/re-ios-build`](reverse-ios-build.md) — Phase 2+3: Blueprint + Build
|
|
134
|
+
- **Skill:** `smali-to-swift` v2.0
|
|
135
|
+
- **Sibling:** `/reverse-android`
|
|
110
136
|
- **After RE done:** `/test`, `/deploy`, `/code-janitor`
|
|
111
137
|
|
|
112
138
|
---
|
|
113
139
|
|
|
114
|
-
*reverse-ios workflow
|
|
140
|
+
*reverse-ios workflow v3.0.0 — Progressive Disclosure RE Pipeline*
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 📦 RE Android Phase 1 — Library Scanner + Manifest Analysis + Project Bootstrap
|
|
3
|
-
parent: reverse-android
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# /re-android-scan — Library Scanner & Manifest Analysis
|
|
7
|
-
|
|
8
|
-
> **Parent:** [`/reverse-android`](reverse-android.md) → Step 0 + Step 1
|
|
9
|
-
> **Skill:** `smali-to-kotlin` | **Reference:** `skills/smali-to-kotlin/library-patterns.md`
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## 📦 Step 0: Library Scanner (BẮT BUỘC)
|
|
14
|
-
|
|
15
|
-
> Nhận diện toàn bộ thư viện **trước khi code bất kỳ thứ gì**.
|
|
16
|
-
|
|
17
|
-
### 0.3: Quét Smali directories
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
# Top-level packages
|
|
21
|
-
find [apktool_dir]/smali -maxdepth 3 -type d | sed 's|[apktool_dir]/smali/||' | sort
|
|
22
|
-
|
|
23
|
-
# Multi-dex
|
|
24
|
-
find [apktool_dir] -name "smali*" -maxdepth 1 -type d
|
|
25
|
-
find [apktool_dir]/smali_classes2 -maxdepth 3 -type d 2>/dev/null | sort
|
|
26
|
-
|
|
27
|
-
# Native libraries & Assets
|
|
28
|
-
find [apktool_dir]/lib -name "*.so" 2>/dev/null
|
|
29
|
-
ls [apktool_dir]/assets/ 2>/dev/null
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### 0.4: Tạo Library Detection Report
|
|
33
|
-
|
|
34
|
-
Dùng patterns từ `library-patterns.md`, phân loại:
|
|
35
|
-
|
|
36
|
-
```markdown
|
|
37
|
-
## 📦 Library Detection Report — [App Name]
|
|
38
|
-
|
|
39
|
-
### ✅ Reuse (build.gradle)
|
|
40
|
-
| Library | Package Detected | Version | Notes |
|
|
41
|
-
|---------|-----------------|---------|-------|
|
|
42
|
-
| Retrofit | com/squareup/retrofit2 | 2.9.0 | Keep |
|
|
43
|
-
| OkHttp | com/squareup/okhttp3 | 4.12.0 | Keep |
|
|
44
|
-
|
|
45
|
-
### 🔄 Replace (Legacy → Modern)
|
|
46
|
-
| Old Library | Detected | Replacement |
|
|
47
|
-
|-------------|----------|-------------|
|
|
48
|
-
| Volley | com/android/volley | Retrofit + OkHttp |
|
|
49
|
-
| AsyncTask | android.os.AsyncTask | Coroutines |
|
|
50
|
-
|
|
51
|
-
### 🔵 Firebase/Google SDKs
|
|
52
|
-
| SDK | Detected | Action |
|
|
53
|
-
|-----|----------|--------|
|
|
54
|
-
|
|
55
|
-
### 📱 Native (.so) — Giữ nguyên
|
|
56
|
-
| File | Architecture | Notes |
|
|
57
|
-
|------|-------------|-------|
|
|
58
|
-
|
|
59
|
-
### 🏷️ App Code (Rebuild in Kotlin)
|
|
60
|
-
| Package | Module |
|
|
61
|
-
|---------|--------|
|
|
62
|
-
|
|
63
|
-
### ❓ Unknown (Cần điều tra)
|
|
64
|
-
| Package | Path | Possible |
|
|
65
|
-
|---------|------|----------|
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### 0.5: User approval
|
|
69
|
-
|
|
70
|
-
> **GATE:** Không tiếp tục Step 1 khi chưa có user approval report.
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## 📄 Step 1: AndroidManifest Analysis & Project Bootstrap
|
|
75
|
-
|
|
76
|
-
> **Input:** `[apktool_dir]/AndroidManifest.xml`
|
|
77
|
-
|
|
78
|
-
### 1.1: Phân tích Manifest
|
|
79
|
-
|
|
80
|
-
Trích xuất:
|
|
81
|
-
|
|
82
|
-
```yaml
|
|
83
|
-
extract:
|
|
84
|
-
- application_id, package_name
|
|
85
|
-
- min_sdk, target_sdk
|
|
86
|
-
- permissions: [network, storage, camera, location, other]
|
|
87
|
-
- entry_points: [application_class, splash_activity, main_activity]
|
|
88
|
-
- components: [activities, services, receivers, providers]
|
|
89
|
-
- deep_links, features
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### 1.2: Đề xuất project structure
|
|
93
|
-
|
|
94
|
-
Mapping activities → Compose screens (xem SKILL.md Step 1):
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
SplashActivity → presentation/screens/splash/SplashScreen.kt
|
|
98
|
-
MainActivity → presentation/screens/main/MainScreen.kt
|
|
99
|
-
LoginActivity → presentation/screens/auth/LoginScreen.kt
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### 1.3: Tạo `build.gradle.kts` skeleton
|
|
103
|
-
|
|
104
|
-
```kotlin
|
|
105
|
-
plugins {
|
|
106
|
-
alias(libs.plugins.android.application)
|
|
107
|
-
alias(libs.plugins.kotlin.android)
|
|
108
|
-
alias(libs.plugins.kotlin.compose)
|
|
109
|
-
alias(libs.plugins.hilt.android)
|
|
110
|
-
alias(libs.plugins.ksp)
|
|
111
|
-
alias(libs.plugins.kotlin.serialization)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
android {
|
|
115
|
-
namespace = "[package_name]"
|
|
116
|
-
compileSdk = [target_sdk]
|
|
117
|
-
defaultConfig {
|
|
118
|
-
applicationId = "[application_id]"
|
|
119
|
-
minSdk = [min_sdk]
|
|
120
|
-
targetSdk = [target_sdk]
|
|
121
|
-
}
|
|
122
|
-
buildFeatures { compose = true; buildConfig = true }
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
dependencies {
|
|
126
|
-
// Compose BOM + Material3 + Navigation
|
|
127
|
-
// Coroutines + Hilt DI
|
|
128
|
-
// Network: Retrofit + OkHttp (từ Library Report)
|
|
129
|
-
// Local: Room + DataStore
|
|
130
|
-
// Image: Coil + Logging: Timber
|
|
131
|
-
// [Thêm libs từ "Reuse" section]
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### ✅ Checkpoint Step 1
|
|
136
|
-
|
|
137
|
-
```markdown
|
|
138
|
-
## ✅ Step 1 Complete
|
|
139
|
-
|
|
140
|
-
- Package: [package_name]
|
|
141
|
-
- Entry points: [list]
|
|
142
|
-
- Screens to rebuild: [list]
|
|
143
|
-
|
|
144
|
-
⏭️ Next: `/re-android-build` — Step 2 (Data Layer)
|
|
145
|
-
Cung cấp Smali: smali/[package]/network/, model/, data/
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
## 🔗 Related
|
|
151
|
-
|
|
152
|
-
- **Next:** [`/re-android-build`](reverse-android-build.md) (Step 2-6)
|
|
153
|
-
- **Parent:** [`/reverse-android`](reverse-android.md)
|
|
154
|
-
- **Library patterns:** `skills/smali-to-kotlin/library-patterns.md`
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
|
-
*re-android-scan v2.0.0 — Phase 1: Discovery & Bootstrap*
|
|
@@ -1,155 +0,0 @@
|
|
|
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*
|