# zenyxx-xd/rootmyvivo architecture

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

- Interactive diagram: https://gitdiagram.com/zenyxx-xd/rootmyvivo
- Repository: https://github.com/zenyxx-xd/rootmyvivo

## Overview

RootMyVivo is an Android app that temporarily roots supported locked-bootloader vivo/iQOO devices with a kernel-matched GhostLock payload, then installs a chosen KernelSU manager. The main path runs from the user through the Compose UI and ViewModel into catalog matching, payload execution and KernelSU installation, using Shizuku/ADB or root shell transport. Separate branches cover boot-time root recovery, device/catalog discovery, logs, settings and in-app updates. Edges reflect excerpts, SOURCE INDEX references or README statements; unsampled implementation details are not inferred.

Main entry points: [`app/src/main/java/com/rootmyvivo/vm/MainViewModel.kt`](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/vm/MainViewModel.kt) (Main ViewModel), [`app/src/main/java/com/rootmyvivo/root/ExploitEngine.kt`](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/root/ExploitEngine.kt) (Exploit engine), [`app/src/main/java/com/rootmyvivo/shell/Transport.kt`](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/shell/Transport.kt) (Shell transport), [`app/src/main/java/com/rootmyvivo/ui/App.kt`](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/ui/App.kt) (Navigation UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["App UI"]
  node_activity["Main activity<br/>[MainActivity.kt]"]
  node_app_ui["Navigation UI<br/>[App.kt]"]
  node_home_ui["Home and device screens"]
  node_flow_ui["Root flow screen"]
  node_other_ui["Settings and logs"]
end

subgraph group_control["App orchestration"]
  node_viewmodel["Main ViewModel<br/>[MainViewModel.kt]"]
  node_state["App state<br/>[AppState.kt]"]
end

subgraph group_root["Root workflow"]
  node_engine["Exploit engine<br/>[ExploitEngine.kt]"]
  node_runner["Local runner<br/>[LocalRunner.kt]"]
  node_installer["KernelSU installer<br/>[KsuInstaller.kt]"]
  node_variants["KernelSU variants<br/>[KsuVariant.kt]"]
  node_reports["Root reports<br/>[RootReport.kt]"]
  node_traces["Root traces<br/>[RootTraces.kt]"]
end

subgraph group_access["Data and access"]
  node_catalog["Payload catalog<br/>[Catalog.kt]"]
  node_device["Device detection<br/>[Device.kt]"]
  node_prefs[("Preferences<br/>[Prefs.kt]")]
  node_updater["App updater<br/>[AppUpdater.kt]"]
  node_transport["Shell transport<br/>[Transport.kt]"]
  node_adbwire["ADB wire protocol<br/>[AdbWire.kt]"]
end

subgraph group_recovery["Boot recovery"]
  node_boot_receiver["Boot receiver<br/>[BootReceiver.kt]"]
  node_boot_service["Boot root service<br/>[BootRootService.kt]"]
  node_exploit_service["Foreground service<br/>[ExploitService.kt]"]
end

node_user(("Device owner"))
node_shizuku["Shizuku / ADB"]
node_payload_repo["Payload catalog host"]
node_release_hosts["Download hosts"]

node_user -->|"opens"| node_activity
node_shizuku -->|"provides shell"| node_transport
node_activity -->|"creates"| node_viewmodel
node_activity -->|"renders"| node_app_ui
node_app_ui -->|"routes to"| node_home_ui
node_app_ui -->|"routes to"| node_flow_ui
node_app_ui -->|"routes to"| node_other_ui
node_app_ui -->|"uses state"| node_viewmodel
node_home_ui -->|"invokes actions"| node_viewmodel
node_viewmodel -->|"updates"| node_state
node_viewmodel -->|"fetches and matches"| node_catalog
node_catalog -->|"fetches catalog"| node_payload_repo
node_viewmodel -.->|"detects device"| node_device
node_viewmodel -->|"starts root"| node_engine
node_engine -->|"selects payload"| node_catalog
node_engine -->|"runs payload"| node_runner
node_engine -->|"installs manager"| node_installer
node_engine -->|"checks root"| node_transport
node_engine -->|"creates proof"| node_reports
node_engine -->|"records traces"| node_traces
node_installer -->|"executes root commands"| node_transport
node_installer -->|"runs local commands"| node_runner
node_installer -->|"uses variant"| node_variants
node_installer -.->|"downloads manager files"| node_release_hosts
node_viewmodel -->|"checks updates"| node_updater
node_viewmodel -->|"refreshes transport"| node_transport
node_transport -->|"sends shell commands"| node_adbwire
node_transport -->|"reads settings"| node_prefs
node_viewmodel -.->|"stores preferences"| node_prefs
node_boot_receiver -->|"starts on boot"| node_boot_service
node_boot_service -->|"checks recovery setting"| node_prefs
node_boot_service -->|"relaunches payload"| node_runner
node_boot_service -->|"checks root transport"| node_transport
node_viewmodel -->|"keeps flow active"| node_exploit_service

click node_activity "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/MainActivity.kt"
click node_app_ui "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/ui/App.kt"
click node_home_ui "https://github.com/zenyxx-xd/rootmyvivo/tree/main/app/src/main/java/com/rootmyvivo/ui/home"
click node_flow_ui "https://github.com/zenyxx-xd/rootmyvivo/tree/main/app/src/main/java/com/rootmyvivo/ui/flow"
click node_other_ui "https://github.com/zenyxx-xd/rootmyvivo/tree/main/app/src/main/java/com/rootmyvivo/ui"
click node_viewmodel "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/vm/MainViewModel.kt"
click node_state "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/vm/AppState.kt"
click node_catalog "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/data/Catalog.kt"
click node_device "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/data/Device.kt"
click node_prefs "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/data/Prefs.kt"
click node_updater "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/data/AppUpdater.kt"
click node_engine "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/root/ExploitEngine.kt"
click node_runner "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/root/LocalRunner.kt"
click node_installer "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/root/KsuInstaller.kt"
click node_variants "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/root/KsuVariant.kt"
click node_reports "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/data/RootReport.kt"
click node_traces "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/root/RootTraces.kt"
click node_transport "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/shell/Transport.kt"
click node_adbwire "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/shell/AdbWire.kt"
click node_boot_receiver "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/BootReceiver.kt"
click node_boot_service "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/BootRootService.kt"
click node_exploit_service "https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/ExploitService.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_activity,node_app_ui,node_home_ui,node_flow_ui,node_other_ui toneBlue
class node_viewmodel,node_state toneAmber
class node_engine,node_runner,node_installer,node_variants,node_reports,node_traces toneMint
class node_catalog,node_device,node_prefs,node_updater,node_transport,node_adbwire toneRose
class node_boot_receiver,node_boot_service,node_exploit_service,node_user,node_shizuku,node_payload_repo,node_release_hosts toneIndigo
```

## Components

### App UI

- [Main activity](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/MainActivity.kt): `app/src/main/java/com/rootmyvivo/MainActivity.kt`
- [Navigation UI](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/ui/App.kt): `app/src/main/java/com/rootmyvivo/ui/App.kt`
- [Home and device screens](https://github.com/zenyxx-xd/rootmyvivo/tree/main/app/src/main/java/com/rootmyvivo/ui/home): `app/src/main/java/com/rootmyvivo/ui/home`
- [Root flow screen](https://github.com/zenyxx-xd/rootmyvivo/tree/main/app/src/main/java/com/rootmyvivo/ui/flow): `app/src/main/java/com/rootmyvivo/ui/flow`
- [Settings and logs](https://github.com/zenyxx-xd/rootmyvivo/tree/main/app/src/main/java/com/rootmyvivo/ui): `app/src/main/java/com/rootmyvivo/ui`

### App orchestration

- [Main ViewModel](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/vm/MainViewModel.kt): `app/src/main/java/com/rootmyvivo/vm/MainViewModel.kt`
- [App state](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/vm/AppState.kt): `app/src/main/java/com/rootmyvivo/vm/AppState.kt`

### Root workflow

- [Exploit engine](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/root/ExploitEngine.kt): `app/src/main/java/com/rootmyvivo/root/ExploitEngine.kt`
- [Local runner](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/root/LocalRunner.kt): `app/src/main/java/com/rootmyvivo/root/LocalRunner.kt`
- [KernelSU installer](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/root/KsuInstaller.kt): `app/src/main/java/com/rootmyvivo/root/KsuInstaller.kt`
- [KernelSU variants](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/root/KsuVariant.kt): `app/src/main/java/com/rootmyvivo/root/KsuVariant.kt`
- [Root reports](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/data/RootReport.kt): `app/src/main/java/com/rootmyvivo/data/RootReport.kt`
- [Root traces](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/root/RootTraces.kt): `app/src/main/java/com/rootmyvivo/root/RootTraces.kt`

### Data and access

- [Payload catalog](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/data/Catalog.kt): `app/src/main/java/com/rootmyvivo/data/Catalog.kt`
- [Device detection](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/data/Device.kt): `app/src/main/java/com/rootmyvivo/data/Device.kt`
- [Preferences](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/data/Prefs.kt): `app/src/main/java/com/rootmyvivo/data/Prefs.kt`
- [App updater](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/data/AppUpdater.kt): `app/src/main/java/com/rootmyvivo/data/AppUpdater.kt`
- [Shell transport](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/shell/Transport.kt): `app/src/main/java/com/rootmyvivo/shell/Transport.kt`
- [ADB wire protocol](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/shell/AdbWire.kt): `app/src/main/java/com/rootmyvivo/shell/AdbWire.kt`

### Boot recovery

- [Boot receiver](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/BootReceiver.kt): `app/src/main/java/com/rootmyvivo/BootReceiver.kt`
- [Boot root service](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/BootRootService.kt): `app/src/main/java/com/rootmyvivo/BootRootService.kt`
- [Foreground service](https://github.com/zenyxx-xd/rootmyvivo/blob/main/app/src/main/java/com/rootmyvivo/ExploitService.kt): `app/src/main/java/com/rootmyvivo/ExploitService.kt`

### Other components

- **Device owner**
- **Shizuku / ADB**
- **Payload catalog host**
- **Download hosts**

## Connections

- Device owner → Main activity: opens (evidence: `README.md`)
- Shizuku / ADB → Shell transport: provides shell (evidence: `README.md`)
- Main activity → Main ViewModel: creates (evidence: `app/src/main/java/com/rootmyvivo/MainActivity.kt`)
- Main activity → Navigation UI: renders (evidence: `app/src/main/java/com/rootmyvivo/MainActivity.kt`)
- Navigation UI → Home and device screens: routes to (evidence: `app/src/main/java/com/rootmyvivo/ui/App.kt`)
- Navigation UI → Root flow screen: routes to (evidence: `app/src/main/java/com/rootmyvivo/ui/App.kt`)
- Navigation UI → Settings and logs: routes to (evidence: `app/src/main/java/com/rootmyvivo/ui/App.kt`)
- Navigation UI → Main ViewModel: uses state (evidence: `app/src/main/java/com/rootmyvivo/ui/App.kt`)
- Home and device screens → Main ViewModel: invokes actions (evidence: `app/src/main/java/com/rootmyvivo/ui/home/HomeScreen.kt`)
- Main ViewModel → App state: updates (evidence: `app/src/main/java/com/rootmyvivo/vm/MainViewModel.kt`)
- Main ViewModel → Payload catalog: fetches and matches (evidence: `app/src/main/java/com/rootmyvivo/vm/MainViewModel.kt`)
- Payload catalog → Payload catalog host: fetches catalog (evidence: `README.md`)
- Main ViewModel → Device detection: detects device
- Main ViewModel → Exploit engine: starts root (evidence: `app/src/main/java/com/rootmyvivo/vm/MainViewModel.kt`)
- Exploit engine → Payload catalog: selects payload (evidence: `app/src/main/java/com/rootmyvivo/root/ExploitEngine.kt`)
- Exploit engine → Local runner: runs payload (evidence: `app/src/main/java/com/rootmyvivo/root/ExploitEngine.kt`)
- Exploit engine → KernelSU installer: installs manager (evidence: `app/src/main/java/com/rootmyvivo/root/ExploitEngine.kt`)
- Exploit engine → Shell transport: checks root (evidence: `app/src/main/java/com/rootmyvivo/root/ExploitEngine.kt`)
- Exploit engine → Root reports: creates proof (evidence: `app/src/main/java/com/rootmyvivo/root/ExploitEngine.kt`)
- Exploit engine → Root traces: records traces (evidence: `app/src/main/java/com/rootmyvivo/root/ExploitEngine.kt`)
- KernelSU installer → Shell transport: executes root commands (evidence: `app/src/main/java/com/rootmyvivo/root/KsuInstaller.kt`)
- KernelSU installer → Local runner: runs local commands (evidence: `app/src/main/java/com/rootmyvivo/root/KsuInstaller.kt`)
- KernelSU installer → KernelSU variants: uses variant (evidence: `app/src/main/java/com/rootmyvivo/root/KsuInstaller.kt`)
- KernelSU installer → Download hosts: downloads manager files
- Main ViewModel → App updater: checks updates (evidence: `app/src/main/java/com/rootmyvivo/vm/MainViewModel.kt`)
- Main ViewModel → Shell transport: refreshes transport (evidence: `app/src/main/java/com/rootmyvivo/vm/MainViewModel.kt`)
- Shell transport → ADB wire protocol: sends shell commands (evidence: `app/src/main/java/com/rootmyvivo/shell/Transport.kt`)
- Shell transport → Preferences: reads settings (evidence: `app/src/main/java/com/rootmyvivo/shell/Transport.kt`)
- Main ViewModel → Preferences: stores preferences (evidence: `app/src/main/java/com/rootmyvivo/vm/MainViewModel.kt`)
- Boot receiver → Boot root service: starts on boot (evidence: `app/src/main/java/com/rootmyvivo/BootReceiver.kt`)
- Boot root service → Preferences: checks recovery setting (evidence: `app/src/main/java/com/rootmyvivo/BootRootService.kt`)
- Boot root service → Local runner: relaunches payload (evidence: `app/src/main/java/com/rootmyvivo/BootRootService.kt`)
- Boot root service → Shell transport: checks root transport (evidence: `app/src/main/java/com/rootmyvivo/BootRootService.kt`)
- Main ViewModel → Foreground service: keeps flow active (evidence: `app/src/main/java/com/rootmyvivo/vm/MainViewModel.kt`)
