System Overview

graph TD PC[Windows Side: Flutter/ADB] -->|TCP| JAR[⚡ Logic Engine: Java JAR] PC -->|WebSocket| Hub[📱 Feature Hub: Kotlin APK] PC -->|Pipe| ADB[ADB Shell Context] ADB --> JAR Hub --> System[Android System Context]

Both Android-side components connect back to the Windows side — the Windows app runs the servers; Android clients connect to them.

Layer 1 — Windows Side

Role: Orchestrator, UI host, server infrastructure, and rendering engine.

Domain What It Does
ADB LifecycleStarts ADB server, connects device, sets up reverse port forwarding
ServersRuns 4 TCP/WebSocket servers that Android components connect to
JAR DeploymentLocates, pushes, and launches the Logic Engine on the device
APK ManagementDetects, installs, and starts the companion APK service
RenderingEmbeds scrcpy windows as native Win32 child windows inside Flutter
ReconnectionMonitors connection state; auto-heals without user restart

Layer 2 — Logic Engine (Java JAR)

Role: Shell-level command executor running with elevated ADB daemon privileges.

The JAR, launched via adb shell app_process, executes at the ADB shell user level — allowing volume manipulation via AudioService and control over the ActivityManager without launcher process restrictions.

Core Responsibilities

Layer 3 — Feature Hub (Kotlin APK)

Role: Permission-holding daemon for all telemetry and high-level Android APIs.

Includes access to listener APIs that require app registration, such as NotificationListenerService and MediaSessionManager.