# briczz555/wifi_debug_inject architecture

> Architecture diagram of the GitHub repository briczz555/wifi_debug_inject, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/briczz555/wifi_debug_inject
- Repository: https://github.com/briczz555/wifi_debug_inject

## Overview

Briczz WiFi Debug is an Android-focused Flutter app for checking and toggling Wireless Debugging, with both an in-app control and a Quick Settings tile. The app UI uses a MethodChannel to reach Android code, which checks WRITE_SECURE_SETTINGS and reads or updates adb_wifi_enabled; a ContentObserver reports setting changes back to Flutter. The tile independently toggles the same setting and reflects Wi-Fi and debugging state. UI details are unsampled; Flutter-to-Android and permission/tutorial behavior are based on the README, while native behavior is supported by the shown Kotlin sources.

Main entry points: [`android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt`](https://github.com/briczz555/wifi_debug_inject/blob/main/android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt) (MethodChannel), [`android/app/src/main/kotlin/com/briczz/wifi_debug_inject/WirelessDebugTileService.kt`](https://github.com/briczz555/wifi_debug_inject/blob/main/android/app/src/main/kotlin/com/briczz/wifi_debug_inject/WirelessDebugTileService.kt) (Tile service), [`lib/main.dart`](https://github.com/briczz555/wifi_debug_inject/blob/main/lib/main.dart) (App UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flutter["Flutter app"]
  node_flutter_ui["App UI<br/>[main.dart]"]
  node_adb_tutorial["ADB tutorial<br/>[main.dart]"]
end

subgraph group_android["Android bridge"]
  node_permission_check["Permission check<br/>[MainActivity.kt]"]
  node_method_channel["MethodChannel<br/>[MainActivity.kt]"]
  node_settings_observer["Settings observer<br/>[MainActivity.kt]"]
  node_global_settings[("Global settings")]
end

subgraph group_quick_settings["Quick Settings"]
  node_tile_service["Tile service"]
  node_quick_settings_ui["Quick Settings"]
end

node_user(("User"))
node_wifi_network["Wi-Fi network"]
node_android_permission["WRITE_SECURE_SETTINGS"]

node_user -->|"uses"| node_flutter_ui
node_flutter_ui -->|"calls"| node_method_channel
node_method_channel -->|"checks"| node_permission_check
node_permission_check -->|"validates"| node_android_permission
node_flutter_ui -->|"shows when denied"| node_adb_tutorial
node_method_channel -->|"reads or writes"| node_global_settings
node_global_settings -->|"notifies changes"| node_settings_observer
node_settings_observer -->|"notifies Flutter"| node_method_channel
node_user -->|"uses tile"| node_quick_settings_ui
node_quick_settings_ui -->|"dispatches clicks"| node_tile_service
node_tile_service -->|"reads or writes"| node_global_settings
node_tile_service -->|"checks connection"| node_wifi_network
node_wifi_network -->|"reports changes"| node_tile_service
node_tile_service -->|"updates tile"| node_quick_settings_ui
node_method_channel -->|"requests tile addition"| node_quick_settings_ui

click node_flutter_ui "https://github.com/briczz555/wifi_debug_inject/blob/main/lib/main.dart"
click node_adb_tutorial "https://github.com/briczz555/wifi_debug_inject/blob/main/lib/main.dart"
click node_permission_check "https://github.com/briczz555/wifi_debug_inject/blob/main/android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt"
click node_method_channel "https://github.com/briczz555/wifi_debug_inject/blob/main/android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt"
click node_settings_observer "https://github.com/briczz555/wifi_debug_inject/blob/main/android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt"
click node_tile_service "https://github.com/briczz555/wifi_debug_inject/blob/main/android/app/src/main/kotlin/com/briczz/wifi_debug_inject/WirelessDebugTileService.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_flutter_ui,node_adb_tutorial,node_user toneBlue
class node_permission_check,node_method_channel,node_settings_observer,node_global_settings toneAmber
class node_tile_service,node_quick_settings_ui toneMint
class node_wifi_network,node_android_permission toneIndigo
```

## Components

### Flutter app

- [App UI](https://github.com/briczz555/wifi_debug_inject/blob/main/lib/main.dart): `lib/main.dart`
- [ADB tutorial](https://github.com/briczz555/wifi_debug_inject/blob/main/lib/main.dart): `lib/main.dart`

### Android bridge

- [Permission check](https://github.com/briczz555/wifi_debug_inject/blob/main/android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt): `android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt`
- [MethodChannel](https://github.com/briczz555/wifi_debug_inject/blob/main/android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt): `android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt`
- [Settings observer](https://github.com/briczz555/wifi_debug_inject/blob/main/android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt): `android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt`
- **Global settings**

### Quick Settings

- [Tile service](https://github.com/briczz555/wifi_debug_inject/blob/main/android/app/src/main/kotlin/com/briczz/wifi_debug_inject/WirelessDebugTileService.kt): `android/app/src/main/kotlin/com/briczz/wifi_debug_inject/WirelessDebugTileService.kt`
- **Quick Settings**

### Other components

- **User**
- **Wi-Fi network**
- **WRITE_SECURE_SETTINGS**

## Connections

- User → App UI: uses (evidence: `README.md`)
- App UI → MethodChannel: calls (evidence: `README.md`)
- MethodChannel → Permission check: checks (evidence: `android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt`)
- Permission check → WRITE_SECURE_SETTINGS: validates (evidence: `android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt`)
- App UI → ADB tutorial: shows when denied (evidence: `README.md`)
- MethodChannel → Global settings: reads or writes (evidence: `android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt`)
- Global settings → Settings observer: notifies changes (evidence: `android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt`)
- Settings observer → MethodChannel: notifies Flutter (evidence: `android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt`)
- User → Quick Settings: uses tile (evidence: `README.md`)
- Quick Settings → Tile service: dispatches clicks (evidence: `README.md`)
- Tile service → Global settings: reads or writes (evidence: `android/app/src/main/kotlin/com/briczz/wifi_debug_inject/WirelessDebugTileService.kt`)
- Tile service → Wi-Fi network: checks connection (evidence: `android/app/src/main/kotlin/com/briczz/wifi_debug_inject/WirelessDebugTileService.kt`)
- Wi-Fi network → Tile service: reports changes (evidence: `android/app/src/main/kotlin/com/briczz/wifi_debug_inject/WirelessDebugTileService.kt`)
- Tile service → Quick Settings: updates tile (evidence: `android/app/src/main/kotlin/com/briczz/wifi_debug_inject/WirelessDebugTileService.kt`)
- MethodChannel → Quick Settings: requests tile addition (evidence: `android/app/src/main/kotlin/com/briczz/wifi_debug_inject/MainActivity.kt`)
