@hungvv/super-ads-skills 1.0.0 → 1.1.0
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 +71 -13
- package/dist/cli.js +8 -2
- package/package.json +1 -1
- package/skills/README.md +4 -0
- package/skills/adspro-to-superads/SKILL.md +157 -732
- package/skills/adspro-to-superads/references/global-invariant-check.md +49 -0
- package/skills/adspro-to-superads/references/migration-contract.md +57 -0
- package/skills/adspro-to-superads/references/phase-0-inventory.md +39 -0
- package/skills/adspro-to-superads/references/phase-1-2-gradle-manifest.md +85 -0
- package/skills/adspro-to-superads/references/phase-3-config-migration.md +159 -0
- package/skills/adspro-to-superads/references/phase-4-wrapper-observability.md +70 -0
- package/skills/adspro-to-superads/references/phase-5-7-callsites-layout-cleanup.md +73 -0
- package/skills/adspro-to-superads/references/principles-and-authority.md +73 -0
- package/skills/adspro-to-superads/references/user-questions.md +53 -0
- package/skills/adspro-to-superads/snippets/ads-api-quick.md +20 -0
- package/skills/adspro-to-superads/templates/migration-inventory.md +42 -0
- package/skills/super-ads-ab-test/SKILL.md +91 -23
- package/skills/super-ads-adb-test/SKILL.md +85 -36
- package/skills/super-ads-adb-test/{references → examples}/scenarios-sample.md +5 -5
- package/skills/super-ads-add-placement/SKILL.md +145 -50
- package/skills/super-ads-add-placement/references/call-site-api.md +33 -0
- package/skills/super-ads-add-placement/snippets/app-open.md +25 -0
- package/skills/super-ads-add-placement/snippets/fullscreen-nav.md +14 -0
- package/skills/super-ads-add-placement/snippets/inline-banner-native.md +19 -0
- package/skills/super-ads-add-placement/snippets/preload-event.md +13 -0
- package/skills/super-ads-add-placement/snippets/reward.md +17 -0
- package/skills/super-ads-config/SKILL.md +94 -36
- package/skills/super-ads-debug/SKILL.md +87 -37
- package/skills/super-ads-debug/references/logging-setup.md +2 -0
- package/skills/super-ads-debug/scripts/filter-logads.sh +21 -0
- package/skills/super-ads-debug-override/SKILL.md +154 -81
- package/skills/super-ads-debug-override/snippets/arm-override.md +9 -0
- package/skills/super-ads-debug-override/snippets/check-module.md +8 -0
- package/skills/super-ads-debug-override/snippets/clear-override.md +9 -0
- package/skills/super-ads-debug-override/snippets/confirm-active.md +16 -0
- package/skills/super-ads-guide/SKILL.md +129 -0
- package/skills/super-ads-guide/references/compatibility.md +26 -0
- package/skills/super-ads-guide/references/sdk-version-check.md +50 -0
- package/skills/super-ads-integrate/SKILL.md +145 -47
- package/skills/super-ads-integrate/references/application-setup.md +2 -21
- package/skills/super-ads-integrate/references/gradle-setup.md +1 -13
- package/skills/super-ads-integrate/snippets/consent-request.md +12 -0
- package/skills/super-ads-integrate/templates/application-oncreate.md +17 -0
- package/skills/super-ads-integrate/templates/gradle-dependencies.md +17 -0
- package/skills/super-ads-release-check/SKILL.md +85 -32
- package/skills/super-ads-show-rate/SKILL.md +87 -36
- package/skills/super-ads-show-rate/references/collect-snippet.md +2 -36
- package/skills/super-ads-show-rate/scripts/show-rate.sh +25 -0
- package/skills/super-ads-show-rate/snippets/show-events-logger.md +26 -0
- package/skills/super-ads-upgrade/SKILL.md +137 -0
- package/skills/super-ads-upgrade/references/upgrade-hops.md +26 -0
- package/skills/super-ads-upgrade/templates/changelog-template.md +39 -0
- package/skills/super-ads-add-placement/references/call-site-snippets.md +0 -90
- /package/skills/super-ads-ab-test/{references → templates}/firebase-handoff-template.md +0 -0
- /package/skills/super-ads-config/{references → examples}/patch-examples.md +0 -0
|
@@ -1,61 +1,56 @@
|
|
|
1
1
|
---
|
|
2
2
|
schema: 1
|
|
3
3
|
name: super-ads-debug
|
|
4
|
-
description: Use when
|
|
5
|
-
version: 1.
|
|
4
|
+
description: Use when SuperAds ads do not show, fail to load, render wrong or crash - debug from logs to an error code
|
|
5
|
+
version: 1.2.0
|
|
6
6
|
group: Ads
|
|
7
|
+
superAds: ">=4.0.0 <5.0.0"
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
# Debug SuperAds
|
|
10
11
|
|
|
11
|
-
Quy trình **bằng chứng trước, kết luận sau**: không đoán nguyên nhân khi chưa có dòng log, event hoặc snapshot chứng minh.
|
|
12
|
-
|
|
13
|
-
| Bước | Tài liệu |
|
|
14
|
-
|---|---|
|
|
15
|
-
| Bật log, đọc log | [references/logging-setup.md](references/logging-setup.md) |
|
|
16
|
-
| Tra mã lỗi | [references/error-codes.md](references/error-codes.md) |
|
|
17
|
-
| Triệu chứng → bằng chứng | [references/symptom-playbook.md](references/symptom-playbook.md) |
|
|
18
|
-
| Ý nghĩa key config | `tools/ai_agent_tools/data/ads_key_knowledge.json` (bằng chứng: `tools/ai_agent_tools/docs/knowledge-evidence.md`) |
|
|
19
|
-
|
|
20
|
-
Viết tắt: `SA/` = `super-ads/src/main/java/com/android/fullhd/super_ads/`, `DBG/` = `super-ads-debug/src/main/java/com/android/fullhd/super_ads/debug/`.
|
|
12
|
+
Quy trình **bằng chứng trước, kết luận sau**: không đoán nguyên nhân khi chưa có dòng log, event hoặc snapshot chứng minh. Đi từ logcat / `.logads`, `Ads.debug` và overlay tới đúng mã lỗi và cách sửa.
|
|
21
13
|
|
|
22
14
|
## When to use
|
|
23
15
|
- Ad không hiện, hiện lúc có lúc không, load lỗi, hiện sai layout/màu/nút đóng, crash liên quan ads.
|
|
24
16
|
- Cần giải thích một `AdError` / mã lỗi cụ thể.
|
|
25
17
|
|
|
26
|
-
## When NOT to use
|
|
27
|
-
- Cần **đo tỷ lệ** show (show rate) →
|
|
28
|
-
- Cần viết hoặc chạy kịch bản test lặp lại trên thiết bị →
|
|
18
|
+
## 🚫 When NOT to use
|
|
19
|
+
- Cần **đo tỷ lệ** show (show rate) → [super-ads-show-rate](../super-ads-show-rate/SKILL.md).
|
|
20
|
+
- Cần viết hoặc chạy kịch bản test lặp lại trên thiết bị → [super-ads-adb-test](../super-ads-adb-test/SKILL.md).
|
|
29
21
|
- Thêm placement mới → `super-ads-add-placement`. App chưa có SuperAds → `super-ads-integrate`. App còn AdsPro → `adspro-to-superads`.
|
|
30
22
|
|
|
31
|
-
##
|
|
23
|
+
## 📋 Prerequisites
|
|
24
|
+
- Routing và kiểm version SDK: [super-ads-guide](../super-ads-guide/SKILL.md).
|
|
25
|
+
- Skill này nhắm SuperAds `>=4.0.0 <5.0.0`. App dùng SuperAds thấp hơn thì **dừng** và khuyến nghị (không ép) nâng cấp bằng [super-ads-upgrade](../super-ads-upgrade/SKILL.md) trước khi tiếp tục.
|
|
26
|
+
- Ít nhất một nguồn bằng chứng: file `.logads`, Logcat, hoặc log/bằng chứng do user cung cấp. Không tái hiện được mà cũng không có bằng chứng nào thì dừng (xem "Dừng và hỏi user khi" ở Workflow).
|
|
27
|
+
- Viết tắt: `SA/` = `super-ads/src/main/java/com/android/fullhd/super_ads/`, `DBG/` = `super-ads-debug/src/main/java/com/android/fullhd/super_ads/debug/`.
|
|
28
|
+
|
|
29
|
+
## ⚡ Quick Reference
|
|
30
|
+
| Cần | Mở |
|
|
31
|
+
|---|---|
|
|
32
|
+
| Bật log, đọc log, `name` log, file `.logads` | [references/logging-setup.md](references/logging-setup.md) |
|
|
33
|
+
| Tra mã lỗi | [references/error-codes.md](references/error-codes.md) |
|
|
34
|
+
| Triệu chứng → bằng chứng → nguyên nhân | [references/symptom-playbook.md](references/symptom-playbook.md) |
|
|
35
|
+
| Lọc nhanh file `.logads` (WARN trở lên, hoặc một `name`) | [scripts/filter-logads.sh](scripts/filter-logads.sh) |
|
|
36
|
+
| Ý nghĩa key config | `tools/ai_agent_tools/data/ads_key_knowledge.json` (bằng chứng: `tools/ai_agent_tools/docs/knowledge-evidence.md`) |
|
|
37
|
+
|
|
38
|
+
## 🏗️ Recommended Architecture
|
|
39
|
+
Thứ tự nguồn sự thật khi các nguồn mâu thuẫn:
|
|
32
40
|
1. Code SDK (`SA/…`, `DBG/…`).
|
|
33
41
|
2. `MIGRATION.md`.
|
|
34
42
|
3. Tri thức key (`ads_key_knowledge.json`; trường `confidence` khác `verified` là suy luận).
|
|
35
43
|
4. Tài liệu và KDoc khác. KDoc có thể đã cũ. Ví dụ: KDoc của `Ads.installDebug` ghi "không có auto-install", nhưng `DBG/DebugInstaller.kt:21-23` tự cài khi có dependency.
|
|
36
44
|
|
|
37
|
-
##
|
|
38
|
-
**MUST**
|
|
39
|
-
- Có bằng chứng (dòng log `SuperAdsSDK`, `AdShowEvent`, snapshot, callback `onAdFailed`) trước mỗi kết luận, và trích nó trong báo cáo.
|
|
40
|
-
- Phân loại lỗi theo `FailCategory` (`SA/api/debug/AdShowEvent.kt:97-127`): **blocked** (POLICY/CONFIG/INIT, SDK chủ động không show) khác **error** (LOAD/RENDER/BEHAVIOR/GMS/PRELOAD).
|
|
41
|
-
- Thống kê và so sánh theo `category + code`, không theo tên lỗi hay tên rule (tên rule có thể bị R8 đổi).
|
|
42
|
-
- Lỗi LOAD ở `onAdFailed` / `AdShowEvent.Failed` thường là 204, mã con nằm trong `message` ([error-codes.md](references/error-codes.md), mục "Cách đọc").
|
|
43
|
-
- Khi đổi key config: dẫn ý nghĩa và hiệu ứng từ file tri thức. `confidence` khác `verified` thì ghi "suy luận".
|
|
44
|
-
- Tái hiện lại sau khi sửa để xác nhận.
|
|
45
|
-
|
|
46
|
-
**MUST NOT**
|
|
47
|
-
- Không kết luận "SDK hỏng" khi Logcat trống: kiểm logger trước ([logging-setup.md](references/logging-setup.md) mục 1).
|
|
48
|
-
- Không coi blocked (vd 101 cooldown, 103 premium) là sự cố network.
|
|
49
|
-
- Không sửa config production, `Application`, hay file build khi user chưa đồng ý.
|
|
50
|
-
- Không tăng hay giảm `show.timeBetweenMs`, `load.timeoutMs`… theo cảm tính.
|
|
45
|
+
## Workflow
|
|
51
46
|
|
|
52
|
-
|
|
47
|
+
### Dừng và hỏi user khi
|
|
53
48
|
- Không tái hiện được và không có log hoặc bằng chứng nào từ user.
|
|
54
49
|
- Cách sửa đổi hành vi kinh doanh: tần suất ad, `show.maxShow`, tắt placement.
|
|
55
50
|
- Lỗi nằm trong SDK hoặc plugin (crash `RenderCrashed`/`LoadCrashExecute` có stacktrace trong SDK): báo kèm bằng chứng, không tự vá SDK.
|
|
56
51
|
- Cần bật logger hoặc thêm `super-ads-debug` vào app mà app chưa có.
|
|
57
52
|
|
|
58
|
-
|
|
53
|
+
### Phase 1: Bật quan sát
|
|
59
54
|
1. Tìm lời gọi `Ads.logger.init` trong `Application`. Chưa có, hoặc `enabled = false` / `debug = false`: hỏi user để bật ở bản debug ([logging-setup.md](references/logging-setup.md) mục 2).
|
|
60
55
|
2. Kiểm app có phụ thuộc `super-ads-debug` không (artifact `SuperAdsDebug` hoặc module `:super-ads-debug`).
|
|
61
56
|
- Có: SDK phát `Ads.debug.showEvents`, vì `DebugInstaller` tự cài (`DBG/DebugInstaller.kt:21-23`).
|
|
@@ -65,24 +60,24 @@ Viết tắt: `SA/` = `super-ads/src/main/java/com/android/fullhd/super_ads/`, `
|
|
|
65
60
|
|
|
66
61
|
**Verify:** file `.logads` có dòng lúc init (`ls cache/logads` bằng `run-as`), hoặc `adb logcat -s SuperAdsSDK:V` có dòng lúc init.
|
|
67
62
|
|
|
68
|
-
|
|
63
|
+
### Phase 2: Tái hiện và thu bằng chứng
|
|
69
64
|
- Thực hiện thao tác lỗi rồi lấy file `.logads` mới nhất (`adb exec-out run-as <pkg> cat cache/logads/<file>.logads > ads.logads`; định dạng và cách lọc ở [logging-setup.md](references/logging-setup.md) mục 6). Dự phòng bằng Logcat: `adb logcat -c`, rồi `adb logcat -v time -s SuperAdsSDK:V <AppTag>:V > ads.log` trước khi thao tác.
|
|
70
65
|
- Nếu có `super-ads-debug`:
|
|
71
66
|
- `Ads.debug.showEvents` cho vòng đời từng lần show: `Requested` → `Impression` hoặc `Failed(category, code)` (`SA/api/debug/AdShowEvent.kt`).
|
|
72
67
|
- `Ads.debug.snapshot()` cho showCount, cooldown, cache (`SA/api/AdsFeatures.kt:182-185`). **Không gọi trên main thread**, và hàm trả `null` khi SDK chưa init xong.
|
|
73
68
|
- Overlay: chuỗi phím âm lượng tăng, tăng, giảm, tăng, tăng (`DBG/detect/ActionChangeReceiver.kt:30-40`) hoặc `Ads.openDBBridge(context)` (`SA/api/Ads.kt:287`).
|
|
74
|
-
- Muốn chạy lặp lại có kịch bản thì dùng
|
|
69
|
+
- Muốn chạy lặp lại có kịch bản thì dùng [super-ads-adb-test](../super-ads-adb-test/SKILL.md).
|
|
75
70
|
|
|
76
71
|
**Verify:** có ít nhất một dòng log hoặc event gắn với placement đang lỗi. Không có thì quay lại Phase 1.
|
|
77
72
|
|
|
78
|
-
|
|
73
|
+
### Phase 3: Phân loại
|
|
79
74
|
1. Tìm dòng đầu tiên báo lỗi cho placement (`AdSFl … THẤT BẠI`, `RuleMg Block`, `ProviderTracker load thất bại`…). Định dạng lỗi: `TênLỗi -> [code = N, …]` (`SA/domain/error/AdError.kt:17`).
|
|
80
75
|
2. Tra [error-codes.md](references/error-codes.md) để biết nhóm và ý nghĩa.
|
|
81
76
|
3. Không có mã lỗi: đi theo [symptom-playbook.md](references/symptom-playbook.md).
|
|
82
77
|
|
|
83
78
|
**Verify:** viết được một câu theo dạng "placement X, lần show lúc T: <bằng chứng> → <nhóm>/<mã> → <nguyên nhân>".
|
|
84
79
|
|
|
85
|
-
|
|
80
|
+
### Phase 4: Sửa
|
|
86
81
|
| Nguyên nhân | Cách sửa |
|
|
87
82
|
|---|---|
|
|
88
83
|
| Config (placement, priority, key) | MCP `super-ads`: `read_working_config` → `validate_config` → `impact_of_patch` → `apply_patch` → `sync_to_source` (`tools/ai_agent_tools/AI_ADS_PLAYBOOK.md`). `impact_of_patch` trả `mustAsk=true` thì dừng, hỏi user nguyên văn từng `askReasons`; `mustAsk=false` vẫn phải được user duyệt đúng patch đó. Trước `sync_to_source`: kiểm `defaultSyncPath` (trong kết quả `read_working_config`) đúng là file config app nạp, nếu không thì truyền `targetPath` (mặc định có thể là `app/src/main/assets/tmp-*.json`, app không nạp file này). Hỏi user trước khi đổi tần suất hay giới hạn |
|
|
@@ -92,12 +87,46 @@ Viết tắt: `SA/` = `super-ads/src/main/java/com/android/fullhd/super_ads/`, `
|
|
|
92
87
|
|
|
93
88
|
**Verify:** tái hiện đúng thao tác cũ. Lỗi không còn, và có `adEventSink Impression` (`SA/show/AdEventRouter.kt:67`) hoặc `AdShowEvent.Impression`.
|
|
94
89
|
|
|
95
|
-
##
|
|
90
|
+
## 🔧 API Reference
|
|
91
|
+
Bảng tên log (`name`) và nguồn: [logging-setup.md](references/logging-setup.md) mục 4. Nhóm và mã lỗi: [error-codes.md](references/error-codes.md).
|
|
92
|
+
|
|
93
|
+
## ✅ Best Practices
|
|
94
|
+
- Có bằng chứng (dòng log `SuperAdsSDK`, `AdShowEvent`, snapshot, callback `onAdFailed`) trước mỗi kết luận, và trích nó trong báo cáo.
|
|
95
|
+
- Phân loại lỗi theo `FailCategory` (`SA/api/debug/AdShowEvent.kt:97-127`): **blocked** (POLICY/CONFIG/INIT, SDK chủ động không show) khác **error** (LOAD/RENDER/BEHAVIOR/GMS/PRELOAD).
|
|
96
|
+
- Thống kê và so sánh theo `category + code`, không theo tên lỗi hay tên rule (tên rule có thể bị R8 đổi).
|
|
97
|
+
- Lỗi LOAD ở `onAdFailed` / `AdShowEvent.Failed` thường là 204, mã con nằm trong `message` ([error-codes.md](references/error-codes.md), mục "Cách đọc").
|
|
98
|
+
- Khi đổi key config: dẫn ý nghĩa và hiệu ứng từ file tri thức. `confidence` khác `verified` thì ghi "suy luận".
|
|
99
|
+
- Tái hiện lại sau khi sửa để xác nhận.
|
|
100
|
+
|
|
101
|
+
## ❌ Anti-patterns
|
|
102
|
+
- Kết luận "SDK hỏng" khi Logcat trống: kiểm logger trước ([logging-setup.md](references/logging-setup.md) mục 1).
|
|
103
|
+
- Coi blocked (vd 101 cooldown, 103 premium) là sự cố network.
|
|
104
|
+
- Sửa config production, `Application`, hay file build khi user chưa đồng ý.
|
|
105
|
+
- Tăng hay giảm `show.timeBetweenMs`, `load.timeoutMs`… theo cảm tính.
|
|
96
106
|
- Grep tag Logcat `ReloadCoord`, `PrioChaiLo`… Đó là `name` trong message, tag luôn là `SuperAdsSDK`.
|
|
97
107
|
- Kết luận theo tên lỗi hay tên rule. Dùng `code` (tên rule trên bản release có thể đã bị R8 đổi).
|
|
98
108
|
- Thêm `try/catch` quanh `Ads.show` để "hết lỗi".
|
|
99
109
|
- Lấy giá trị key từ app khác hoặc từ playbook mà không đối chiếu tri thức key.
|
|
100
110
|
|
|
111
|
+
## ⚠️ Common Issues
|
|
112
|
+
**Logcat trống, không có dòng `SuperAdsSDK`.**
|
|
113
|
+
Cause: SDK không tự in log ra Logcat; logger chưa bật. Solution: kiểm logger ([logging-setup.md](references/logging-setup.md) mục 1), hoặc lấy file `.logads` (mục 6) vốn không phụ thuộc cờ đó.
|
|
114
|
+
|
|
115
|
+
**Không lấy được file `.logads`.**
|
|
116
|
+
Cause: bản release, không `run-as`. Solution: dùng Logcat (Phase 2).
|
|
117
|
+
|
|
118
|
+
**`onAdFailed` báo `204` mà không rõ nguyên nhân.**
|
|
119
|
+
Cause: lỗi LOAD của từng adItem bị gói lại. Solution: đọc mã con trong `message` ([error-codes.md](references/error-codes.md), mục "Cách đọc").
|
|
120
|
+
|
|
121
|
+
## Files created
|
|
122
|
+
Mặc định skill này không tạo file nào trong app; nó chỉ ghi file log về máy phân tích (`ads.logads`, `ads.log`).
|
|
123
|
+
|
|
124
|
+
## Files modified
|
|
125
|
+
Mặc định skill này không sửa file nào của app. Chỉ khi user đồng ý ở bước sửa mới có thay đổi: `Application` (bật `Ads.logger.init` ở bản debug), dependency `super-ads-debug` hoặc plugin network, file config qua MCP `super-ads` (patch đã được duyệt), hoặc call site theo `super-ads-add-placement`.
|
|
126
|
+
|
|
127
|
+
## Verification
|
|
128
|
+
Mỗi phase có dòng **Verify** riêng ở Workflow. Kết luận chỉ hợp lệ khi: có bằng chứng gắn với placement lỗi, đã phân loại theo nhóm và mã, và đã tái hiện lại thao tác cũ sau khi sửa (Phase 4).
|
|
129
|
+
|
|
101
130
|
## Checklist
|
|
102
131
|
- [ ] Logger bật, có log init.
|
|
103
132
|
- [ ] Đã xác nhận config đang chạy (`global.version`).
|
|
@@ -105,5 +134,26 @@ Viết tắt: `SA/` = `super-ads/src/main/java/com/android/fullhd/super_ads/`, `
|
|
|
105
134
|
- [ ] Nhóm và mã lỗi đúng theo `error-codes.md`.
|
|
106
135
|
- [ ] Đã tái hiện sau khi sửa.
|
|
107
136
|
|
|
137
|
+
## 📈 Performance Notes
|
|
138
|
+
> **Not applicable for this skill.**
|
|
139
|
+
|
|
140
|
+
## 🔒 Security Notes
|
|
141
|
+
> **Not applicable for this skill.**
|
|
142
|
+
|
|
143
|
+
## 🔄 Migration Guide
|
|
144
|
+
> **Not applicable for this skill.**
|
|
145
|
+
|
|
108
146
|
## Output
|
|
109
147
|
Báo cáo gồm: triệu chứng; bằng chứng (trích log hoặc event); nhóm và mã; nguyên nhân; thay đổi đã làm (file hoặc patch); kết quả tái hiện lại; phần chưa xác minh (vd chưa chạy trên thiết bị thật).
|
|
148
|
+
|
|
149
|
+
## Examples
|
|
150
|
+
- Câu kết luận mẫu (Phase 3): "placement X, lần show lúc T: <bằng chứng> → <nhóm>/<mã> → <nguyên nhân>".
|
|
151
|
+
- Bảng triệu chứng → bằng chứng → nguyên nhân: [references/symptom-playbook.md](references/symptom-playbook.md).
|
|
152
|
+
|
|
153
|
+
## 📚 References
|
|
154
|
+
- [super-ads-guide](../super-ads-guide/SKILL.md), [super-ads-upgrade](../super-ads-upgrade/SKILL.md)
|
|
155
|
+
- [super-ads-show-rate](../super-ads-show-rate/SKILL.md), [super-ads-adb-test](../super-ads-adb-test/SKILL.md), [super-ads-debug-override](../super-ads-debug-override/SKILL.md)
|
|
156
|
+
- `MIGRATION.md`, `tools/ai_agent_tools/AI_ADS_PLAYBOOK.md`, `tools/ai_agent_tools/data/ads_key_knowledge.json`
|
|
157
|
+
|
|
158
|
+
## 🏷️ Tags
|
|
159
|
+
`superads` `debug` `logcat` `logads` `error-code` `diagnose`
|
|
@@ -148,6 +148,8 @@ awk '$2=="WARN" || $2=="ERROR" || $2=="ERROR_AND_CRASH"' ads.logads
|
|
|
148
148
|
grep -E "^[0-9:.]+ [A-Z_ ]+ ProviderTracker " ads.logads
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
+
Đã đóng gói sẵn hai phép lọc trên: [../scripts/filter-logads.sh](../scripts/filter-logads.sh) `ads.logads` (chỉ WARN trở lên) hoặc `ads.logads <name>` (một `name`).
|
|
152
|
+
|
|
151
153
|
**Giới hạn.**
|
|
152
154
|
- Chỉ ghi log ≥ `LogConfig.minLevel` (mặc định `FLOW` = nhận hết) (`SA/domain/model/log/LogConfig.kt:7-8`).
|
|
153
155
|
- Ghi bất đồng bộ qua hàng đợi 1024 dòng; tràn thì **bỏ dòng cũ nhất**. `isFileRecordingEnabled()` trả `true` không bảo đảm dòng cuối đã xuống đĩa.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Lọc file log `.logads` của SuperAds (định dạng: references/logging-setup.md mục 6).
|
|
3
|
+
#
|
|
4
|
+
# Cách dùng:
|
|
5
|
+
# filter-logads.sh <file.logads> # chỉ dòng WARN, ERROR, ERROR_AND_CRASH
|
|
6
|
+
# filter-logads.sh <file.logads> <name> # chỉ dòng của một `name`, vd ProviderTracker
|
|
7
|
+
#
|
|
8
|
+
# Cột cách nhau bằng hai dấu cách: `HH:mm:ss.SSS LEVEL name k=v ...`.
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
if [ "$#" -lt 1 ] || [ "$#" -gt 2 ] || [ ! -f "$1" ]; then
|
|
12
|
+
sed -n '2,8p' "$0" | sed 's/^# \{0,1\}//' >&2
|
|
13
|
+
exit 2
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
file=$1
|
|
17
|
+
if [ "$#" -eq 1 ]; then
|
|
18
|
+
awk '$2=="WARN" || $2=="ERROR" || $2=="ERROR_AND_CRASH"' "$file"
|
|
19
|
+
else
|
|
20
|
+
grep -E "^[0-9:.]+ [A-Z_ ]+ $2 " "$file" || true
|
|
21
|
+
fi
|
|
@@ -1,117 +1,156 @@
|
|
|
1
1
|
---
|
|
2
2
|
schema: 1
|
|
3
3
|
name: super-ads-debug-override
|
|
4
|
-
description: Use when a debug build must run once with a SuperAds config
|
|
5
|
-
version: 1.
|
|
4
|
+
description: Use when a debug build must run once with a SuperAds config other than its asset - arm, relaunch, test, clear
|
|
5
|
+
version: 1.2.0
|
|
6
6
|
group: Ads
|
|
7
|
+
superAds: ">=4.0.0 <5.0.0"
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
# Chạy bản debug với config khác asset, cho một lần khởi động
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
| Cần | Tài liệu |
|
|
14
|
-
|---|---|
|
|
15
|
-
| Cài module, cơ chế khoá, các bảng kiểm, giới hạn | [references/hook-implementation.md](references/hook-implementation.md) |
|
|
16
|
-
| Chuẩn bị JSON qua MCP | `super-ads-config` |
|
|
17
|
-
| Kịch bản kiểm, đọc log | `super-ads-adb-test` |
|
|
18
|
-
|
|
19
|
-
Ví dụ dưới dùng app mẫu: `P=com.android.hd.ads2026`. App khác: thay `P` bằng applicationId của bản debug.
|
|
12
|
+
Arm một file JSON bằng broadcast adb, mở lại app để SDK nạp nó thay config gốc, xác nhận bằng log, chạy test, rồi clear. Config bị **khoá** suốt lần chạy đó.
|
|
20
13
|
|
|
21
14
|
## When to use
|
|
15
|
+
|
|
22
16
|
- Kịch bản `super-ads-adb-test` cần config khác asset (cooldown, reload, tắt placement…).
|
|
23
17
|
- Thử một patch trên máy trước khi `sync_to_source`.
|
|
24
18
|
|
|
25
|
-
## When NOT to use
|
|
19
|
+
## 🚫 When NOT to use
|
|
20
|
+
|
|
26
21
|
- Bản release: không có receiver, broadcast không tới đâu.
|
|
27
22
|
- App chưa khai module: Stop, chỉ dẫn user theo [hook-implementation.md](references/hook-implementation.md) và hỏi trước khi thêm dòng `debugImplementation` (thêm dependency).
|
|
28
|
-
- Muốn đổi config thật của app →
|
|
23
|
+
- Muốn đổi config thật của app → [super-ads-config](../super-ads-config/SKILL.md).
|
|
29
24
|
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
## 📋 Prerequisites
|
|
26
|
+
|
|
27
|
+
- Định tuyến skill và kiểm version SDK: [super-ads-guide](../super-ads-guide/SKILL.md).
|
|
28
|
+
- Quy tắc version: skill này nhắm SuperAds `>=4.0.0 <5.0.0`. Nếu app dùng SuperAds thấp hơn, dừng lại và khuyến nghị (không ép) nâng cấp bằng [super-ads-upgrade](../super-ads-upgrade/SKILL.md) trước khi tiếp tục.
|
|
29
|
+
- App khai module `SuperAdsDebugOverride` bằng `debugImplementation` (app mẫu: `app/build.gradle:81`). Module này thuộc **bộ nền** của mọi app (cùng `SuperAds`, `SuperAdsInHouse`, `SuperAdsDebug`).
|
|
30
|
+
- Bản đang cài là bản debug (debuggable), nếu không ARM trả `REJECTED:not_debuggable`.
|
|
31
|
+
- JSON đã qua `validate_config` (chuẩn bị bằng [super-ads-config](../super-ads-config/SKILL.md)).
|
|
32
|
+
- Máy không bị phiên / workflow khác dùng cùng app.
|
|
33
|
+
- Ví dụ dùng app mẫu: `P=com.android.hd.ads2026`. App khác: thay `P` bằng applicationId của bản debug.
|
|
34
|
+
|
|
35
|
+
## ⚡ Quick Reference
|
|
36
|
+
|
|
37
|
+
| Cần | Mở |
|
|
38
|
+
|---|---|
|
|
39
|
+
| Cài module, cơ chế khoá, bảng kiểm, giới hạn | [references/hook-implementation.md](references/hook-implementation.md) |
|
|
40
|
+
| Kiểm module có trong merged manifest | [snippets/check-module.md](snippets/check-module.md) |
|
|
41
|
+
| Push JSON và ARM | [snippets/arm-override.md](snippets/arm-override.md) |
|
|
42
|
+
| Mở lại, xác nhận bằng log | [snippets/confirm-active.md](snippets/confirm-active.md) |
|
|
43
|
+
| Dọn, về asset | [snippets/clear-override.md](snippets/clear-override.md) |
|
|
44
|
+
| Chuẩn bị JSON qua MCP | [super-ads-config](../super-ads-config/SKILL.md) |
|
|
45
|
+
| Kịch bản kiểm, đọc log | [super-ads-adb-test](../super-ads-adb-test/SKILL.md) |
|
|
41
46
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
## 🏗️ Recommended Architecture
|
|
48
|
+
|
|
49
|
+
Module `SuperAdsDebugOverride` nạp một file JSON thay config gốc cho **đúng một lần khởi động**, chỉ khi adb đã gửi broadcast `OVERRIDE_ARM`, và **khoá** config suốt lần chạy đó: `Ads.loadFromJson`, remote refresh, `reload` trực tiếp đều bị bỏ qua. Không có broadcast thì app chạy y như thường; bản release không có module. Luôn khai bằng `debugImplementation`. Cơ chế và các cổng bị khoá: [hook-implementation.md](references/hook-implementation.md).
|
|
50
|
+
|
|
51
|
+
## Workflow
|
|
52
|
+
|
|
53
|
+
### Stop conditions (dừng và hỏi user)
|
|
47
54
|
|
|
48
|
-
## Stop conditions (dừng và hỏi user)
|
|
49
55
|
- Merged manifest bản debug không có `ConfigOverrideReceiver`.
|
|
50
56
|
- `am broadcast` trả `result=0` mà **không** có `data=` (receiver không chạy), hoặc `REJECTED:<lý do>`. Bảng lý do: [hook-implementation.md](references/hook-implementation.md).
|
|
51
57
|
- Sau khi mở lại có `Bỏ override, dùng config gốc: <lý do>` thay vì `ĐANG DÙNG`.
|
|
52
58
|
- Có `ĐANG DÙNG` nhưng thiếu log khoá của core, hoặc `ConfigUpdate` không mang version/fingerprint của override.
|
|
53
59
|
- Máy đang bị tiến trình / workflow khác dùng.
|
|
54
60
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
**Verify:** kết quả ≥ 1. Bằng 0 ⇒ Stop. Bản đang cài phải là bản debug (debuggable); không thì ARM trả `REJECTED:not_debuggable`.
|
|
61
|
+
### 1. Kiểm module
|
|
62
|
+
|
|
63
|
+
Chạy [snippets/check-module.md](snippets/check-module.md). Bản đang cài phải là bản debug (debuggable); không thì ARM trả `REJECTED:not_debuggable`.
|
|
64
|
+
|
|
65
|
+
### 2. Chuẩn bị JSON
|
|
61
66
|
|
|
62
|
-
|
|
63
|
-
1. `read_working_config` → lấy `config` (production projection), hoặc soạn qua `super-ads-config` (đến bước `validate_config`, **chưa** `sync_to_source`).
|
|
67
|
+
1. `read_working_config` → lấy `config` (production projection), hoặc soạn qua [super-ads-config](../super-ads-config/SKILL.md) (đến bước `validate_config`, **chưa** `sync_to_source`).
|
|
64
68
|
2. `validate_config {config}` không có error. Đặt `global.version` dễ nhận (vd `override-s1`).
|
|
65
69
|
3. Ghi ra file cục bộ, `sha256sum <file>`.
|
|
66
70
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
71
|
+
### 3. Push và ARM
|
|
72
|
+
|
|
73
|
+
Chạy [snippets/arm-override.md](snippets/arm-override.md). Broadcast tới được cả khi app đang force-stop (đã kiểm trên Pixel 5).
|
|
74
|
+
|
|
75
|
+
### 4. Mở lại, xác nhận
|
|
76
|
+
|
|
77
|
+
Chạy [snippets/confirm-active.md](snippets/confirm-active.md). Hạn ARM: 10 phút (`super-ads-debug-override/src/main/java/com/android/fullhd/super_ads/debugoverride/DebugConfigOverride.kt:31`). `.logads` cần bản debuggable với `isDebug = true` (tự bật ghi file) hoặc đã bật switch "Record Log To File"; không lấy được file thì đọc bằng Logcat: `adb logcat -d | grep -E 'SuperAdsOverride|CONFIG OVERRIDE|ConfigUpdate'` (cần bật log SDK).
|
|
78
|
+
|
|
79
|
+
### 5. Chạy test
|
|
80
|
+
|
|
81
|
+
Theo [super-ads-adb-test](../super-ads-adb-test/SKILL.md). Không force-stop / mở lại app giữa chừng: lần mở sau đã về asset.
|
|
82
|
+
|
|
83
|
+
Lấy log kịch bản bằng `.logads` của lần chạy này (cùng cách Bước 4); app không bị khởi động lại nên vẫn là một file.
|
|
84
|
+
|
|
85
|
+
### 6. Dọn
|
|
86
|
+
|
|
87
|
+
Chạy [snippets/clear-override.md](snippets/clear-override.md).
|
|
88
|
+
|
|
89
|
+
## 🔧 API Reference
|
|
90
|
+
|
|
91
|
+
| Hành động | Lệnh / dấu hiệu | Kết quả mong đợi |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| ARM | `am broadcast -a $P.OVERRIDE_ARM` tới `ConfigOverrideReceiver` | `data="ARMED fileSha256=<sha> fingerprint=<f> version=<v>"` |
|
|
94
|
+
| CLEAR | `am broadcast -a $P.OVERRIDE_CLEAR` tới `ConfigOverrideReceiver` | `data="CLEARED"` |
|
|
95
|
+
| Từ chối | ARM không hợp lệ | `REJECTED:<lý do>`; bảng lý do trong [hook-implementation.md](references/hook-implementation.md) |
|
|
96
|
+
| Log module (tag `SuperAdsOverride`) | `ARMED`, `ĐANG DÙNG`, `Bỏ override` | Chỉ ở Logcat |
|
|
97
|
+
| Log core | `CONFIG OVERRIDE (debug) đang dùng`, `config đang khoá … → bỏ qua`, `ConfigUpdate` | Ở file `.logads` |
|
|
98
|
+
|
|
99
|
+
## ✅ Best Practices
|
|
100
|
+
|
|
101
|
+
- Bật **chỉ** bằng broadcast `OVERRIDE_ARM`. File armed chỉ do receiver ghi.
|
|
102
|
+
- Mỗi lần khởi động muốn dùng override phải ARM lại: lần khởi động lạnh đầu tiên tiêu thụ và xoá file armed (JSON còn, không cần push lại nếu không đổi). Process còn sống sau ARM (receiver vừa khởi động nó) thì mở app sẽ dùng lại process đó, không tiêu thụ ⇒ luôn `force-stop` trước khi mở.
|
|
103
|
+
- Log có **hai nguồn**, đọc đúng nguồn: dòng của module (tag `SuperAdsOverride`: `ARMED`, `ĐANG DÙNG`, `Bỏ override`) dùng `android.util.Log` ⇒ **chỉ có ở Logcat** (`super-ads-debug-override/src/main/java/com/android/fullhd/super_ads/debugoverride/DebugConfigOverride.kt:86`). Dòng của core (`CONFIG OVERRIDE (debug) đang dùng`, `config đang khoá … → bỏ qua`) đi qua `SdkLog` ⇒ có ở file **`.logads`** (`super-ads/src/main/java/com/android/fullhd/super_ads/runtime/SdkRuntime.kt:381`; cách lấy và lọc: [logging-setup.md](../super-ads-debug/references/logging-setup.md) mục 6).
|
|
104
|
+
- Xác nhận override có hiệu lực bằng log, không bằng cảm giác:
|
|
105
|
+
- `ARMED fileSha256=<x>` khớp `sha256sum` của file đã push;
|
|
106
|
+
- sau khi mở lại: `CONFIG OVERRIDE ĐANG DÙNG — config khoá · fingerprint=<f>` (tag `SuperAdsOverride`) với `<f>` khớp `fingerprint` lúc ARM, và log core `CONFIG OVERRIDE (debug) đang dùng — config khoá`;
|
|
107
|
+
- `ConfigUpdate` (trong `.logads`) mang `version=<global.version của override>` và `fingerprint` khớp lúc ARM.
|
|
108
|
+
- Xong việc: `OVERRIDE_CLEAR`, mở lại app, xác nhận không còn log `SuperAdsOverride` và đã về asset.
|
|
109
|
+
- Ghi vào báo cáo: kết quả nào chạy với override (fingerprint, `global.version`).
|
|
110
|
+
|
|
111
|
+
## ❌ Anti-patterns
|
|
112
|
+
|
|
113
|
+
- Tự ghi file `superads_override.armed` bằng tay (kể cả để "tiết kiệm bước").
|
|
114
|
+
- Coi log `config đang khoá (override debug) → bỏ qua …` là lỗi của app: đó là SDK chặn đúng một lần ghi đè. Ghi vào báo cáo cổng nào bị chặn (kết quả phụ thuộc lời gọi đó thì không đại diện cho production).
|
|
115
|
+
- Dùng override khi máy đang có phiên khác thao tác cùng app (force-stop của bạn sẽ chen vào, và app của họ sẽ chạy config của bạn).
|
|
116
|
+
- Push JSON chưa qua `validate_config`.
|
|
110
117
|
- ARM một lần rồi chạy nhiều kịch bản có force-stop ở giữa, tưởng vẫn dùng override.
|
|
111
118
|
- So sha256 của file với `fingerprint`: hai giá trị khác nhau (fingerprint tính trên JSON SDK serialize lại).
|
|
112
119
|
- Dùng override để "sửa" config cho người khác test.
|
|
113
120
|
|
|
121
|
+
## ⚠️ Common Issues
|
|
122
|
+
|
|
123
|
+
**`am broadcast` trả `result=0` mà không có `data=`.**
|
|
124
|
+
Cause: receiver không chạy. Solution: Stop; kiểm merged manifest (Bước 1) rồi hỏi user.
|
|
125
|
+
|
|
126
|
+
**`REJECTED:<lý do>`.**
|
|
127
|
+
Cause: JSON hoặc app không đạt kiểm lúc ARM (ví dụ `not_debuggable`, `missing_json`, `json_blank`, `json_invalid:*`, `sdk_rejected`). Solution: sửa theo bảng trong [hook-implementation.md](references/hook-implementation.md), ARM lại.
|
|
128
|
+
|
|
129
|
+
**Mở lại thấy `Bỏ override, dùng config gốc: <lý do>` thay vì `ĐANG DÙNG`.**
|
|
130
|
+
Cause: `consume` từ chối (armed hỏng / hết hạn, thiếu JSON, JSON đổi sau ARM…). Solution: Stop; bảng `consume` trong [hook-implementation.md](references/hook-implementation.md), ARM lại.
|
|
131
|
+
|
|
132
|
+
## Files created
|
|
133
|
+
|
|
134
|
+
- Trên máy dev: JSON override cục bộ (`cfg.json`), `ovr.logads` (log lần chạy).
|
|
135
|
+
- Trên thiết bị (trong `files/` của app): `superads_override.json` (do bạn push) và `superads_override.armed` (chỉ receiver ghi). `OVERRIDE_CLEAR` xoá cả hai.
|
|
136
|
+
|
|
137
|
+
## Files modified
|
|
138
|
+
|
|
139
|
+
- Không sửa file nào của repo app. Ngoại lệ: dòng `debugImplementation` khi app chưa khai module, và chỉ sau khi user đồng ý (thêm dependency, xem [hook-implementation.md](references/hook-implementation.md)).
|
|
140
|
+
|
|
141
|
+
## Verification
|
|
142
|
+
|
|
143
|
+
Báo output thật. Sau mỗi bước ở Workflow:
|
|
144
|
+
|
|
145
|
+
1. **Kiểm module:** kết quả ≥ 1. Bằng 0 ⇒ Stop.
|
|
146
|
+
2. **Chuẩn bị JSON:** có file, sha256, `global.version`.
|
|
147
|
+
3. **Push và ARM:** dòng cuối `Broadcast completed: result=0, data="ARMED fileSha256=<sha> fingerprint=<f> version=<v>"`, `<sha>` khớp Bước 2.
|
|
148
|
+
4. **Mở lại, xác nhận:** Logcat có `CONFIG OVERRIDE ĐANG DÙNG — config khoá · fingerprint=<f>`; `ovr.logads` có `CONFIG OVERRIDE (debug) đang dùng` và dòng `ConfigUpdate` với `version=<global.version của override>` và `fingerprint` **trùng** `fingerprint` lúc ARM (SDK ghi dòng này mỗi lần nạp config).
|
|
149
|
+
5. **Chạy test:** ghi lại mọi dòng `config đang khoá (override debug) → bỏ qua …` trong `.logads` (cổng nào đã bị chặn).
|
|
150
|
+
6. **Dọn:** `data="CLEARED"`; `adb shell run-as $P ls files` không còn `superads_override.*`; mở lại: Logcat không có `SuperAdsOverride`, `.logads` mới không có `CONFIG OVERRIDE`, `ConfigUpdate` về version của asset.
|
|
151
|
+
|
|
114
152
|
## Checklist
|
|
153
|
+
|
|
115
154
|
- [ ] Receiver của module có trong merged manifest debug.
|
|
116
155
|
- [ ] JSON qua `validate_config`, có sha256 và `global.version`.
|
|
117
156
|
- [ ] `ARMED`, sha khớp.
|
|
@@ -119,5 +158,39 @@ adb shell am start -n $P/.MainActivity
|
|
|
119
158
|
- [ ] Test xong, đã ghi các cổng bị chặn (nếu có).
|
|
120
159
|
- [ ] `CLEARED`, đã về asset.
|
|
121
160
|
|
|
161
|
+
## 📈 Performance Notes
|
|
162
|
+
|
|
163
|
+
> **Not applicable for this skill.**
|
|
164
|
+
|
|
165
|
+
## 🔒 Security Notes
|
|
166
|
+
|
|
167
|
+
- Receiver `ConfigOverrideReceiver` được export để adb shell gửi được và không đòi permission; vì vậy module **chỉ** khai bằng `debugImplementation`. Bản release không có provider, receiver, class nào của module ([hook-implementation.md](references/hook-implementation.md)).
|
|
168
|
+
- App không debuggable: ARM trả `REJECTED:not_debuggable`, installer không cài override.
|
|
169
|
+
- Không dùng override khi máy đang có phiên khác thao tác cùng app.
|
|
170
|
+
|
|
171
|
+
## 🔄 Migration Guide
|
|
172
|
+
|
|
173
|
+
> **Not applicable for this skill.**
|
|
174
|
+
|
|
122
175
|
## Output
|
|
176
|
+
|
|
123
177
|
JSON đã dùng (đường dẫn, sha256, fingerprint, `global.version`), log ARM / ACTIVE / CLEAR nguyên văn, kết quả test, phần chưa xác minh.
|
|
178
|
+
|
|
179
|
+
## Examples
|
|
180
|
+
|
|
181
|
+
- Push và ARM: [snippets/arm-override.md](snippets/arm-override.md)
|
|
182
|
+
- Mở lại, xác nhận: [snippets/confirm-active.md](snippets/confirm-active.md)
|
|
183
|
+
- Dọn: [snippets/clear-override.md](snippets/clear-override.md)
|
|
184
|
+
- Các ca đã kiểm trên Pixel 5 (mở bình thường, ARM, từ chối, CLEAR, release): [references/hook-implementation.md](references/hook-implementation.md)
|
|
185
|
+
|
|
186
|
+
## 📚 References
|
|
187
|
+
|
|
188
|
+
- [super-ads-guide](../super-ads-guide/SKILL.md): định tuyến, kiểm version SDK.
|
|
189
|
+
- [super-ads-upgrade](../super-ads-upgrade/SKILL.md): nâng cấp SuperAds.
|
|
190
|
+
- [super-ads-config](../super-ads-config/SKILL.md), [super-ads-adb-test](../super-ads-adb-test/SKILL.md), [super-ads-debug](../super-ads-debug/SKILL.md).
|
|
191
|
+
- Log và `.logads`: [logging-setup.md](../super-ads-debug/references/logging-setup.md).
|
|
192
|
+
- Repo SDK: `MIGRATION.md`.
|
|
193
|
+
|
|
194
|
+
## 🏷️ Tags
|
|
195
|
+
|
|
196
|
+
`superads`, `debug`, `override`, `adb`, `broadcast`, `config`
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Push JSON và ARM
|
|
2
|
+
|
|
3
|
+
> `P` = applicationId của bản debug (app mẫu: `P=com.android.hd.ads2026`). Đặt biến này trước khi chạy.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
adb push cfg.json /data/local/tmp/ovr.json
|
|
7
|
+
adb shell "run-as $P sh -c 'cp /data/local/tmp/ovr.json files/superads_override.json'"
|
|
8
|
+
adb shell am broadcast -n $P/com.android.fullhd.super_ads.debugoverride.ConfigOverrideReceiver -a $P.OVERRIDE_ARM
|
|
9
|
+
```
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Kiểm module có trong merged manifest debug
|
|
2
|
+
|
|
3
|
+
> `P` = applicationId của bản debug (app mẫu: `P=com.android.hd.ads2026`). Đặt biến này trước khi chạy.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
./gradlew :app:processDebugManifest
|
|
7
|
+
grep -c 'debugoverride.ConfigOverrideReceiver' app/build/intermediates/merged_manifests/debug/processDebugManifest/AndroidManifest.xml
|
|
8
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Dọn override và về asset
|
|
2
|
+
|
|
3
|
+
> `P` = applicationId của bản debug (app mẫu: `P=com.android.hd.ads2026`). Đặt biến này trước khi chạy.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
adb shell am broadcast -n $P/com.android.fullhd.super_ads.debugoverride.ConfigOverrideReceiver -a $P.OVERRIDE_CLEAR
|
|
7
|
+
adb shell am force-stop $P
|
|
8
|
+
adb shell am start -n $P/.MainActivity
|
|
9
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Mở lại app và xác nhận override đang dùng
|
|
2
|
+
|
|
3
|
+
> `P` = applicationId của bản debug (app mẫu: `P=com.android.hd.ads2026`). Đặt biến này trước khi chạy.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
adb logcat -c
|
|
7
|
+
adb shell am force-stop $P
|
|
8
|
+
adb shell am start -n $P/.MainActivity
|
|
9
|
+
sleep 5
|
|
10
|
+
# Logcat: log của module override
|
|
11
|
+
adb logcat -d -s SuperAdsOverride:V
|
|
12
|
+
# .logads: log của core (file mới nhất = lần chạy vừa mở)
|
|
13
|
+
F=$(adb shell run-as $P ls -t cache/logads | head -1 | tr -d '\r')
|
|
14
|
+
adb exec-out run-as $P cat cache/logads/$F > ovr.logads
|
|
15
|
+
grep -E 'CONFIG OVERRIDE|config đang khoá|ConfigUpdate' ovr.logads
|
|
16
|
+
```
|