# vermashobhit737-droid/automatedroot architecture

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

- Interactive diagram: https://gitdiagram.com/vermashobhit737-droid/automatedroot
- Repository: https://github.com/vermashobhit737-droid/automatedroot

## Overview

AutomatedRoot is a Python command-line tool for rooting or unrooting MediaTek Android devices through ADB and the mtk-su exploit. The user selects an operation; the tool connects to a device, gathers and validates its platform details, transfers files, then runs the selected rooting or unrooting procedure. The documented modes are system-mode with SuperSU, bootless-mode with Magisk, and unrooting. The excerpts show orchestration and device operations, but not the contents of the shell scripts or binary payloads, so their internal behavior is not expanded here.

Main entry points: [`automated_root/utils/mtksu.py`](https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/utils/mtksu.py) (Operation handler), [`mtk-su.py`](https://github.com/vermashobhit737-droid/automatedroot/blob/main/mtk-su.py) (CLI entry point), [`automated_root/utils/device.py`](https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/utils/device.py) (Device operations), [`automated_root/utils/config.py`](https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/utils/config.py) (Tool configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and configuration"]
  node_entry["CLI entry point<br/>[mtk-su.py]"]
  node_settings["Tool configuration<br/>[config.py]"]
  node_logging["Logging and errors<br/>[logger.py]"]
  node_dispatch["Option dispatch<br/>[switch.py]"]
end

subgraph group_device["Device operations"]
  node_device_api["Device operations<br/>[device.py]"]
end

subgraph group_operations["Root operations"]
  node_orchestrator["Operation handler<br/>[mtksu.py]"]
  node_system_script["System root script<br/>[root.sh]"]
  node_magisk_script["Bootless root script<br/>[magisk-root.sh]"]
  node_unroot_script["Unroot script<br/>[unroot.sh]"]
end

subgraph group_payloads["Operation payloads"]
  node_assets["Device payloads"]
end

node_user(("Operator"))
node_adb["ADB service"]
node_device_actor(("Android device"))

node_user -->|"selects operation"| node_entry
node_entry -->|"reads options"| node_settings
node_entry -->|"starts service"| node_adb
node_entry -->|"dispatches operation"| node_orchestrator
node_entry -->|"reports errors"| node_logging
node_orchestrator -->|"reads settings"| node_settings
node_orchestrator -->|"runs device workflow"| node_device_api
node_orchestrator -->|"selects mode"| node_dispatch
node_orchestrator -->|"reports status"| node_logging
node_device_api -->|"reads settings"| node_settings
node_device_api -->|"reports device"| node_logging
node_device_api -->|"uses client"| node_adb
node_adb -->|"controls device"| node_device_actor
node_orchestrator -->|"pushes and installs"| node_assets
node_orchestrator -->|"runs via exploit"| node_system_script
node_orchestrator -->|"runs on device"| node_magisk_script
node_orchestrator -->|"runs via exploit"| node_unroot_script

click node_entry "https://github.com/vermashobhit737-droid/automatedroot/blob/main/mtk-su.py"
click node_settings "https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/utils/config.py"
click node_logging "https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/utils/logger.py"
click node_dispatch "https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/utils/switch.py"
click node_orchestrator "https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/utils/mtksu.py"
click node_device_api "https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/utils/device.py"
click node_assets "https://github.com/vermashobhit737-droid/automatedroot/tree/main/automated_root/files"
click node_system_script "https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/files/common/root.sh"
click node_magisk_script "https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/files/common/magisk-root.sh"
click node_unroot_script "https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/files/common/unroot.sh"

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_entry,node_settings,node_logging,node_dispatch toneBlue
class node_device_api toneAmber
class node_orchestrator,node_system_script,node_magisk_script,node_unroot_script toneMint
class node_assets toneRose
class node_user,node_adb,node_device_actor toneIndigo
```

## Components

### CLI and configuration

- [CLI entry point](https://github.com/vermashobhit737-droid/automatedroot/blob/main/mtk-su.py): `mtk-su.py`
- [Tool configuration](https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/utils/config.py): `automated_root/utils/config.py`
- [Logging and errors](https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/utils/logger.py): `automated_root/utils/logger.py`
- [Option dispatch](https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/utils/switch.py): `automated_root/utils/switch.py`

### Device operations

- [Device operations](https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/utils/device.py): `automated_root/utils/device.py`

### Root operations

- [Operation handler](https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/utils/mtksu.py): `automated_root/utils/mtksu.py`
- [System root script](https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/files/common/root.sh): `automated_root/files/common/root.sh`
- [Bootless root script](https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/files/common/magisk-root.sh): `automated_root/files/common/magisk-root.sh`
- [Unroot script](https://github.com/vermashobhit737-droid/automatedroot/blob/main/automated_root/files/common/unroot.sh): `automated_root/files/common/unroot.sh`

### Operation payloads

- [Device payloads](https://github.com/vermashobhit737-droid/automatedroot/tree/main/automated_root/files): `automated_root/files`

### Other components

- **Operator**
- **ADB service**
- **Android device**

## Connections

- Operator → CLI entry point: selects operation (evidence: `mtk-su.py`)
- CLI entry point → Tool configuration: reads options (evidence: `mtk-su.py`)
- CLI entry point → ADB service: starts service (evidence: `mtk-su.py`)
- CLI entry point → Operation handler: dispatches operation (evidence: `mtk-su.py`)
- CLI entry point → Logging and errors: reports errors (evidence: `mtk-su.py`)
- Operation handler → Tool configuration: reads settings (evidence: `automated_root/utils/mtksu.py`)
- Operation handler → Device operations: runs device workflow (evidence: `automated_root/utils/mtksu.py`)
- Operation handler → Option dispatch: selects mode (evidence: `automated_root/utils/mtksu.py`)
- Operation handler → Logging and errors: reports status (evidence: `automated_root/utils/mtksu.py`)
- Device operations → Tool configuration: reads settings (evidence: `automated_root/utils/device.py`)
- Device operations → Logging and errors: reports device (evidence: `automated_root/utils/device.py`)
- Device operations → ADB service: uses client (evidence: `automated_root/utils/device.py`)
- ADB service → Android device: controls device
- Operation handler → Device payloads: pushes and installs (evidence: `automated_root/utils/mtksu.py`)
- Operation handler → System root script: runs via exploit (evidence: `automated_root/utils/mtksu.py`)
- Operation handler → Bootless root script: runs on device (evidence: `automated_root/utils/mtksu.py`)
- Operation handler → Unroot script: runs via exploit (evidence: `automated_root/utils/mtksu.py`)
