# yihoooong/mimonitor_toolbox architecture

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

- Interactive diagram: https://gitdiagram.com/yihoooong/mimonitor_toolbox
- Repository: https://github.com/yihoooong/mimonitor_toolbox

## Overview

Mimonitor Toolbox is a desktop control panel for the Redmi G Pro 27U monitor. The principal workflow is user action in a control page, device/display logic, wireless ADB commands, then Android settings or MTK/LED hardware interfaces on the monitor. It also scans for devices, deploys ADB-keepalive support, and provides presets, logs, remote control, and game features. The README documents these capabilities; sampled source confirms representative Python and native macOS paths, so unsampled feature wiring is shown only where documented.

Main entry points: [`mimonitor_toolbox/main_window.py`](https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/main_window.py) (Main window), [`mimonitor_toolbox/device_features.py`](https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/device_features.py) (Device lifecycle), [`mimonitor_toolbox/pages.py`](https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/pages.py) (Control pages), [`macos/Sources/MimonitorToolbox/Views`](https://github.com/yihoooong/mimonitor_toolbox/tree/master/macos/Sources/MimonitorToolbox/Views) (SwiftUI views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_py_app["Qt startup<br/>[app.py]"]
  node_py_window["Main window<br/>[main_window.py]"]
  node_py_pages["Control pages<br/>[pages.py]"]
  node_mac_app["SwiftUI app<br/>[App.swift]"]
  node_mac_views["SwiftUI views"]
end

subgraph group_control["Device control"]
  node_mac_state["App state<br/>[AppState.swift]"]
  node_py_device["Device lifecycle<br/>[device_features.py]"]
  node_py_display["Display controls"]
  node_presets["Presets<br/>[presets.py]"]
  node_remote["Virtual remote<br/>[pages.py]"]
end

subgraph group_transport["ADB transport"]
  node_adb_py["ADB client<br/>[adb.py]"]
  node_adb_mac["ADB client<br/>[AdbClient.swift]"]
end

subgraph group_monitor["Monitor interfaces"]
  node_android["Monitor Android"]
  node_settings[("Android settings")]
  node_mtk["MTK controls<br/>[MtkDirectTool.java]"]
  node_led["LED controls"]
  node_guardian["ADB guardian"]
end

subgraph group_support["Supporting features"]
  node_network["Network scan<br/>[network_scan.py]"]
  node_platform["Windows services<br/>[windows.py]"]
  node_mac_platform["macOS services"]
  node_logs["Logs and export<br/>[main_window.py]"]
  node_hotkeys["Global hotkeys"]
end

node_user(("Monitor user"))

node_user -->|"launches"| node_py_app
node_py_app -->|"creates"| node_py_window
node_py_window -->|"shows"| node_py_pages
node_py_pages -->|"invokes controls"| node_py_display
node_py_display -->|"uses device state"| node_py_device
node_py_device -->|"issues commands"| node_adb_py
node_adb_py -->|"connects wirelessly"| node_android
node_user -->|"opens"| node_mac_app
node_mac_app -->|"presents"| node_mac_views
node_mac_views -->|"requests changes"| node_mac_state
node_mac_state -->|"runs commands"| node_adb_mac
node_adb_mac -->|"connects wirelessly"| node_android
node_android -->|"reads and writes"| node_settings
node_android -->|"executes JNI helper"| node_mtk
node_android -->|"executes HIDL helper"| node_led
node_py_device -->|"scans devices"| node_network
node_py_device -->|"deploys and checks"| node_guardian
node_py_display -->|"applies preset state"| node_presets
node_py_pages -->|"offers remote controls"| node_remote
node_py_window -->|"records and exports"| node_logs
node_mac_state -->|"registers bindings"| node_hotkeys
node_mac_views -->|"uses platform features"| node_mac_platform
node_py_window -->|"uses system services"| node_platform

click node_py_app "https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/app.py"
click node_py_window "https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/main_window.py"
click node_py_pages "https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/pages.py"
click node_mac_app "https://github.com/yihoooong/mimonitor_toolbox/blob/master/macos/Sources/MimonitorToolbox/App.swift"
click node_mac_views "https://github.com/yihoooong/mimonitor_toolbox/tree/master/macos/Sources/MimonitorToolbox/Views"
click node_mac_state "https://github.com/yihoooong/mimonitor_toolbox/blob/master/macos/Sources/MimonitorToolbox/AppState.swift"
click node_py_device "https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/device_features.py"
click node_py_display "https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/display_features.py"
click node_presets "https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/presets.py"
click node_adb_py "https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/adb.py"
click node_adb_mac "https://github.com/yihoooong/mimonitor_toolbox/blob/master/macos/Sources/MimonitorToolbox/Backend/AdbClient.swift"
click node_network "https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/network_scan.py"
click node_platform "https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/windows.py"
click node_mac_platform "https://github.com/yihoooong/mimonitor_toolbox/tree/master/macos/Sources/MimonitorToolbox/Platform"
click node_mtk "https://github.com/yihoooong/mimonitor_toolbox/blob/master/tools/mtk_direct/MtkDirectTool.java"
click node_led "https://github.com/yihoooong/mimonitor_toolbox/blob/master/tools/colorful_led/ColorfulLedTool.java"
click node_guardian "https://github.com/yihoooong/mimonitor_toolbox/blob/master/assets/adb_guardian/adbguardian-signed.apk"
click node_remote "https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/pages.py"
click node_logs "https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/main_window.py"
click node_hotkeys "https://github.com/yihoooong/mimonitor_toolbox/blob/master/macos/Sources/MimonitorToolbox/Platform/HotkeyManager.swift"

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_py_app,node_py_window,node_py_pages,node_mac_app,node_mac_views,node_user toneBlue
class node_mac_state,node_py_device,node_py_display,node_presets,node_remote toneAmber
class node_adb_py,node_adb_mac toneMint
class node_android,node_settings,node_mtk,node_led,node_guardian toneRose
class node_network,node_platform,node_mac_platform,node_logs,node_hotkeys toneIndigo
```

## Components

### Desktop interface

- [Qt startup](https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/app.py): `mimonitor_toolbox/app.py`
- [Main window](https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/main_window.py): `mimonitor_toolbox/main_window.py`
- [Control pages](https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/pages.py): `mimonitor_toolbox/pages.py`
- [SwiftUI app](https://github.com/yihoooong/mimonitor_toolbox/blob/master/macos/Sources/MimonitorToolbox/App.swift): `macos/Sources/MimonitorToolbox/App.swift`
- [SwiftUI views](https://github.com/yihoooong/mimonitor_toolbox/tree/master/macos/Sources/MimonitorToolbox/Views): `macos/Sources/MimonitorToolbox/Views`

### Device control

- [App state](https://github.com/yihoooong/mimonitor_toolbox/blob/master/macos/Sources/MimonitorToolbox/AppState.swift): `macos/Sources/MimonitorToolbox/AppState.swift`
- [Device lifecycle](https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/device_features.py): `mimonitor_toolbox/device_features.py`
- [Display controls](https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/display_features.py): `mimonitor_toolbox/display_features.py`
- [Presets](https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/presets.py): `mimonitor_toolbox/presets.py`
- [Virtual remote](https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/pages.py): `mimonitor_toolbox/pages.py`

### ADB transport

- [ADB client](https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/adb.py): `mimonitor_toolbox/adb.py`
- [ADB client](https://github.com/yihoooong/mimonitor_toolbox/blob/master/macos/Sources/MimonitorToolbox/Backend/AdbClient.swift): `macos/Sources/MimonitorToolbox/Backend/AdbClient.swift`

### Monitor interfaces

- **Monitor Android**
- **Android settings**
- [MTK controls](https://github.com/yihoooong/mimonitor_toolbox/blob/master/tools/mtk_direct/MtkDirectTool.java): `tools/mtk_direct/MtkDirectTool.java`
- [LED controls](https://github.com/yihoooong/mimonitor_toolbox/blob/master/tools/colorful_led/ColorfulLedTool.java): `tools/colorful_led/ColorfulLedTool.java`
- [ADB guardian](https://github.com/yihoooong/mimonitor_toolbox/blob/master/assets/adb_guardian/adbguardian-signed.apk): `assets/adb_guardian/adbguardian-signed.apk`

### Supporting features

- [Network scan](https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/network_scan.py): `mimonitor_toolbox/network_scan.py`
- [Windows services](https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/windows.py): `mimonitor_toolbox/windows.py`
- [macOS services](https://github.com/yihoooong/mimonitor_toolbox/tree/master/macos/Sources/MimonitorToolbox/Platform): `macos/Sources/MimonitorToolbox/Platform`
- [Logs and export](https://github.com/yihoooong/mimonitor_toolbox/blob/master/mimonitor_toolbox/main_window.py): `mimonitor_toolbox/main_window.py`
- [Global hotkeys](https://github.com/yihoooong/mimonitor_toolbox/blob/master/macos/Sources/MimonitorToolbox/Platform/HotkeyManager.swift): `macos/Sources/MimonitorToolbox/Platform/HotkeyManager.swift`

### Other components

- **Monitor user**

## Connections

- Monitor user → Qt startup: launches
- Qt startup → Main window: creates
- Main window → Control pages: shows
- Control pages → Display controls: invokes controls
- Display controls → Device lifecycle: uses device state
- Device lifecycle → ADB client: issues commands
- ADB client → Monitor Android: connects wirelessly
- Monitor user → SwiftUI app: opens
- SwiftUI app → SwiftUI views: presents
- SwiftUI views → App state: requests changes
- App state → ADB client: runs commands
- ADB client → Monitor Android: connects wirelessly
- Monitor Android → Android settings: reads and writes
- Monitor Android → MTK controls: executes JNI helper
- Monitor Android → LED controls: executes HIDL helper
- Device lifecycle → Network scan: scans devices
- Device lifecycle → ADB guardian: deploys and checks
- Display controls → Presets: applies preset state
- Control pages → Virtual remote: offers remote controls
- Main window → Logs and export: records and exports
- App state → Global hotkeys: registers bindings
- SwiftUI views → macOS services: uses platform features
- Main window → Windows services: uses system services
