@leejungkiin/awkit 1.4.3 → 1.5.1
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 +38 -14
- package/bin/awk.js +438 -86
- package/bin/claude-generators.js +3 -1
- package/bin/cline-generators.js +3 -1
- package/bin/codex-generators.js +7 -2
- package/core/orchestrator.md +17 -3
- package/core/skill-runtime-manifest.json +37 -0
- package/package.json +2 -2
- package/skill-packs/creator-studio/README.md +19 -0
- package/skill-packs/creator-studio/pack.json +10 -0
- package/skill-packs/marketing/README.md +64 -0
- package/skill-packs/marketing/pack.json +37 -0
- package/skill-packs/mobile-android/README.md +16 -0
- package/skill-packs/mobile-android/pack.json +10 -0
- package/skill-packs/mobile-ios/README.md +22 -0
- package/skill-packs/mobile-ios/pack.json +16 -0
- package/skill-packs/neural-memory/pack.json +8 -2
- package/skill-packs/superpowers/pack.json +1 -0
- package/skill-packs/superpowers/skills/single-flow-task-execution/SKILL.md +59 -358
- package/skill-packs/superpowers/skills/writing-skills/SKILL.md +60 -654
- package/skill-packs/superpowers/skills/writing-skills/examples/anti-rationalization.md +75 -0
- package/skill-packs/superpowers/skills/writing-skills/examples/cso-optimization.md +67 -0
- package/skill-packs/superpowers/skills/writing-skills/examples/tdd-for-skills.md +63 -0
- package/skills/CATALOG.md +49 -44
- package/skills/brainstorm-agent/SKILL.md +55 -315
- package/skills/brainstorm-agent/templates/brief-template.md +76 -0
- package/skills/codex-conductor/SKILL.md +55 -259
- package/skills/codex-conductor/examples/prompt-templates.md +72 -0
- package/skills/module-spec-writer/SKILL.md +38 -365
- package/skills/module-spec-writer/examples/port-migration-mode.md +40 -0
- package/skills/module-spec-writer/templates/module-spec-template.md +118 -0
- package/skills/orchestrator/SKILL.md +17 -8
- package/skills/single-flow-task-execution/SKILL.md +56 -363
- package/skills/single-flow-task-execution/examples/workflow-example.md +91 -0
- package/skills/smali-to-kotlin/SKILL.md +23 -416
- package/skills/smali-to-kotlin/examples/getting-started/tech-stack.md +58 -0
- package/skills/smali-to-kotlin/examples/pipeline/data-ui-parity.md +118 -0
- package/skills/smali-to-kotlin/examples/pipeline/scanner-and-bootstrap.md +106 -0
- package/skills/smali-to-swift/SKILL.md +18 -621
- package/skills/smali-to-swift/examples/getting-started/tech-stack.md +72 -0
- package/skills/smali-to-swift/examples/getting-started/toolchain.md +32 -0
- package/skills/smali-to-swift/examples/pipeline/core-logic.md +45 -0
- package/skills/smali-to-swift/examples/pipeline/data-layer.md +76 -0
- package/skills/smali-to-swift/examples/pipeline/framework-scanner.md +73 -0
- package/skills/smali-to-swift/examples/pipeline/project-bootstrap.md +76 -0
- package/skills/smali-to-swift/examples/pipeline/sdk-integration.md +66 -0
- package/skills/smali-to-swift/examples/pipeline/ui-viewmodel.md +96 -0
- package/skills/smali-to-swift/references/objc-to-swift-mapping.md +57 -0
- package/skills/spec-gate/SKILL.md +51 -265
- package/skills/spec-gate/templates/design-templates.md +93 -0
- package/skills/symphony-enforcer/SKILL.md +24 -555
- package/skills/symphony-enforcer/examples/startup-protocol.md +92 -0
- package/skills/symphony-enforcer/examples/task-completion.md +100 -0
- package/skills/symphony-enforcer/examples/three-phase.md +107 -0
- package/skills/symphony-enforcer/examples/trigger-points.md +99 -0
- package/skills/symphony-orchestrator/SKILL.md +1 -1
- package/skills/writing-skills/SKILL.md +82 -70
- package/skills/writing-skills/examples/anti-rationalization.md +53 -0
- package/skills/writing-skills/examples/cso-optimization.md +52 -0
- package/skills/writing-skills/examples/tdd-for-skills.md +48 -0
- package/templates/help.html +447 -0
- package/skills/memory-sync/SKILL.md +0 -424
- package/skills/memory-sync/memory-router.md +0 -185
- package/skills/memory-sync/memory-templates.md +0 -201
|
@@ -5,7 +5,7 @@ description: >-
|
|
|
5
5
|
and rebuilds the app from scratch using modern Kotlin + Jetpack Compose + Clean Architecture.
|
|
6
6
|
Includes library detection to reuse existing dependencies.
|
|
7
7
|
author: Antigravity Team
|
|
8
|
-
version:
|
|
8
|
+
version: 2.0.0
|
|
9
9
|
trigger: conditional
|
|
10
10
|
activation_keywords:
|
|
11
11
|
- "/reverse-android"
|
|
@@ -18,17 +18,14 @@ activation_keywords:
|
|
|
18
18
|
- "smali to kotlin"
|
|
19
19
|
priority: high
|
|
20
20
|
platform: android
|
|
21
|
-
|
|
22
|
-
- ios (separate skill: smali-to-swift — planned)
|
|
21
|
+
sibling_skill: smali-to-swift (iOS counterpart)
|
|
23
22
|
---
|
|
24
23
|
|
|
25
24
|
# 🔧 Smali-to-Kotlin Skill
|
|
26
25
|
|
|
27
|
-
> **Purpose:** Transform decompiled Android APK
|
|
26
|
+
> **Purpose:** Transform decompiled Android APK into a modern Kotlin app with Jetpack Compose + Clean Architecture (MVVM).
|
|
28
27
|
> **Philosophy:** "Read Smali to understand WHAT and WHY → Write Kotlin for HOW."
|
|
29
28
|
|
|
30
|
-
---
|
|
31
|
-
|
|
32
29
|
## ⚠️ SCOPE CLARITY
|
|
33
30
|
|
|
34
31
|
| This skill DOES | This skill DOES NOT |
|
|
@@ -37,13 +34,8 @@ extensible_to:
|
|
|
37
34
|
| Rebuild logic in modern Kotlin | Modify original APK |
|
|
38
35
|
| Detect & reuse third-party libraries | Crack/bypass security |
|
|
39
36
|
| Extract only needed resources (on-demand) | Mass-copy resources blindly |
|
|
40
|
-
| Set up Clean Architecture project structure | Handle iOS reverse engineering |
|
|
41
|
-
| Scan APK libraries for package reuse | Deploy to Play Store |
|
|
42
|
-
|
|
43
|
-
→ For iOS reverse engineering → future skill: `smali-to-swift`
|
|
44
|
-
→ After rebuild complete → use `/test` or `/deploy` workflows
|
|
45
37
|
|
|
46
|
-
|
|
38
|
+
→ iOS reverse engineering → sibling skill: `smali-to-swift`
|
|
47
39
|
|
|
48
40
|
## 🎯 ROLE DEFINITION
|
|
49
41
|
|
|
@@ -55,372 +47,22 @@ When this skill is active, the agent becomes:
|
|
|
55
47
|
> - Knows when to reuse vs rewrite third-party dependencies
|
|
56
48
|
> - Enforces resource-on-demand principle (zero bloat)
|
|
57
49
|
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## 🏗️ MODERN TECH STACK (Mandatory)
|
|
61
|
-
|
|
62
|
-
### Core
|
|
63
|
-
| Layer | Technology | Replaces |
|
|
64
|
-
|-------|-----------|----------|
|
|
65
|
-
| **UI** | Jetpack Compose + Material 3 | XML Layouts + findViewById |
|
|
66
|
-
| **State** | StateFlow + ViewModel | LiveData / AsyncTask |
|
|
67
|
-
| **Navigation** | Navigation Compose | Intent-based navigation |
|
|
68
|
-
| **DI** | Hilt (Dagger) | Manual DI / ServiceLocator |
|
|
69
|
-
|
|
70
|
-
### Data Layer
|
|
71
|
-
| Purpose | Technology | Replaces |
|
|
72
|
-
|---------|-----------|----------|
|
|
73
|
-
| **Network** | Retrofit + OkHttp + Kotlin Serialization | Volley / HttpURLConnection |
|
|
74
|
-
| **Local DB** | Room Database | Raw SQLite / SQLiteOpenHelper |
|
|
75
|
-
| **Preferences** | DataStore (Proto/Preferences) | SharedPreferences |
|
|
76
|
-
| **Image Loading** | Coil | Picasso / Glide (evaluate) |
|
|
77
|
-
| **Async** | Kotlin Coroutines + Flow | AsyncTask / Handler / Thread |
|
|
78
|
-
|
|
79
|
-
### Observability
|
|
80
|
-
| Purpose | Technology |
|
|
81
|
-
|---------|-----------|
|
|
82
|
-
| **Crash** | Firebase Crashlytics |
|
|
83
|
-
| **Analytics** | Firebase Analytics |
|
|
84
|
-
| **Logging** | Timber |
|
|
85
|
-
|
|
86
|
-
### Replacements Table (Legacy → Modern)
|
|
87
|
-
|
|
88
|
-
```yaml
|
|
89
|
-
always_replace:
|
|
90
|
-
AsyncTask: "Coroutines (suspend fun / Flow)"
|
|
91
|
-
Volley: "Retrofit + OkHttp"
|
|
92
|
-
HttpURLConnection: "Retrofit + OkHttp"
|
|
93
|
-
Handler/Looper: "Coroutines (Dispatchers.Main)"
|
|
94
|
-
BroadcastReceiver (local): "Flow / EventBus → SharedFlow"
|
|
95
|
-
SharedPreferences: "DataStore"
|
|
96
|
-
SQLiteOpenHelper: "Room"
|
|
97
|
-
ListView/GridView: "LazyColumn/LazyGrid (Compose)"
|
|
98
|
-
findViewById: "Compose state"
|
|
99
|
-
Gson: "Kotlin Serialization (kotlinx.serialization)"
|
|
100
|
-
|
|
101
|
-
evaluate_before_replacing:
|
|
102
|
-
Glide: "Keep if deeply integrated, otherwise → Coil"
|
|
103
|
-
RxJava: "Migrate to Coroutines + Flow (gradual)"
|
|
104
|
-
EventBus: "Replace with SharedFlow"
|
|
105
|
-
Butter Knife: "Not needed in Compose"
|
|
106
|
-
Dagger 2: "Upgrade to Hilt"
|
|
107
|
-
|
|
108
|
-
keep_as_is:
|
|
109
|
-
- "OkHttp (still current)"
|
|
110
|
-
- "Retrofit (still current)"
|
|
111
|
-
- "Firebase SDKs (use latest version)"
|
|
112
|
-
- "Google Play Services"
|
|
113
|
-
- "Native .so libraries (JNI)"
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
50
|
## 📋 EXECUTION PIPELINE (6 Steps)
|
|
119
51
|
|
|
120
52
|
> **Rule:** Always complete one step fully before moving to the next.
|
|
121
53
|
> **Rule:** After each step, create a checkpoint summary for the user.
|
|
122
54
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
**Purpose:** Scan the APK structure to identify all third-party libraries before any coding.
|
|
126
|
-
|
|
127
|
-
**Process:**
|
|
128
|
-
1. **Scan `smali/` directories** for package patterns:
|
|
129
|
-
```
|
|
130
|
-
smali/com/google/ → Google SDKs
|
|
131
|
-
smali/com/facebook/ → Facebook SDK
|
|
132
|
-
smali/com/squareup/ → OkHttp, Retrofit, Picasso
|
|
133
|
-
smali/io/reactivex/ → RxJava
|
|
134
|
-
smali/org/greenrobot/ → EventBus
|
|
135
|
-
smali/com/bumptech/ → Glide
|
|
136
|
-
smali/com/airbnb/ → Lottie
|
|
137
|
-
smali/androidx/ → AndroidX (baseline)
|
|
138
|
-
smali/com/jakewharton/ → Butterknife, Timber
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
2. **Check `lib/` for native libraries (.so)**:
|
|
142
|
-
```
|
|
143
|
-
lib/arm64-v8a/*.so → 64-bit native libs
|
|
144
|
-
lib/armeabi-v7a/*.so → 32-bit native libs
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
3. **Check `assets/` for embedded resources:**
|
|
148
|
-
- ML models (.tflite, .onnx)
|
|
149
|
-
- WebView HTML/JS bundles
|
|
150
|
-
- Config files (JSON, XML)
|
|
151
|
-
|
|
152
|
-
4. **Output: Library Report**
|
|
153
|
-
```markdown
|
|
154
|
-
## 📦 Library Detection Report
|
|
155
|
-
|
|
156
|
-
### ✅ Can Reuse (add to build.gradle)
|
|
157
|
-
| Library | Detected Package | Latest Version | Action |
|
|
158
|
-
|---------|-----------------|----------------|--------|
|
|
159
|
-
| Retrofit | com.squareup.retrofit2 | 2.9.0 | Add dependency |
|
|
160
|
-
| OkHttp | com.squareup.okhttp3 | 4.12.0 | Add dependency |
|
|
161
|
-
| Glide | com.bumptech.glide | 4.16.0 | Evaluate → Coil? |
|
|
162
|
-
|
|
163
|
-
### 🔄 Must Replace (legacy)
|
|
164
|
-
| Old Library | Detected Package | Replacement |
|
|
165
|
-
|-------------|-----------------|-------------|
|
|
166
|
-
| Volley | com.android.volley | Retrofit |
|
|
167
|
-
| AsyncTask | android.os.AsyncTask | Coroutines |
|
|
168
|
-
|
|
169
|
-
### 📱 Native (.so) — Keep As-Is
|
|
170
|
-
| File | Architecture | Notes |
|
|
171
|
-
|------|-------------|-------|
|
|
172
|
-
| libfoo.so | arm64-v8a | Need JNI bridge |
|
|
173
|
-
|
|
174
|
-
### ❓ Unknown (investigate)
|
|
175
|
-
| Package | Path | Possible Library |
|
|
176
|
-
|---------|------|-----------------|
|
|
177
|
-
| com.xyz.abc | smali/com/xyz/abc | Custom? |
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
### Step 1: AndroidManifest Analysis & Project Bootstrap 📄
|
|
183
|
-
|
|
184
|
-
**Input:** User provides `AndroidManifest.xml` from Apktool output.
|
|
185
|
-
|
|
186
|
-
**Tasks:**
|
|
187
|
-
1. Extract Application ID and original package name
|
|
188
|
-
2. List all required permissions (group by category: network, storage, camera, etc.)
|
|
189
|
-
3. Identify entry points:
|
|
190
|
-
- `Application` class (custom init logic?)
|
|
191
|
-
- `SplashActivity` / Launcher Activity
|
|
192
|
-
- `MainActivity`
|
|
193
|
-
4. Map all components:
|
|
194
|
-
- Activities → future Compose screens
|
|
195
|
-
- Services → WorkManager candidates?
|
|
196
|
-
- BroadcastReceivers → keep or replace with Flow?
|
|
197
|
-
- ContentProviders → keep or replace with Room?
|
|
198
|
-
5. Detect intent-filters for deep links
|
|
199
|
-
6. **Output:** Propose Clean Architecture project structure
|
|
200
|
-
|
|
201
|
-
**Project Structure Template:**
|
|
202
|
-
```
|
|
203
|
-
app/
|
|
204
|
-
├── src/main/
|
|
205
|
-
│ ├── java/com/package/app/
|
|
206
|
-
│ │ ├── App.kt # Application class
|
|
207
|
-
│ │ ├── di/ # Hilt modules
|
|
208
|
-
│ │ │ ├── AppModule.kt
|
|
209
|
-
│ │ │ ├── NetworkModule.kt
|
|
210
|
-
│ │ │ └── DatabaseModule.kt
|
|
211
|
-
│ │ ├── data/ # Data Layer
|
|
212
|
-
│ │ │ ├── remote/
|
|
213
|
-
│ │ │ │ ├── api/ # Retrofit interfaces
|
|
214
|
-
│ │ │ │ ├── dto/ # Data Transfer Objects
|
|
215
|
-
│ │ │ │ └── interceptor/ # OkHttp interceptors
|
|
216
|
-
│ │ │ ├── local/
|
|
217
|
-
│ │ │ │ ├── db/ # Room database
|
|
218
|
-
│ │ │ │ ├── dao/ # Room DAOs
|
|
219
|
-
│ │ │ │ ├── entity/ # Room entities
|
|
220
|
-
│ │ │ │ └── datastore/ # DataStore preferences
|
|
221
|
-
│ │ │ └── repository/ # Repository implementations
|
|
222
|
-
│ │ ├── domain/ # Domain Layer
|
|
223
|
-
│ │ │ ├── model/ # Business models
|
|
224
|
-
│ │ │ ├── repository/ # Repository interfaces
|
|
225
|
-
│ │ │ └── usecase/ # Use cases
|
|
226
|
-
│ │ ├── presentation/ # Presentation Layer
|
|
227
|
-
│ │ │ ├── navigation/ # NavGraph + Routes
|
|
228
|
-
│ │ │ ├── theme/ # Material 3 Theme
|
|
229
|
-
│ │ │ ├── components/ # Reusable Compose components
|
|
230
|
-
│ │ │ └── screens/ # Feature screens
|
|
231
|
-
│ │ │ ├── splash/
|
|
232
|
-
│ │ │ │ ├── SplashScreen.kt
|
|
233
|
-
│ │ │ │ └── SplashViewModel.kt
|
|
234
|
-
│ │ │ ├── home/
|
|
235
|
-
│ │ │ │ ├── HomeScreen.kt
|
|
236
|
-
│ │ │ │ └── HomeViewModel.kt
|
|
237
|
-
│ │ │ └── ...
|
|
238
|
-
│ │ └── util/ # Extensions, helpers
|
|
239
|
-
│ ├── res/ # Only needed resources
|
|
240
|
-
│ └── AndroidManifest.xml # Clean manifest
|
|
241
|
-
├── build.gradle.kts
|
|
242
|
-
└── proguard-rules.pro
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
---
|
|
246
|
-
|
|
247
|
-
### Step 2: Data Layer Reconstruction 💾
|
|
248
|
-
|
|
249
|
-
**Input:** User provides Smali/Java code for API endpoints, JSON models, database queries.
|
|
250
|
-
|
|
251
|
-
**Tasks:**
|
|
252
|
-
1. **Models:** Convert POJO/Model Smali → Kotlin `data class`
|
|
253
|
-
- Use `@Serializable` (kotlinx.serialization) or `@JsonClass` (Moshi)
|
|
254
|
-
- Preserve JSON field names with `@SerialName`
|
|
255
|
-
2. **API Layer:**
|
|
256
|
-
- Extract base URL, endpoints, headers from Smali
|
|
257
|
-
- Create Retrofit `@GET/@POST` interfaces
|
|
258
|
-
- Identify auth patterns (token, API key, custom headers)
|
|
259
|
-
3. **Local Storage:**
|
|
260
|
-
- SQLite queries → Room entities + DAOs
|
|
261
|
-
- SharedPreferences keys → DataStore schema
|
|
262
|
-
4. **Repository:**
|
|
263
|
-
- Create interface in `domain/repository/`
|
|
264
|
-
- Implement in `data/repository/`
|
|
265
|
-
- Use Flow for reactive data streams
|
|
266
|
-
|
|
267
|
-
**Smali Reading Tips:**
|
|
268
|
-
```
|
|
269
|
-
# Finding API base URL:
|
|
270
|
-
Look for: const-string → "https://" or "http://"
|
|
271
|
-
Look for: .field → BASE_URL or API_URL
|
|
272
|
-
|
|
273
|
-
# Finding endpoints:
|
|
274
|
-
Look for: StringBuilder + append patterns
|
|
275
|
-
Look for: Annotation patterns (@GET, @POST in obfuscated form)
|
|
276
|
-
|
|
277
|
-
# Finding JSON parsing:
|
|
278
|
-
Look for: JSONObject, JSONArray usage
|
|
279
|
-
Look for: Gson.fromJson / TypeToken patterns
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
|
-
### Step 3: Core Logic & Utils Reconstruction 🧮
|
|
285
|
-
|
|
286
|
-
**Input:** User provides Smali for encryption, hashing, time formatting, custom utils.
|
|
287
|
-
|
|
288
|
-
**Tasks:**
|
|
289
|
-
1. Translate mathematical/encryption logic from Smali → Kotlin
|
|
290
|
-
- Preserve exact input/output signatures (critical for server compatibility)
|
|
291
|
-
- Use `object` for stateless utils, extension functions for type-specific
|
|
292
|
-
2. Map special encoding patterns:
|
|
293
|
-
- MD5/SHA hashing → `MessageDigest`
|
|
294
|
-
- AES/DES encryption → `javax.crypto.Cipher`
|
|
295
|
-
- Base64 → `android.util.Base64` or `java.util.Base64`
|
|
296
|
-
- Custom obfuscation → reverse engineer step-by-step
|
|
297
|
-
3. **Verification:** Create unit tests that compare output with original app
|
|
298
|
-
|
|
299
|
-
**Critical Rule:**
|
|
300
|
-
> ⚠️ Encryption and hashing functions MUST produce identical output to the original app.
|
|
301
|
-
> Any mismatch will break server communication. Always unit test with known input/output pairs.
|
|
302
|
-
|
|
303
|
-
---
|
|
304
|
-
|
|
305
|
-
### Step 4: UI & ViewModel Reconstruction (Per Screen) 🎨
|
|
306
|
-
|
|
307
|
-
**Input:** User provides `layout_xxx.xml` + corresponding Smali for Activity/Fragment.
|
|
308
|
-
|
|
309
|
-
**Tasks:**
|
|
310
|
-
1. **Resource Extraction (On-Demand):**
|
|
311
|
-
- List ONLY the drawables, strings, colors, dimens used in this specific screen
|
|
312
|
-
- User copies only those resources to the new project
|
|
313
|
-
- Clean up namespace references in resources
|
|
314
|
-
|
|
315
|
-
2. **Compose Migration:**
|
|
316
|
-
- Convert XML layout → Jetpack Compose composables
|
|
317
|
-
- Map View attributes → Compose modifiers
|
|
318
|
-
- Common mappings:
|
|
319
|
-
```
|
|
320
|
-
LinearLayout (vertical) → Column
|
|
321
|
-
LinearLayout (horizontal) → Row
|
|
322
|
-
FrameLayout → Box
|
|
323
|
-
RelativeLayout → Box with alignment / ConstraintLayout
|
|
324
|
-
RecyclerView → LazyColumn / LazyGrid
|
|
325
|
-
ScrollView → verticalScroll modifier
|
|
326
|
-
ImageView → Image / AsyncImage (Coil)
|
|
327
|
-
TextView → Text
|
|
328
|
-
EditText → TextField / OutlinedTextField
|
|
329
|
-
Button → Button / TextButton / OutlinedButton
|
|
330
|
-
ProgressBar → CircularProgressIndicator / LinearProgressIndicator
|
|
331
|
-
CardView → Card (Material 3)
|
|
332
|
-
Toolbar/ActionBar → TopAppBar (Material 3)
|
|
333
|
-
BottomNavigationView → NavigationBar (Material 3)
|
|
334
|
-
TabLayout + ViewPager → TabRow + HorizontalPager
|
|
335
|
-
SwipeRefreshLayout → pullRefresh modifier
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
3. **ViewModel Creation:**
|
|
339
|
-
- Read Smali logic flow: when API calls happen, loading states, form validation
|
|
340
|
-
- Create sealed class for UI state:
|
|
341
|
-
```kotlin
|
|
342
|
-
sealed interface ScreenUiState {
|
|
343
|
-
data object Loading : ScreenUiState
|
|
344
|
-
data class Success(val data: ScreenData) : ScreenUiState
|
|
345
|
-
data class Error(val message: String) : ScreenUiState
|
|
346
|
-
}
|
|
347
|
-
```
|
|
348
|
-
- Expose via `StateFlow` from ViewModel
|
|
349
|
-
- Handle one-time events via `SharedFlow` (navigation, snackbar, toast)
|
|
350
|
-
|
|
351
|
-
4. **Screen Composable:**
|
|
352
|
-
- Collect state from ViewModel
|
|
353
|
-
- Implement Material 3 theming
|
|
354
|
-
- Handle navigation via Navigation Compose
|
|
355
|
-
|
|
356
|
-
---
|
|
357
|
-
|
|
358
|
-
### Step 5: Third-party SDK & Native Library Integration 📦
|
|
359
|
-
|
|
360
|
-
**Input:** User provides JNI libs list and SDK detection from Step 0.
|
|
361
|
-
|
|
362
|
-
**Tasks:**
|
|
363
|
-
1. **Native Libraries (.so):**
|
|
364
|
-
- Keep .so files in `jniLibs/` directory
|
|
365
|
-
- Declare `external fun` in Kotlin matching C/C++ signatures
|
|
366
|
-
- Use `System.loadLibrary("name")` in companion object or init block
|
|
367
|
-
- Document JNI method signatures
|
|
368
|
-
|
|
369
|
-
2. **SDKs (from Library Report):**
|
|
370
|
-
- Add latest stable versions to `build.gradle.kts`
|
|
371
|
-
- Initialize in `Application` class using modern patterns:
|
|
372
|
-
```kotlin
|
|
373
|
-
@HiltAndroidApp
|
|
374
|
-
class App : Application() {
|
|
375
|
-
override fun onCreate() {
|
|
376
|
-
super.onCreate()
|
|
377
|
-
// Firebase (auto-init via manifest, or manual)
|
|
378
|
-
// Timber
|
|
379
|
-
if (BuildConfig.DEBUG) {
|
|
380
|
-
Timber.plant(Timber.DebugTree())
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
```
|
|
385
|
-
- Replace deprecated SDK API calls with current documentation
|
|
386
|
-
|
|
387
|
-
3. **build.gradle.kts Setup:**
|
|
388
|
-
- Use Version Catalogs (`libs.versions.toml`) for dependency management
|
|
389
|
-
- Configure Compose compiler, Hilt plugin, KSP
|
|
390
|
-
- Set up proper minSdk, targetSdk, compileSdk
|
|
391
|
-
|
|
392
|
-
---
|
|
393
|
-
|
|
394
|
-
### Step 6: Parity Check & Quality Gate ✅
|
|
55
|
+
**Identify the topic** from the user's request and load the corresponding file:
|
|
395
56
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
- List discovered branches as test cases
|
|
399
|
-
- Ask user to test each edge case
|
|
400
|
-
|
|
401
|
-
2. **API Parity:** Verify all API endpoints produce same request/response
|
|
402
|
-
- Compare headers, body format, encoding
|
|
403
|
-
- Test auth flow end-to-end
|
|
57
|
+
### Getting Started
|
|
58
|
+
- Modern tech stack & legacy replacements → `examples/getting-started/tech-stack.md`
|
|
404
59
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
4. **UI Parity:** Compare screen-by-screen
|
|
409
|
-
- Layout matches (spacing, colors, interactions)
|
|
410
|
-
- Navigation flow matches
|
|
411
|
-
- Error states handled
|
|
412
|
-
|
|
413
|
-
5. **Performance Check:**
|
|
414
|
-
- ProGuard/R8 rules for release build
|
|
415
|
-
- No unnecessary allocations in Compose (stable/immutable)
|
|
416
|
-
- Proper coroutine scope management
|
|
417
|
-
|
|
418
|
-
---
|
|
60
|
+
### Pipeline Steps
|
|
61
|
+
- **Step 0** Library Scanner + **Step 1** Manifest & Bootstrap → `examples/pipeline/scanner-and-bootstrap.md`
|
|
62
|
+
- **Step 2-6** Data Layer, Logic, UI, SDK, Parity Check → `examples/pipeline/data-ui-parity.md`
|
|
419
63
|
|
|
420
64
|
## 🔄 WORKFLOW INTEGRATION
|
|
421
65
|
|
|
422
|
-
### With Other Skills/Workflows:
|
|
423
|
-
|
|
424
66
|
```yaml
|
|
425
67
|
triggers_from:
|
|
426
68
|
- "/reverse-android" workflow command
|
|
@@ -434,25 +76,8 @@ delegates_to:
|
|
|
434
76
|
works_with:
|
|
435
77
|
- memory-sync — saves decisions, patterns, solutions
|
|
436
78
|
- orchestrator — routes to this skill based on intent
|
|
437
|
-
|
|
438
|
-
independent_from:
|
|
439
|
-
- brainstorm-agent
|
|
440
|
-
- ios-engineer (but shares design philosophy)
|
|
441
79
|
```
|
|
442
80
|
|
|
443
|
-
### Session State Tracking:
|
|
444
|
-
|
|
445
|
-
```yaml
|
|
446
|
-
session_state:
|
|
447
|
-
current_step: 0-6
|
|
448
|
-
current_screen: "HomeScreen" (for step 4 iterations)
|
|
449
|
-
library_report: generated | pending
|
|
450
|
-
completed_screens: ["SplashScreen", "LoginScreen"]
|
|
451
|
-
pending_screens: ["HomeScreen", "SettingsScreen"]
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
---
|
|
455
|
-
|
|
456
81
|
## 🚫 ANTI-PATTERNS
|
|
457
82
|
|
|
458
83
|
```yaml
|
|
@@ -463,59 +88,41 @@ never_do:
|
|
|
463
88
|
- Modify encryption output → must match original exactly
|
|
464
89
|
- Create massive God Activity → split into Compose screens + ViewModels
|
|
465
90
|
- Hardcode API keys/secrets → use BuildConfig or encrypted storage
|
|
466
|
-
- Skip parity check → always verify against original behavior
|
|
467
91
|
|
|
468
92
|
always_do:
|
|
469
93
|
- Run Library Scanner (Step 0) before any coding
|
|
470
94
|
- Present library report to user for approval
|
|
471
|
-
- Ask user to confirm each step's output before proceeding
|
|
472
|
-
- Create checkpoint summary after each step
|
|
473
95
|
- Unit test all encryption/hashing utils
|
|
474
96
|
- Use sealed classes for UI state
|
|
475
97
|
- Follow Clean Architecture layer separation strictly
|
|
476
98
|
```
|
|
477
99
|
|
|
478
|
-
---
|
|
479
|
-
|
|
480
100
|
## 📊 CHECKPOINT TEMPLATE
|
|
481
101
|
|
|
482
102
|
After each step, output:
|
|
483
103
|
|
|
484
104
|
```markdown
|
|
485
105
|
## ✅ Step [N] Complete: [Step Name]
|
|
486
|
-
|
|
487
106
|
### What was done:
|
|
488
|
-
- [Summary
|
|
489
|
-
|
|
107
|
+
- [Summary]
|
|
490
108
|
### Files created:
|
|
491
|
-
- [List
|
|
492
|
-
|
|
493
|
-
### Resources extracted:
|
|
494
|
-
- [List of resources moved to new project]
|
|
495
|
-
|
|
496
|
-
### Decisions made:
|
|
497
|
-
- [Key decisions documented]
|
|
498
|
-
|
|
109
|
+
- [List]
|
|
499
110
|
### ⏭️ Next: Step [N+1] — [Step Name]
|
|
500
111
|
- [What user needs to provide]
|
|
501
|
-
- [What will be done]
|
|
502
112
|
```
|
|
503
113
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
## 🧩 EXTENSIBILITY NOTE
|
|
114
|
+
## 🧩 PLATFORM RE TEMPLATE PATTERN
|
|
507
115
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
116
|
+
| Step | Android (this skill) | iOS (smali-to-swift) |
|
|
117
|
+
|------|---------------------|---------------------|
|
|
118
|
+
| 0 | Library Scanner (Smali packages) | Framework Scanner (Frameworks/ + headers) |
|
|
119
|
+
| 1 | AndroidManifest.xml | Info.plist + Entitlements |
|
|
120
|
+
| 2 | Retrofit + Room | URLSession + SwiftData |
|
|
121
|
+
| 3 | Kotlin crypto utils | Swift CryptoKit/CommonCrypto |
|
|
122
|
+
| 4 | Jetpack Compose + StateFlow | SwiftUI + @Observable |
|
|
123
|
+
| 5 | Hilt + JNI | SPM + Bridging Header |
|
|
124
|
+
| 6 | Parity Check | Parity Check |
|
|
517
125
|
|
|
518
126
|
---
|
|
519
127
|
|
|
520
|
-
*smali-to-kotlin
|
|
521
|
-
*Created by Antigravity Team*
|
|
128
|
+
*smali-to-kotlin v2.0.0 — Modular Router Architecture*
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Modern Tech Stack (Mandatory)
|
|
2
|
+
|
|
3
|
+
## Core
|
|
4
|
+
|
|
5
|
+
| Layer | Technology | Replaces |
|
|
6
|
+
|-------|-----------|----------|
|
|
7
|
+
| **UI** | Jetpack Compose + Material 3 | XML Layouts + findViewById |
|
|
8
|
+
| **State** | StateFlow + ViewModel | LiveData / AsyncTask |
|
|
9
|
+
| **Navigation** | Navigation Compose | Intent-based navigation |
|
|
10
|
+
| **DI** | Hilt (Dagger) | Manual DI / ServiceLocator |
|
|
11
|
+
|
|
12
|
+
## Data Layer
|
|
13
|
+
|
|
14
|
+
| Purpose | Technology | Replaces |
|
|
15
|
+
|---------|-----------|----------|
|
|
16
|
+
| **Network** | Retrofit + OkHttp + Kotlin Serialization | Volley / HttpURLConnection |
|
|
17
|
+
| **Local DB** | Room Database | Raw SQLite / SQLiteOpenHelper |
|
|
18
|
+
| **Preferences** | DataStore (Proto/Preferences) | SharedPreferences |
|
|
19
|
+
| **Image Loading** | Coil | Picasso / Glide (evaluate) |
|
|
20
|
+
| **Async** | Kotlin Coroutines + Flow | AsyncTask / Handler / Thread |
|
|
21
|
+
|
|
22
|
+
## Observability
|
|
23
|
+
|
|
24
|
+
| Purpose | Technology |
|
|
25
|
+
|---------|-----------|
|
|
26
|
+
| **Crash** | Firebase Crashlytics |
|
|
27
|
+
| **Analytics** | Firebase Analytics |
|
|
28
|
+
| **Logging** | Timber |
|
|
29
|
+
|
|
30
|
+
## Replacements Table (Legacy → Modern)
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
always_replace:
|
|
34
|
+
AsyncTask: "Coroutines (suspend fun / Flow)"
|
|
35
|
+
Volley: "Retrofit + OkHttp"
|
|
36
|
+
HttpURLConnection: "Retrofit + OkHttp"
|
|
37
|
+
Handler/Looper: "Coroutines (Dispatchers.Main)"
|
|
38
|
+
BroadcastReceiver (local): "Flow / EventBus → SharedFlow"
|
|
39
|
+
SharedPreferences: "DataStore"
|
|
40
|
+
SQLiteOpenHelper: "Room"
|
|
41
|
+
ListView/GridView: "LazyColumn/LazyGrid (Compose)"
|
|
42
|
+
findViewById: "Compose state"
|
|
43
|
+
Gson: "Kotlin Serialization (kotlinx.serialization)"
|
|
44
|
+
|
|
45
|
+
evaluate_before_replacing:
|
|
46
|
+
Glide: "Keep if deeply integrated, otherwise → Coil"
|
|
47
|
+
RxJava: "Migrate to Coroutines + Flow (gradual)"
|
|
48
|
+
EventBus: "Replace with SharedFlow"
|
|
49
|
+
Butter Knife: "Not needed in Compose"
|
|
50
|
+
Dagger 2: "Upgrade to Hilt"
|
|
51
|
+
|
|
52
|
+
keep_as_is:
|
|
53
|
+
- "OkHttp (still current)"
|
|
54
|
+
- "Retrofit (still current)"
|
|
55
|
+
- "Firebase SDKs (use latest version)"
|
|
56
|
+
- "Google Play Services"
|
|
57
|
+
- "Native .so libraries (JNI)"
|
|
58
|
+
```
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Step 2: Data Layer Reconstruction 💾
|
|
2
|
+
|
|
3
|
+
**Input:** Smali/Java code for API endpoints, JSON models, database queries.
|
|
4
|
+
|
|
5
|
+
## Tasks
|
|
6
|
+
|
|
7
|
+
### 1. Models: POJO/Smali → Kotlin data class
|
|
8
|
+
- Use `@Serializable` (kotlinx.serialization) or `@JsonClass` (Moshi)
|
|
9
|
+
- Preserve JSON field names with `@SerialName`
|
|
10
|
+
|
|
11
|
+
### 2. API Layer
|
|
12
|
+
- Extract base URL, endpoints, headers from Smali
|
|
13
|
+
- Create Retrofit `@GET/@POST` interfaces
|
|
14
|
+
- Identify auth patterns (token, API key, custom headers)
|
|
15
|
+
|
|
16
|
+
### 3. Local Storage
|
|
17
|
+
- SQLite queries → Room entities + DAOs
|
|
18
|
+
- SharedPreferences keys → DataStore schema
|
|
19
|
+
|
|
20
|
+
### 4. Repository
|
|
21
|
+
- Create interface in `domain/repository/`
|
|
22
|
+
- Implement in `data/repository/`
|
|
23
|
+
- Use Flow for reactive data streams
|
|
24
|
+
|
|
25
|
+
## Smali Reading Tips
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Finding API base URL:
|
|
29
|
+
const-string → "https://" or "http://"
|
|
30
|
+
.field → BASE_URL or API_URL
|
|
31
|
+
|
|
32
|
+
Finding endpoints:
|
|
33
|
+
StringBuilder + append patterns
|
|
34
|
+
Annotation patterns (@GET, @POST in obfuscated form)
|
|
35
|
+
|
|
36
|
+
Finding JSON parsing:
|
|
37
|
+
JSONObject, JSONArray usage
|
|
38
|
+
Gson.fromJson / TypeToken patterns
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
# Step 3: Core Logic & Utils Reconstruction 🧮
|
|
44
|
+
|
|
45
|
+
**Input:** Smali for encryption, hashing, time formatting, custom utils.
|
|
46
|
+
|
|
47
|
+
## Tasks
|
|
48
|
+
|
|
49
|
+
1. Translate mathematical/encryption logic from Smali → Kotlin
|
|
50
|
+
- Preserve exact input/output signatures (server compatibility)
|
|
51
|
+
- Use `object` for stateless utils, extension functions for type-specific
|
|
52
|
+
2. Map encoding patterns:
|
|
53
|
+
- MD5/SHA hashing → `MessageDigest`
|
|
54
|
+
- AES/DES encryption → `javax.crypto.Cipher`
|
|
55
|
+
- Base64 → `android.util.Base64` or `java.util.Base64`
|
|
56
|
+
- Custom obfuscation → reverse step-by-step
|
|
57
|
+
3. **Verification:** Unit tests comparing output with original app
|
|
58
|
+
|
|
59
|
+
> ⚠️ Encryption/hashing MUST produce identical output. Any mismatch breaks server communication.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
# Step 4: UI & ViewModel Reconstruction (Per Screen) 🎨
|
|
64
|
+
|
|
65
|
+
**Input:** `layout_xxx.xml` + Smali for Activity/Fragment.
|
|
66
|
+
|
|
67
|
+
## XML → Compose Migration
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
LinearLayout (vertical) → Column
|
|
71
|
+
LinearLayout (horizontal) → Row
|
|
72
|
+
FrameLayout → Box
|
|
73
|
+
RelativeLayout → Box with alignment
|
|
74
|
+
RecyclerView → LazyColumn / LazyGrid
|
|
75
|
+
ScrollView → verticalScroll modifier
|
|
76
|
+
ImageView → Image / AsyncImage (Coil)
|
|
77
|
+
TextView → Text
|
|
78
|
+
EditText → TextField / OutlinedTextField
|
|
79
|
+
Button → Button / TextButton
|
|
80
|
+
ProgressBar → CircularProgressIndicator
|
|
81
|
+
CardView → Card (Material 3)
|
|
82
|
+
Toolbar/ActionBar → TopAppBar (Material 3)
|
|
83
|
+
BottomNavigationView → NavigationBar (Material 3)
|
|
84
|
+
TabLayout + ViewPager → TabRow + HorizontalPager
|
|
85
|
+
SwipeRefreshLayout → pullRefresh modifier
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## ViewModel Pattern
|
|
89
|
+
|
|
90
|
+
```kotlin
|
|
91
|
+
sealed interface ScreenUiState {
|
|
92
|
+
data object Loading : ScreenUiState
|
|
93
|
+
data class Success(val data: ScreenData) : ScreenUiState
|
|
94
|
+
data class Error(val message: String) : ScreenUiState
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
- Expose via `StateFlow` from ViewModel
|
|
99
|
+
- Handle one-time events via `SharedFlow` (navigation, snackbar)
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
# Step 5-6: SDK Integration + Parity Check
|
|
104
|
+
|
|
105
|
+
## SDK Integration
|
|
106
|
+
|
|
107
|
+
1. Keep `.so` files in `jniLibs/`, declare `external fun` matching C/C++ signatures
|
|
108
|
+
2. Add latest stable versions to `build.gradle.kts`
|
|
109
|
+
3. Use Version Catalogs (`libs.versions.toml`)
|
|
110
|
+
4. Initialize in `@HiltAndroidApp Application` class
|
|
111
|
+
|
|
112
|
+
## Parity Check (Per-Module)
|
|
113
|
+
|
|
114
|
+
1. **Branch Coverage:** All `if-else`, `when`, `try-catch` paths from Smali
|
|
115
|
+
2. **API Parity:** Same request/response formats
|
|
116
|
+
3. **Data Parity:** Local storage read/write matches
|
|
117
|
+
4. **UI Parity:** Screen-by-screen comparison
|
|
118
|
+
5. **Performance:** R8 rules, Compose stability, coroutine scope management
|