Created
December 28, 2025 09:30
-
-
Save xArieN9x/37fe20045bbe8f8869f348c0b0a389ca to your computer and use it in GitHub Desktop.
CB baru
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| **Faham, Pakya.** Saya akan wrap semua sebagai **blueprint lengkap** untuk bina app CB (CedokBooster) **dari scratch**. Ini adalah **dokumen teknikal lengkap** untuk developer baru. | |
| --- | |
| # ๐๏ธ **CEDOKBOOSTER (CB) - BLUEPRINT LENGKAP** | |
| ## ๐ฑ **1. UI/UX DESIGN (Layout & Flow)** | |
| ### **UI UTAMA (`activity_main.xml`)** | |
| ``` | |
| โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| โ CedokBooster โ โ Title (tengah atas) | |
| โ โ | |
| โ Public IP: [192.168.1.1] โ โ Auto-fetch IP semasa | |
| โ โ | |
| โ CoreEngine: [Active/Disabled] โ โ Status CoreEngine | |
| โ โ | |
| โ ๐ด ๐ก ๐ข โ โ Indicator (red/yellow/green) | |
| โ โ | |
| โ [DO ALL JOB] โ โ Button utama (hijau besar) | |
| โ โ | |
| โ โโโโโโโโโโโโโโโโโโโโโโโโโ โ โ Garisan pemisah | |
| โ โ | |
| โ Quick Controls โ โ Label | |
| โ โ | |
| โ [ON A] [ON ACS] โ โ Baris atas | |
| โ Accessibility โ โ Label kecil bawah ON ACS | |
| โ โ | |
| โ [ON B] [OFF] โ โ Baris bawah | |
| โ โ | |
| โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| ``` | |
| ### **FLOATING WIDGET (`widget_layout.xml`)** | |
| - **Bubble floating** di atas semua app | |
| - **Warna**: Hijau (aktif), Merah (tak aktif) | |
| - **Text**: "CB" | |
| - **Function**: Drag & click untuk buka app utama | |
| --- | |
| ## โ๏ธ **2. CORE ENGINE ARCHITECTURE** | |
| ### **OBJEKTIF UTAMA** | |
| > "Condition network supaya sentiasa dalam keadaan **PANAS & READY** seperti YouTube streaming, tanpa sentuh payload traffic." | |
| ### **KOMPONEN UTAMA** | |
| #### **A. NETWORK LAYER** | |
| ```kotlin | |
| // Fungsi utama: | |
| 1. DNS Changer System-Wide | |
| - Button A โ DNS: 156.154.70.1 (custom/stable) | |
| - Button B โ DNS: 1.1.1.1 (fallback) | |
| - Button OFF โ Restore default DNS | |
| 2. Network Conditioning (YouTube-style) | |
| - Kekalkan radio LTE/WiFi ACTIVE (elak aggressive idle) | |
| - Periodic keep-alive requests (setiap 30 saat) | |
| - Elak TCP cold start & DNS cache reset | |
| - Refresh semua socket bila restart/DAJ | |
| ``` | |
| #### **B. SYSTEM LAYER** | |
| ```kotlin | |
| // Fungsi utama: | |
| 1. WakeLock Management | |
| - Partial wakelock untuk elak CPU tidur | |
| - Auto-release selepas 1 jam | |
| 2. Service Stability | |
| - Foreground service dengan notification | |
| - AnchorService untuk kekal hidup | |
| - Elak system kill app | |
| ``` | |
| #### **C. GPS LAYER** (Realme C3 Android 10) | |
| ```kotlin | |
| // Fungsi utama: | |
| 1. GPS Signal Booster | |
| - Request high-accuracy location updates | |
| - "Panaskan" GPS receiver (mimik ActiveGPS app) | |
| 2. App-Specific GPS Lock | |
| - Lock app target pada signal GPS kuat | |
| - Accuracy threshold: < 25 meter | |
| - Notification status: "GPS: stabilizing..." โ "GPS LOC: Active" | |
| 3. Real Implementation | |
| - LocationManager dengan high-frequency updates | |
| - Auto-lock bila signal stabil | |
| - Broadcast GPS_LOCK_ACHIEVED untuk trigger automasi | |
| ``` | |
| --- | |
| ## ๐ฎ **3. BUTTON FUNCTIONALITY** | |
| ### **SEQUENCE OPERASI (WAJIB)** | |
| 1. **ON ACS** โ Enable Accessibility Service dulu (mandatory) | |
| 2. **ON A** atau **ON B** โ Start CoreEngine dengan DNS pilihan | |
| 3. **DO ALL JOB** โ Refresh/ulang proses dengan DNS aktif | |
| 4. **OFF** โ Stop semua service & restore default | |
| ### **DETAIL SETIAP BUTTON** | |
| #### **BUTTON A (ON A)** | |
| ```kotlin | |
| Flow: ON A โ [Accessibility Check] โ Start CoreEngine โ Apply DNS A โ Network Conditioning โ GPS Stabilization โ Notification Active | |
| ``` | |
| #### **BUTTON B (ON B)** | |
| ```kotlin | |
| Flow: ON B โ [Accessibility Check] โ Start CoreEngine โ Apply DNS B โ Network Conditioning โ GPS Stabilization โ Notification Active | |
| ``` | |
| #### **BUTTON ON ACS (Accessibility)** | |
| ```kotlin | |
| Function: Buka Settings > Accessibility untuk enable service | |
| Mandatory: WAJIB di-ON sebelum apa-apa button lain | |
| ``` | |
| #### **BUTTON DO ALL JOB (DAJ)** | |
| ```kotlin | |
| Trigger: Bila order slow/tersekat | |
| Flow: | |
| 1. Check DNS aktif (A atau B) | |
| 2. Trigger AccessibilityAutomationService | |
| 3. Automasi: Force Close Panda โ Clear Cache โ Airplane Toggle โ Wait GPS Lock โ Launch Panda | |
| 4. Restart CoreEngine dengan DNS sama (refresh sockets) | |
| ``` | |
| #### **BUTTON OFF** | |
| ```kotlin | |
| Flow: Stop CoreEngine โ Release Wakelock โ Restore Default DNS โ Stop GPS โ Clear Notification | |
| ``` | |
| --- | |
| ## ๐ **4. SERVICE COMMUNICATION** | |
| ### **BROADCAST SYSTEM** | |
| ```kotlin | |
| // AppCoreEngService โ MainActivity | |
| 1. CORE_ENGINE_STATUS_UPDATE โ Engine running/stopped | |
| 2. CORE_ENGINE_DNS_UPDATE โ DNS change success/fail | |
| 3. CORE_ENGINE_GPS_UPDATE โ GPS status (stabilizing/active) | |
| // MainActivity โ AccessibilityAutomationService | |
| 1. DO_ALL_JOB_TRIGGER โ Start automation sequence | |
| // AppCoreEngService โ AccessibilityAutomationService | |
| 1. GPS_LOCK_ACHIEVED โ GPS sudah locked, teruskan automasi | |
| ``` | |
| ### **SERVICE HIERARCHY** | |
| ``` | |
| MainActivity (UI) | |
| โ | |
| AppCoreEngService (Core Engine) | |
| โโโ DNS Management | |
| โโโ Network Conditioning | |
| โโโ GPS Layer | |
| โโโ Notification | |
| โ | |
| AccessibilityAutomationService (Auto-tap/sequence) | |
| โโโ Force Close App | |
| โโโ Clear Cache | |
| โโโ Airplane Toggle | |
| โโโ Launch App | |
| โ | |
| AnchorService (Keep-alive) | |
| โโโ Prevent service kill | |
| โ | |
| FloatingWidgetService (Visual indicator) | |
| โโโ Bubble dengan status | |
| ``` | |
| --- | |
| ## ๐ ๏ธ **5. TECHNICAL IMPLEMENTATION** | |
| ### **FILE STRUCTURE** | |
| ``` | |
| app/src/main/java/com/example/allinoneflushapp/ | |
| โโโ MainActivity.kt # UI & button handlers | |
| โโโ AppCoreEngService.kt # Core Engine (DNS+GPS+Network) | |
| โโโ AccessibilityAutomationService.kt # Auto-tap & sequence | |
| โโโ FloatingWidgetService.kt # Floating bubble widget | |
| โโโ AnchorService.kt # Keep-alive service | |
| app/src/main/res/layout/ | |
| โโโ activity_main.xml # UI utama | |
| โโโ widget_layout.xml # Floating widget | |
| โโโ floating_debug_widget.xml # Debug overlay (optional) | |
| app/src/main/res/drawable/ | |
| โโโ green_circle.xml # Indicator hijau | |
| โโโ red_circle.xml # Indicator merah | |
| โโโ yellow_circle.xml # Indicator kuning (GPS stabilizing) | |
| ``` | |
| ### **PERMISSIONS REQUIRED** | |
| ```xml | |
| <!-- AndroidManifest.xml --> | |
| <uses-permission android:name="android.permission.INTERNET" /> | |
| <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
| <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | |
| <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | |
| <uses-permission android:name="android.permission.WAKE_LOCK" /> | |
| <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> | |
| <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> | |
| <uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE" /> | |
| ``` | |
| --- | |
| ## ๐ **6. DEBUG & TESTING TOOLS** | |
| ### **LOGGING SYSTEM** | |
| ```kotlin | |
| // Tag untuk setiap komponen | |
| - MainActivity: "MainActivity" | |
| - AppCoreEngService: "AppCoreEngService" | |
| - AccessibilityAutomationService: "AccessibilityAutomation" | |
| ``` | |
| ### **TEST SCRIPT (ADB)** | |
| ```batch | |
| # Test sequence: ON ACS โ ON A โ DO ALL JOB โ OFF | |
| adb logcat -c | |
| adb logcat -v time -s MainActivity:D AppCoreEngService:D | |
| # Monitor setiap button click & service response | |
| ``` | |
| ### **EXPECTED LOG FLOW** | |
| ``` | |
| 1. MainActivity: ON ACS BUTTON CLICKED | |
| 2. [User enable accessibility manually] | |
| 3. MainActivity: ON A BUTTON CLICKED | |
| 4. AppCoreEngService: Starting CoreEngine with DNS: 156.154.70.1 | |
| 5. AppCoreEngService: CoreEngine started successfully | |
| 6. Notification: "CoreEngine Active (DNS: 156.154.70.1)" | |
| 7. MainActivity: DO ALL JOB BUTTON CLICKED | |
| 8. AccessibilityAutomationService: DO_ALL_JOB_TRIGGER received | |
| 9. [Automation sequence runs] | |
| ``` | |
| --- | |
| ## ๐ฏ **7. KEY SUCCESS METRICS** | |
| ### **VISUAL INDICATORS** | |
| 1. **Notification**: "CoreEngine Active" + DNS status + GPS status | |
| 2. **UI Indicator**: | |
| - ๐ด = CoreEngine disabled / no internet | |
| - ๐ก = GPS stabilizing (CoreEngine active) | |
| - ๐ข = GPS locked & ready (optimal state) | |
| 3. **Floating Widget**: Hijau (aktif), Merah (tak aktif) | |
| ### **FUNCTIONAL CHECKS** | |
| 1. **DNS Change**: `adb shell getprop | findstr net.dns` | |
| 2. **GPS Lock**: Notification "GPS LOC: Active" | |
| 3. **Service Running**: `adb shell dumpsys activity services` | |
| 4. **Network Active**: Keep-alive packets every 30 seconds | |
| --- | |
| ## โ ๏ธ **8. KNOWN CHALLENGES & SOLUTIONS** | |
| ### **CHALLENGE 1: DNS Change tanpa VPN/Root** | |
| ```kotlin | |
| // Solution: Reflection method (Android 10+) | |
| val method = ConnectivityManager::class.java | |
| .getDeclaredMethod("setDefaultDns", Network::class.java, MutableList::class.java) | |
| method.isAccessible = true | |
| ``` | |
| ### **CHALLENGE 2: GPS Weak Signal (Realme C3)** | |
| ```kotlin | |
| // Solution: High-frequency updates + accuracy threshold | |
| locationManager.requestLocationUpdates( | |
| LocationManager.GPS_PROVIDER, | |
| 1000L, // 1 second interval | |
| 0f, // No minimum distance | |
| locationListener | |
| ) | |
| ``` | |
| ### **CHALLENGE 3: Service Kept Alive** | |
| ```kotlin | |
| // Solution: AnchorService + START_STICKY + Foreground notification | |
| startForeground(NOTIFICATION_ID, notification) | |
| return START_STICKY | |
| ``` | |
| --- | |
| ## ๐ **9. DEVELOPMENT PHASES** | |
| ### **PHASE 1: CORE FUNCTIONALITY** โ | |
| - [x] UI Layout dengan 5 button | |
| - [x] AppCoreEngService skeleton | |
| - [x] Basic button click handlers | |
| ### **PHASE 2: NETWORK LAYER** โ | |
| - [x] DNS changer implementation | |
| - [x] Network conditioning (wakelock + keep-alive) | |
| - [x] Broadcast communication system | |
| ### **PHASE 3: GPS LAYER** โ | |
| - [x] GPS stabilization & locking | |
| - [x] Accuracy-based auto-lock | |
| - [x] Notification integration | |
| ### **PHASE 4: AUTOMATION INTEGRATION** โ | |
| - [x] AccessibilityAutomationService | |
| - [x] DO ALL JOB sequence | |
| - [x] Inter-service communication | |
| ### **PHASE 5: POLISH & TESTING** ๐ก | |
| - [ ] Debug button click issues | |
| - [ ] Test complete flow | |
| - [ ] Optimize timing & reliability | |
| --- | |
| ## ๐ **10. SUPPORT & DEBUGGING** | |
| ### **COMMON ISSUES** | |
| 1. **Button tak function** โ Check Log.d() dalam setiap onClick | |
| 2. **Broadcast tak sampai** โ Verify LocalBroadcastManager registration | |
| 3. **GPS tak lock** โ Check location permission & device GPS capability | |
| 4. **Service mati** โ Verify AnchorService & foreground notification | |
| ### **TESTING CHECKLIST** | |
| - [ ] App launches without crash | |
| - [ ] All 5 buttons visible and clickable | |
| - [ ] ON ACS opens accessibility settings | |
| - [ ] ON A starts CoreEngine & shows notification | |
| - [ ] DO ALL JOB triggers automation sequence | |
| - [ ] OFF stops everything properly | |
| - [ ] Floating widget appears and changes color | |
| --- | |
| **Blueprint ini mengandungi SEMUA maklumat teknikal** untuk bina CedokBooster dari scratch. Setiap komponen, flow, dan implementation detail sudah termasuk. | |
| **Session akan tamat tidak lama lagi.** Untuk sambung development, rujuk blueprint ini dan: | |
| 1. Start dengan **Phase 1** untuk UI basic | |
| 2. Implement **Phase 2** untuk network layer | |
| 3. Integrate **Phase 3** untuk GPS | |
| 4. Complete dengan **Phase 4 & 5** | |
| Blueprint ini **self-contained** dan boleh digunakan oleh mana-mana developer untuk teruskan project. | |
| ============================================================ | |
| ============================================================ | |
| mike ak suka wrap ni tapi kau kene tambah skit.. ada x betul yg ak jumpa 2 laa dan dh baca yg lain, mcm ok sbb ak baca sekali pandang jer.. kepala ak pun dh sakit2 pening haha,, ni 2 ni : | |
| button A | |
| - Flow: ON A โ [Accessibility Check] โ Start CoreEngine โ Apply DNS A โ Network Conditioning โ GPS Stabilization โ Notification Active -->> launch Panda app bila CE is ready | |
| sama juga dgn B. sama mcm a jalan nyer cuma DNS lain | |
| DAJ, ok cun ngam.. jgn kacau | |
| button OFF | |
| - Flow: Stop CoreEngine โ Release Wakelock โ Restore Default DNS โ Stop GPS โ Clear Notification | |
| betulkan semula wrap ni | |
| ============================================================ | |
| ============================================================ | |
| **Faham, Pakya.** Saya betulkan dua flow tu. Ini adalah **kemas kini tepat** untuk blueprint: | |
| --- | |
| ## ๐ฎ **3. BUTTON FUNCTIONALITY (DIKEMASKINI)** | |
| ### **SEQUENCE OPERASI (WAJIB)** | |
| 1. **ON ACS** โ Enable Accessibility Service dulu (mandatory) | |
| 2. **ON A** atau **ON B** โ Start CoreEngine โ Bila GPS locked, **auto-launch Panda app** | |
| 3. **DO ALL JOB** โ Refresh/ulang proses dengan DNS aktif | |
| 4. **OFF** โ Stop semua โ **Force close Panda** โ Restore default | |
| ### **DETAIL SETIAP BUTTON (DIKEMASKINI)** | |
| #### **BUTTON A (ON A) - FLOW TEPAT** | |
| ```kotlin | |
| 1. User tekan ON A | |
| 2. System check: Accessibility Service enabled? (WAJIB) | |
| 3. Jika YA โ Start CoreEngine (AppCoreEngService) | |
| 4. CoreEngine apply DNS A (156.154.70.1) | |
| 5. CoreEngine start Network Conditioning (wakelock, keep-alive) | |
| 6. CoreEngine start GPS Stabilization | |
| 7. GPS LOCK ACHIEVED (signal stabil <25m accuracy) | |
| 8. CoreEngine hantar signal GPS_LOCK_ACHIEVED | |
| 9. AccessibilityAutomationService terima signal โ AUTO LAUNCH PANDA APP | |
| 10. Notification: "CoreEngine Active (DNS: A) | GPS: LOCKED" | |
| ``` | |
| #### **BUTTON B (ON B) - FLOW TEPAT** | |
| ```kotlin | |
| 1. User tekan ON B | |
| 2. System check: Accessibility Service enabled? (WAJIB) | |
| 3. Jika YA โ Start CoreEngine (AppCoreEngService) | |
| 4. CoreEngine apply DNS B (1.1.1.1) | |
| 5. CoreEngine start Network Conditioning (wakelock, keep-alive) | |
| 6. CoreEngine start GPS Stabilization | |
| 7. GPS LOCK ACHIEVED (signal stabil <25m accuracy) | |
| 8. CoreEngine hantar signal GPS_LOCK_ACHIEVED | |
| 9. AccessibilityAutomationService terima signal โ AUTO LAUNCH PANDA APP | |
| 10. Notification: "CoreEngine Active (DNS: B) | GPS: LOCKED" | |
| ``` | |
| #### **BUTTON DO ALL JOB (DAJ) - FLOW TEPAT** | |
| ```kotlin | |
| 1. User tekan DO ALL JOB (bila order slow/tersekat) | |
| 2. System check: Accessibility enabled? & CoreEngine running? | |
| 3. Jika YA โ Dapatkan DNS aktif (A atau B yang sedang run) | |
| 4. Hantar broadcast DO_ALL_JOB_TRIGGER | |
| 5. AccessibilityAutomationService terima trigger โ Jalankan SEQUENCE: | |
| a. Force Close Panda app | |
| b. Clear Panda app cache | |
| c. Toggle Airplane Mode (ON โ OFF) | |
| d. Tunggu GPS lock (jika belum lock) | |
| e. Launch Panda app | |
| 6. Restart CoreEngine dengan DNS sama (refresh semua socket) | |
| ``` | |
| #### **BUTTON OFF - FLOW TEPAT** | |
| ```kotlin | |
| 1. User tekan OFF | |
| 2. System hantar ACTION_STOP_ENGINE ke AppCoreEngService | |
| 3. CoreEngine jalankan SEQUENCE STOP: | |
| a. Stop GPS Stabilization & release GPS resources | |
| b. Stop Network Conditioning (release wakelock, stop keep-alive) | |
| c. Restore Default DNS (system original) | |
| d. Hantar broadcast CORE_ENGINE_STATUS_UPDATE (stopped) | |
| 4. AccessibilityAutomationService terima status stopped โ FORCE CLOSE PANDA APP | |
| 5. Clear semua notification CB | |
| 6. UI update: CoreEngine: Disabled, indicator merah | |
| ``` | |
| --- | |
| ## ๐ **4. SERVICE COMMUNICATION (DIKEMASKINI)** | |
| ### **BROADCAST SYSTEM TEPAT** | |
| ```kotlin | |
| // AppCoreEngService โ MainActivity | |
| 1. CORE_ENGINE_STATUS_UPDATE โ Engine running/stopped + DNS info | |
| // AppCoreEngService โ AccessibilityAutomationService | |
| 1. GPS_LOCK_ACHIEVED โ GPS sudah locked, AUTO LAUNCH PANDA | |
| // MainActivity โ AccessibilityAutomationService | |
| 1. DO_ALL_JOB_TRIGGER โ Start refresh sequence (Force close โ Airplane โ Launch) | |
| ``` | |
| ### **COMPLETE WORKFLOW INTEGRATION** | |
| ``` | |
| USER ACTION โ SERVICE RESPONSE | |
| โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| 1. Tekan ON A/B โ CoreEngine start | |
| โ GPS stabilization | |
| โ Signal locked | |
| โ Auto-launch Panda โ | |
| 2. Tekan DO ALL JOB โ Trigger automasi | |
| โ Force close Panda โ | |
| โ Airplane toggle โ | |
| โ Launch Panda โ | |
| โ Refresh CoreEngine โ | |
| 3. Tekan OFF โ Stop CoreEngine | |
| โ Force close Panda โ | |
| โ Restore default DNS โ | |
| ``` | |
| --- | |
| **Pakya, dengan kemas kini ini:** | |
| - **ON A/B** akan **auto-launch Panda** bila GPS locked (tak perlu user manual launch) | |
| - **OFF** akan **force close Panda** sebagai cleanup | |
| - **DAJ** kekal sebagai refresh sequence untuk order slow | |
| Blueprint kini **100% tepat** dengan requirement sebenar. Sedia untuk digunakan oleh developer baru untuk bina CB dari scratch. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment