# liliya2727/azenith architecture

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

- Interactive diagram: https://gitdiagram.com/liliya2727/azenith
- Repository: https://github.com/liliya2727/azenith

## Overview

AZenith is an Android performance-tuning module with a manager app and cooperating Rust daemons. A typical session starts with the manager configuring per-app options; sysdaemon observes the foreground game, archdaemon selects a profile and applies device tuning, and the Game Space overlay exposes live controls and telemetry. Separate capabilities include frametime recording, preload, bypass charging, preference tweaks, and thermal control. The README documents the product-level links; source excerpts show daemon dispatch and selected state/reporting behavior, but not every runtime integration.

Main entry points: [`sysdaemon/src/main.rs`](https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/main.rs) (App monitor), [`archdaemon/src/profile.rs`](https://github.com/liliya2727/azenith/blob/main/archdaemon/src/profile.rs) (Profile orchestration), [`manager/app/src/main/java/zx/azenith/MainActivity.kt`](https://github.com/liliya2727/azenith/blob/main/manager/app/src/main/java/zx/azenith/MainActivity.kt) (Manager UI), [`manager/app/src/main/java/zx/azenith/ui/gamespace/ZXSidePanelService.kt`](https://github.com/liliya2727/azenith/blob/main/manager/app/src/main/java/zx/azenith/ui/gamespace/ZXSidePanelService.kt) (In-game sidepanel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_manager["Manager app"]
  node_manager_app["Manager UI<br/>[MainActivity.kt]"]
  node_manager_theme["Theme system<br/>[Theme.kt]"]
  node_game_config["Per-app tuning UI<br/>[ApplistScreen.kt]"]
end

subgraph group_observation["Game observation"]
  node_sysdaemon["App monitor<br/>[main.rs]"]
  node_sys_state["Focus and process state<br/>[state.rs]"]
  node_sys_codes["Binder code discovery<br/>[codes.rs]"]
  node_sys_dex["DEX inspection<br/>[dex.rs]"]
  node_sys_procs["Process tracking<br/>[procs.rs]"]
  node_sys_ndk["Native Binder access<br/>[ndk.rs]"]
  node_sys_inotify["File event watcher<br/>[inotify.rs]"]
end

subgraph group_tuning["Profiles and tuning"]
  node_profile_engine["Profile orchestration<br/>[profile.rs]"]
  node_daemon_core["Daemon state core<br/>[core.rs]"]
  node_profile_apply["Hardware profile apply<br/>[main.rs]"]
  node_profile_preferences["Preference tweaks<br/>[mod.rs]"]
  node_bypass["Bypass charging<br/>[bypass.rs]"]
  node_arch_config["Display configuration<br/>[resolution.rs]"]
  node_arch_shell["System command access<br/>[shell.rs]"]
  node_arch_sysprop["System properties<br/>[sysprop.rs]"]
  node_arch_ffi["Android logging FFI<br/>[android_ffi.rs]"]
  node_arch_monitor["Device monitor<br/>[monitor.rs]"]
  node_arch_log["Daemon logging<br/>[log.rs]"]
  node_preload["Game preload"]
end

subgraph group_overlay["Game Space"]
  node_game_space["Game Space shell"]
  node_sidepanel["In-game sidepanel"]
  node_floating_apps["Floating app windows"]
end

subgraph group_telemetry["Telemetry and thermal"]
  node_fps_client["FPS client<br/>[fps.rs]"]
  node_recorder["Frametime recorder<br/>[mod.rs]"]
  node_thermal["Thermal controller<br/>[policy_manager.rs]"]
  node_thermal_runtime["Thermal monitoring runtime<br/>[monitor.rs]"]
end

node_user(("Device user"))

node_user -->|"configures"| node_manager_app
node_manager_app -->|"sets per-app tuning"| node_game_config
node_manager_app -->|"launches"| node_game_space
node_manager_app -->|"starts overlay"| node_sidepanel
node_manager_app -.->|"uses"| node_manager_theme
node_sysdaemon -->|"loads codes"| node_sys_codes
node_sysdaemon -->|"starts"| node_fps_client
node_sysdaemon -->|"updates state"| node_sys_state
node_sysdaemon -->|"resolves Binder codes"| node_sys_dex
node_sysdaemon -.->|"uses native Binder"| node_sys_ndk
node_sysdaemon -.->|"tracks processes"| node_sys_procs
node_sysdaemon -.->|"watches events"| node_sys_inotify
node_sys_state -->|"publishes focus status"| node_sysdaemon
node_sysdaemon -->|"feeds game focus"| node_profile_engine
node_profile_engine -->|"reads shared state"| node_daemon_core
node_profile_engine -->|"applies selected profile"| node_profile_apply
node_profile_engine -->|"uses app overrides"| node_game_config
node_profile_engine -->|"controls charging behavior"| node_bypass
node_profile_engine -->|"applies display settings"| node_arch_config
node_profile_engine -->|"requests game preload"| node_preload
node_profile_apply -->|"applies preferences"| node_profile_preferences
node_profile_engine -->|"runs system commands"| node_arch_shell
node_arch_sysprop -->|"uses Android FFI"| node_arch_ffi
node_profile_engine -.->|"uses device monitoring"| node_arch_monitor
node_game_space -->|"hands off session"| node_sidepanel
node_sidepanel -->|"reads FPS status"| node_fps_client
node_sidepanel -->|"opens floating apps"| node_floating_apps
node_fps_client -->|"publishes frametime data"| node_recorder
node_user -->|"starts or stops recording"| node_recorder
node_thermal_runtime -.->|"feeds thermal policy"| node_thermal
node_thermal -->|"adapts device limits"| node_profile_apply
node_sysdaemon -->|"tracks focused app"| node_sys_state

click node_manager_app "https://github.com/liliya2727/azenith/blob/main/manager/app/src/main/java/zx/azenith/MainActivity.kt"
click node_manager_theme "https://github.com/liliya2727/azenith/blob/main/manager/app/src/main/java/zx/azenith/ui/theme/Theme.kt"
click node_game_config "https://github.com/liliya2727/azenith/blob/main/manager/app/src/main/java/zx/azenith/ui/mainscreens/ApplistScreen.kt"
click node_sysdaemon "https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/main.rs"
click node_sys_state "https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/state.rs"
click node_sys_codes "https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/codes.rs"
click node_sys_dex "https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/dex.rs"
click node_sys_procs "https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/procs.rs"
click node_sys_ndk "https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/ndk.rs"
click node_sys_inotify "https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/inotify.rs"
click node_profile_engine "https://github.com/liliya2727/azenith/blob/main/archdaemon/src/profile.rs"
click node_daemon_core "https://github.com/liliya2727/azenith/blob/main/archdaemon/src/core.rs"
click node_profile_apply "https://github.com/liliya2727/azenith/blob/main/binprofiles/src/main.rs"
click node_profile_preferences "https://github.com/liliya2727/azenith/blob/main/binprofiles/src/prefs/mod.rs"
click node_bypass "https://github.com/liliya2727/azenith/blob/main/archdaemon/src/bypass.rs"
click node_arch_config "https://github.com/liliya2727/azenith/blob/main/archdaemon/src/config/resolution.rs"
click node_arch_shell "https://github.com/liliya2727/azenith/blob/main/archdaemon/src/shell.rs"
click node_arch_sysprop "https://github.com/liliya2727/azenith/blob/main/archdaemon/src/sysprop.rs"
click node_arch_ffi "https://github.com/liliya2727/azenith/blob/main/archdaemon/src/android_ffi.rs"
click node_arch_monitor "https://github.com/liliya2727/azenith/blob/main/archdaemon/src/monitor.rs"
click node_arch_log "https://github.com/liliya2727/azenith/blob/main/archdaemon/src/log.rs"
click node_preload "https://github.com/liliya2727/azenith/tree/main/archdaemon/src/preload"
click node_game_space "https://github.com/liliya2727/azenith/blob/main/manager/app/src/main/java/zx/azenith/ui/gamespace/ZXGameSpaceShell.kt"
click node_sidepanel "https://github.com/liliya2727/azenith/blob/main/manager/app/src/main/java/zx/azenith/ui/gamespace/ZXSidePanelService.kt"
click node_floating_apps "https://github.com/liliya2727/azenith/blob/main/manager/app/src/main/java/zx/azenith/ui/gamespace/ZXFloatingAppManager.kt"
click node_fps_client "https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/fps.rs"
click node_recorder "https://github.com/liliya2727/azenith/blob/main/archdaemon/src/recorder/mod.rs"
click node_thermal "https://github.com/liliya2727/azenith/blob/main/thermalcore/src/policy_manager.rs"
click node_thermal_runtime "https://github.com/liliya2727/azenith/blob/main/thermalcore/src/monitor.rs"

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_manager_app,node_manager_theme,node_game_config,node_user toneBlue
class node_sysdaemon,node_sys_state,node_sys_codes,node_sys_dex,node_sys_procs,node_sys_ndk,node_sys_inotify toneAmber
class node_profile_engine,node_daemon_core,node_profile_apply,node_profile_preferences,node_bypass,node_arch_config,node_arch_shell,node_arch_sysprop,node_arch_ffi,node_arch_monitor,node_arch_log,node_preload toneMint
class node_game_space,node_sidepanel,node_floating_apps toneRose
class node_fps_client,node_recorder,node_thermal,node_thermal_runtime toneIndigo
```

## Components

### Manager app

- [Manager UI](https://github.com/liliya2727/azenith/blob/main/manager/app/src/main/java/zx/azenith/MainActivity.kt): `manager/app/src/main/java/zx/azenith/MainActivity.kt`
- [Theme system](https://github.com/liliya2727/azenith/blob/main/manager/app/src/main/java/zx/azenith/ui/theme/Theme.kt): `manager/app/src/main/java/zx/azenith/ui/theme/Theme.kt`
- [Per-app tuning UI](https://github.com/liliya2727/azenith/blob/main/manager/app/src/main/java/zx/azenith/ui/mainscreens/ApplistScreen.kt): `manager/app/src/main/java/zx/azenith/ui/mainscreens/ApplistScreen.kt`

### Game observation

- [App monitor](https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/main.rs): `sysdaemon/src/main.rs`
- [Focus and process state](https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/state.rs): `sysdaemon/src/state.rs`
- [Binder code discovery](https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/codes.rs): `sysdaemon/src/codes.rs`
- [DEX inspection](https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/dex.rs): `sysdaemon/src/dex.rs`
- [Process tracking](https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/procs.rs): `sysdaemon/src/procs.rs`
- [Native Binder access](https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/ndk.rs): `sysdaemon/src/ndk.rs`
- [File event watcher](https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/inotify.rs): `sysdaemon/src/inotify.rs`

### Profiles and tuning

- [Profile orchestration](https://github.com/liliya2727/azenith/blob/main/archdaemon/src/profile.rs): `archdaemon/src/profile.rs`
- [Daemon state core](https://github.com/liliya2727/azenith/blob/main/archdaemon/src/core.rs): `archdaemon/src/core.rs`
- [Hardware profile apply](https://github.com/liliya2727/azenith/blob/main/binprofiles/src/main.rs): `binprofiles/src/main.rs`
- [Preference tweaks](https://github.com/liliya2727/azenith/blob/main/binprofiles/src/prefs/mod.rs): `binprofiles/src/prefs/mod.rs`
- [Bypass charging](https://github.com/liliya2727/azenith/blob/main/archdaemon/src/bypass.rs): `archdaemon/src/bypass.rs`
- [Display configuration](https://github.com/liliya2727/azenith/blob/main/archdaemon/src/config/resolution.rs): `archdaemon/src/config/resolution.rs`
- [System command access](https://github.com/liliya2727/azenith/blob/main/archdaemon/src/shell.rs): `archdaemon/src/shell.rs`
- [System properties](https://github.com/liliya2727/azenith/blob/main/archdaemon/src/sysprop.rs): `archdaemon/src/sysprop.rs`
- [Android logging FFI](https://github.com/liliya2727/azenith/blob/main/archdaemon/src/android_ffi.rs): `archdaemon/src/android_ffi.rs`
- [Device monitor](https://github.com/liliya2727/azenith/blob/main/archdaemon/src/monitor.rs): `archdaemon/src/monitor.rs`
- [Daemon logging](https://github.com/liliya2727/azenith/blob/main/archdaemon/src/log.rs): `archdaemon/src/log.rs`
- [Game preload](https://github.com/liliya2727/azenith/tree/main/archdaemon/src/preload): `archdaemon/src/preload`

### Game Space

- [Game Space shell](https://github.com/liliya2727/azenith/blob/main/manager/app/src/main/java/zx/azenith/ui/gamespace/ZXGameSpaceShell.kt): `manager/app/src/main/java/zx/azenith/ui/gamespace/ZXGameSpaceShell.kt`
- [In-game sidepanel](https://github.com/liliya2727/azenith/blob/main/manager/app/src/main/java/zx/azenith/ui/gamespace/ZXSidePanelService.kt): `manager/app/src/main/java/zx/azenith/ui/gamespace/ZXSidePanelService.kt`
- [Floating app windows](https://github.com/liliya2727/azenith/blob/main/manager/app/src/main/java/zx/azenith/ui/gamespace/ZXFloatingAppManager.kt): `manager/app/src/main/java/zx/azenith/ui/gamespace/ZXFloatingAppManager.kt`

### Telemetry and thermal

- [FPS client](https://github.com/liliya2727/azenith/blob/main/sysdaemon/src/fps.rs): `sysdaemon/src/fps.rs`
- [Frametime recorder](https://github.com/liliya2727/azenith/blob/main/archdaemon/src/recorder/mod.rs): `archdaemon/src/recorder/mod.rs`
- [Thermal controller](https://github.com/liliya2727/azenith/blob/main/thermalcore/src/policy_manager.rs): `thermalcore/src/policy_manager.rs`
- [Thermal monitoring runtime](https://github.com/liliya2727/azenith/blob/main/thermalcore/src/monitor.rs): `thermalcore/src/monitor.rs`

### Other components

- **Device user**

## Connections

- Device user → Manager UI: configures
- Manager UI → Per-app tuning UI: sets per-app tuning (evidence: `manager/app/src/main/java/zx/azenith/MainActivity.kt`)
- Manager UI → Game Space shell: launches
- Manager UI → In-game sidepanel: starts overlay (evidence: `manager/app/src/main/java/zx/azenith/MainActivity.kt`)
- Manager UI → Theme system: uses (evidence: `manager/app/src/main/java/zx/azenith/ui/theme/Theme.kt`)
- App monitor → Binder code discovery: loads codes (evidence: `sysdaemon/src/main.rs`)
- App monitor → FPS client: starts (evidence: `sysdaemon/src/main.rs`)
- App monitor → Focus and process state: updates state (evidence: `sysdaemon/src/main.rs`)
- App monitor → DEX inspection: resolves Binder codes (evidence: `sysdaemon/src/main.rs`)
- App monitor → Native Binder access: uses native Binder (evidence: `sysdaemon/src/main.rs`)
- App monitor → Process tracking: tracks processes (evidence: `sysdaemon/src/main.rs`)
- App monitor → File event watcher: watches events (evidence: `sysdaemon/src/main.rs`)
- Focus and process state → App monitor: publishes focus status (evidence: `sysdaemon/src/state.rs`)
- App monitor → Profile orchestration: feeds game focus
- Profile orchestration → Daemon state core: reads shared state (evidence: `archdaemon/src/profile.rs`)
- Profile orchestration → Hardware profile apply: applies selected profile
- Profile orchestration → Per-app tuning UI: uses app overrides
- Profile orchestration → Bypass charging: controls charging behavior (evidence: `archdaemon/src/profile.rs`)
- Profile orchestration → Display configuration: applies display settings (evidence: `archdaemon/src/profile.rs`)
- Profile orchestration → Game preload: requests game preload (evidence: `archdaemon/src/profile.rs`)
- Hardware profile apply → Preference tweaks: applies preferences (evidence: `binprofiles/src/main.rs`)
- Profile orchestration → System command access: runs system commands (evidence: `archdaemon/src/profile.rs`)
- System properties → Android logging FFI: uses Android FFI (evidence: `archdaemon/src/sysprop.rs`)
- Profile orchestration → Device monitor: uses device monitoring (evidence: `archdaemon/src/profile.rs`)
- Game Space shell → In-game sidepanel: hands off session
- In-game sidepanel → FPS client: reads FPS status
- In-game sidepanel → Floating app windows: opens floating apps (evidence: `manager/app/src/main/java/zx/azenith/ui/gamespace/ZXSidePanelService.kt`)
- FPS client → Frametime recorder: publishes frametime data
- Device user → Frametime recorder: starts or stops recording
- Thermal monitoring runtime → Thermal controller: feeds thermal policy
- Thermal controller → Hardware profile apply: adapts device limits
- App monitor → Focus and process state: tracks focused app (evidence: `sysdaemon/src/state.rs`)
