# reedgaooo/fcmguard-hyperos architecture

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

- Interactive diagram: https://gitdiagram.com/reedgaooo/fcmguard-hyperos
- Repository: https://github.com/reedgaooo/fcmguard-hyperos

## Overview

FCM Guard is a low-privilege HyperOS watchdog: the user enables protection in the dashboard, which starts a service that monitors Xiaomi’s whitelist setting, repairs it when Google Play services is missing, and reconnects FCM only after a repair. The dashboard also reports protection health and scans likely FCM apps. Separate UI branches provide themes, system appearance and the docked status-card experience. Edges reflect the README, shown excerpts, and SOURCE INDEX references; several implementation details outside those samples are intentionally not expanded.

Main entry points: [`app/src/main/java/com/reed/fcmguard/MainActivity.java`](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/MainActivity.java) (Main activity), [`app/src/main/java/com/reed/fcmguard/StickyDashboardLayout.java`](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/StickyDashboardLayout.java) (Sticky dashboard), [`app/src/main/java/com/reed/fcmguard/GuardService.java`](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/GuardService.java) (Guard service), [`app/src/main/java/com/reed/fcmguard/SettingsGuard.java`](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/SettingsGuard.java) (Whitelist repair)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_protection["Protection runtime"]
  node_guard["Guard service<br/>[GuardService.java]"]
  node_boot["Boot receiver<br/>[BootReceiver.java]"]
  node_settingsguard["Whitelist repair<br/>[SettingsGuard.java]"]
  node_systemsetting[("Whitelist setting")]
  node_reconnect["FCM reconnect<br/>[FcmReconnect.java]"]
end

subgraph group_dashboard["Status dashboard"]
  node_main["Main activity<br/>[MainActivity.java]"]
  node_statuslayout["Sticky dashboard"]
  node_statuscard["Status card"]
  node_tilestack["Status tile stack"]
  node_glass["Glass blur<br/>[GlassBlur.java]"]
  node_backdrop["Glass backdrop"]
end

subgraph group_assistant["FCM app assistant"]
  node_scanner["FCM app scanner<br/>[FcmAppScanner.java]"]
  node_autostart["Autostart reader"]
  node_hyperossettings["Settings navigation"]
end

subgraph group_appearance["Appearance and motion"]
  node_themehelper["Theme preferences<br/>[ThemeHelper.java]"]
  node_palettes["Theme palettes<br/>[Palettes.java]"]
  node_themepanel["Theme panel<br/>[ThemePanel.java]"]
  node_preview["Theme preview"]
  node_colors["Theme colors<br/>[AppColors.java]"]
  node_transition["Page transition"]
end

node_user(("Phone user"))
node_hyperos["HyperOS settings"]
node_gms["Google Play services"]

node_user -->|"opens and configures"| node_main
node_main -->|"starts service"| node_guard
node_boot -->|"starts on boot"| node_guard
node_guard -->|"checks and repairs"| node_settingsguard
node_settingsguard -->|"reads and writes"| node_systemsetting
node_settingsguard -->|"adds when missing"| node_gms
node_guard -->|"reconnects after repair"| node_reconnect
node_main -->|"hosts dashboard"| node_statuslayout
node_statuslayout -->|"positions and clips"| node_statuscard
node_statuslayout -->|"coordinates tile stack"| node_tilestack
node_main -->|"scans FCM apps"| node_scanner
node_main -->|"checks app status"| node_autostart
node_user -->|"opens app settings"| node_hyperossettings
node_main -.->|"opens vendor settings"| node_hyperossettings
node_main -->|"opens theme panel"| node_themepanel
node_main -->|"reads appearance"| node_themehelper
node_main -->|"crossfades page"| node_transition
node_themepanel -->|"renders previews"| node_preview
node_themepanel -->|"lists palette choices"| node_palettes
node_themehelper -->|"resolves palette"| node_palettes
node_preview -->|"resolves theme colors"| node_colors
node_statuslayout -->|"configures glass backdrop"| node_backdrop
node_backdrop -->|"uses blur renderer"| node_glass
node_statuscard -->|"uses glass rendering"| node_glass

click node_main "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/MainActivity.java"
click node_guard "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/GuardService.java"
click node_boot "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/BootReceiver.java"
click node_settingsguard "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/SettingsGuard.java"
click node_reconnect "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/FcmReconnect.java"
click node_statuslayout "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/StickyDashboardLayout.java"
click node_statuscard "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/CollapsingStatusCard.java"
click node_tilestack "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/StatusTileStack.java"
click node_scanner "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/FcmAppScanner.java"
click node_autostart "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/AutostartStatusReader.java"
click node_hyperossettings "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/HyperOsSettings.java"
click node_themehelper "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/ThemeHelper.java"
click node_palettes "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/Palettes.java"
click node_themepanel "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/ThemePanel.java"
click node_preview "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/ThemePreviewView.java"
click node_colors "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/AppColors.java"
click node_transition "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/PageTransition.java"
click node_glass "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/GlassBlur.java"
click node_backdrop "https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/GlassBackdropView.java"

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_guard,node_boot,node_settingsguard,node_systemsetting,node_reconnect,node_user toneBlue
class node_main,node_statuslayout,node_statuscard,node_tilestack,node_glass,node_backdrop toneAmber
class node_scanner,node_autostart,node_hyperossettings toneMint
class node_themehelper,node_palettes,node_themepanel,node_preview,node_colors,node_transition toneRose
class node_hyperos,node_gms toneIndigo
```

## Components

### Protection runtime

- [Guard service](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/GuardService.java): `app/src/main/java/com/reed/fcmguard/GuardService.java`
- [Boot receiver](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/BootReceiver.java): `app/src/main/java/com/reed/fcmguard/BootReceiver.java`
- [Whitelist repair](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/SettingsGuard.java): `app/src/main/java/com/reed/fcmguard/SettingsGuard.java`
- **Whitelist setting**
- [FCM reconnect](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/FcmReconnect.java): `app/src/main/java/com/reed/fcmguard/FcmReconnect.java`

### Status dashboard

- [Main activity](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/MainActivity.java): `app/src/main/java/com/reed/fcmguard/MainActivity.java`
- [Sticky dashboard](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/StickyDashboardLayout.java): `app/src/main/java/com/reed/fcmguard/StickyDashboardLayout.java`
- [Status card](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/CollapsingStatusCard.java): `app/src/main/java/com/reed/fcmguard/CollapsingStatusCard.java`
- [Status tile stack](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/StatusTileStack.java): `app/src/main/java/com/reed/fcmguard/StatusTileStack.java`
- [Glass blur](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/GlassBlur.java): `app/src/main/java/com/reed/fcmguard/GlassBlur.java`
- [Glass backdrop](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/GlassBackdropView.java): `app/src/main/java/com/reed/fcmguard/GlassBackdropView.java`

### FCM app assistant

- [FCM app scanner](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/FcmAppScanner.java): `app/src/main/java/com/reed/fcmguard/FcmAppScanner.java`
- [Autostart reader](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/AutostartStatusReader.java): `app/src/main/java/com/reed/fcmguard/AutostartStatusReader.java`
- [Settings navigation](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/HyperOsSettings.java): `app/src/main/java/com/reed/fcmguard/HyperOsSettings.java`

### Appearance and motion

- [Theme preferences](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/ThemeHelper.java): `app/src/main/java/com/reed/fcmguard/ThemeHelper.java`
- [Theme palettes](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/Palettes.java): `app/src/main/java/com/reed/fcmguard/Palettes.java`
- [Theme panel](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/ThemePanel.java): `app/src/main/java/com/reed/fcmguard/ThemePanel.java`
- [Theme preview](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/ThemePreviewView.java): `app/src/main/java/com/reed/fcmguard/ThemePreviewView.java`
- [Theme colors](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/AppColors.java): `app/src/main/java/com/reed/fcmguard/AppColors.java`
- [Page transition](https://github.com/reedgaooo/fcmguard-hyperos/blob/main/app/src/main/java/com/reed/fcmguard/PageTransition.java): `app/src/main/java/com/reed/fcmguard/PageTransition.java`

### Other components

- **Phone user**
- **HyperOS settings**
- **Google Play services**

## Connections

- Phone user → Main activity: opens and configures (evidence: `README.md`)
- Main activity → Guard service: starts service (evidence: `app/src/main/java/com/reed/fcmguard/MainActivity.java`)
- Boot receiver → Guard service: starts on boot (evidence: `app/src/main/java/com/reed/fcmguard/BootReceiver.java`)
- Guard service → Whitelist repair: checks and repairs (evidence: `app/src/main/java/com/reed/fcmguard/GuardService.java`)
- Whitelist repair → Whitelist setting: reads and writes (evidence: `README.md`)
- Whitelist repair → Google Play services: adds when missing (evidence: `README.md`)
- Guard service → FCM reconnect: reconnects after repair (evidence: `app/src/main/java/com/reed/fcmguard/GuardService.java`)
- Main activity → Sticky dashboard: hosts dashboard (evidence: `app/src/main/java/com/reed/fcmguard/MainActivity.java`)
- Sticky dashboard → Status card: positions and clips (evidence: `app/src/main/java/com/reed/fcmguard/StickyDashboardLayout.java`)
- Sticky dashboard → Status tile stack: coordinates tile stack (evidence: `app/src/main/java/com/reed/fcmguard/StickyDashboardLayout.java`)
- Main activity → FCM app scanner: scans FCM apps (evidence: `app/src/main/java/com/reed/fcmguard/MainActivity.java`)
- Main activity → Autostart reader: checks app status (evidence: `app/src/main/java/com/reed/fcmguard/MainActivity.java`)
- Phone user → Settings navigation: opens app settings (evidence: `README.md`)
- Main activity → Settings navigation: opens vendor settings (evidence: `app/src/main/java/com/reed/fcmguard/MainActivity.java`)
- Main activity → Theme panel: opens theme panel (evidence: `app/src/main/java/com/reed/fcmguard/MainActivity.java`)
- Main activity → Theme preferences: reads appearance (evidence: `app/src/main/java/com/reed/fcmguard/MainActivity.java`)
- Main activity → Page transition: crossfades page (evidence: `app/src/main/java/com/reed/fcmguard/MainActivity.java`)
- Theme panel → Theme preview: renders previews (evidence: `app/src/main/java/com/reed/fcmguard/ThemePanel.java`)
- Theme panel → Theme palettes: lists palette choices (evidence: `app/src/main/java/com/reed/fcmguard/ThemePanel.java`)
- Theme preferences → Theme palettes: resolves palette (evidence: `app/src/main/java/com/reed/fcmguard/ThemeHelper.java`)
- Theme preview → Theme colors: resolves theme colors (evidence: `app/src/main/java/com/reed/fcmguard/ThemePreviewView.java`)
- Sticky dashboard → Glass backdrop: configures glass backdrop (evidence: `app/src/main/java/com/reed/fcmguard/StickyDashboardLayout.java`)
- Glass backdrop → Glass blur: uses blur renderer (evidence: `app/src/main/java/com/reed/fcmguard/GlassBackdropView.java`)
- Status card → Glass blur: uses glass rendering (evidence: `app/src/main/java/com/reed/fcmguard/CollapsingStatusCard.java`)
