# juniojsv/mtk-easy-su architecture

> Architecture diagram of the GitHub repository juniojsv/mtk-easy-su, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/juniojsv/mtk-easy-su
- Repository: https://github.com/juniojsv/mtk-easy-su

## Overview

Mtk Easy Su is an Android app for attempting bootless superuser access on MediaTek devices. The main workflow is: a user starts the attempt in the activity, the app runs its exploit handler asynchronously, and the activity displays the resulting status and log. The handler extracts bundled Magisk and mtk-su assets, runs shell commands, and checks for `/sbin/su`. The app also checks GitHub for releases and supports ads and utility UI features. README capabilities are represented where documented; unsampled behavior is not inferred beyond those statements.

Main entry points: [`app/src/main/java/juniojsv/mtk/easy/su/ExploitHandler.kt`](https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/ExploitHandler.kt) (Exploit handler), [`app/src/main/java/juniojsv/mtk/easy/su/MainActivity.kt`](https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/MainActivity.kt) (Main screen), [`app/src/main/java/juniojsv/mtk/easy/su/GithubRepository.kt`](https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/GithubRepository.kt) (Release repository), [`app/src/main/java/juniojsv/mtk/easy/su/Keys.kt`](https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/Keys.kt) (User preferences)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Android app"]
  node_activity["Main screen<br/>[MainActivity.kt]"]
  node_preferences["User preferences<br/>[Keys.kt]"]
  node_ui_helpers["UI helpers<br/>[Extensions.kt]"]
end

subgraph group_root["Root attempt"]
  node_exploit["Exploit handler<br/>[ExploitHandler.kt]"]
  node_task["Background task<br/>[CoroutineTask.kt]"]
  node_root_assets["Root assets"]
  node_shell["Device shell"]
  node_root_state[("Root access state")]
end

subgraph group_updates["Release updates"]
  node_repository["Release repository"]
  node_release["Release data<br/>[GithubRelease.kt]"]
end

subgraph group_integrations["External integrations"]
  node_github_api["GitHub releases API"]
  node_ad_service["Ad service"]
end

node_user(("Device user"))
node_terminal_user(("Terminal user"))

node_user -->|"uses"| node_activity
node_activity -->|"reads and saves"| node_preferences
node_activity -->|"uses"| node_ui_helpers
node_activity -->|"starts attempt"| node_exploit
node_exploit -->|"extends"| node_task
node_exploit -->|"extracts"| node_root_assets
node_exploit -->|"reads bitness"| node_preferences
node_exploit -->|"runs commands"| node_shell
node_exploit -->|"checks for su"| node_root_state
node_exploit -->|"reads output"| node_ui_helpers
node_exploit -->|"returns result"| node_activity
node_activity -->|"requests latest release"| node_repository
node_repository -->|"fetches release"| node_github_api
node_repository -->|"returns model"| node_release
node_activity -->|"loads ads"| node_ad_service
node_terminal_user -.->|"uses mtk-su"| node_root_assets

click node_activity "https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/MainActivity.kt"
click node_preferences "https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/Keys.kt"
click node_ui_helpers "https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/Extensions.kt"
click node_exploit "https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/ExploitHandler.kt"
click node_task "https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/CoroutineTask.kt"
click node_root_assets "https://github.com/juniojsv/mtk-easy-su/tree/master/app/src/main/assets"
click node_repository "https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/GithubRepository.kt"
click node_release "https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/GithubRelease.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_preferences,node_ui_helpers,node_user,node_terminal_user toneBlue
class node_exploit,node_task,node_root_assets,node_shell,node_root_state toneAmber
class node_repository,node_release toneMint
class node_github_api,node_ad_service toneRose
```

## Components

### Android app

- [Main screen](https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/MainActivity.kt): `app/src/main/java/juniojsv/mtk/easy/su/MainActivity.kt`
- [User preferences](https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/Keys.kt): `app/src/main/java/juniojsv/mtk/easy/su/Keys.kt`
- [UI helpers](https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/Extensions.kt): `app/src/main/java/juniojsv/mtk/easy/su/Extensions.kt`

### Root attempt

- [Exploit handler](https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/ExploitHandler.kt): `app/src/main/java/juniojsv/mtk/easy/su/ExploitHandler.kt`
- [Background task](https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/CoroutineTask.kt): `app/src/main/java/juniojsv/mtk/easy/su/CoroutineTask.kt`
- [Root assets](https://github.com/juniojsv/mtk-easy-su/tree/master/app/src/main/assets): `app/src/main/assets`
- **Device shell**
- **Root access state**

### Release updates

- [Release repository](https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/GithubRepository.kt): `app/src/main/java/juniojsv/mtk/easy/su/GithubRepository.kt`
- [Release data](https://github.com/juniojsv/mtk-easy-su/blob/master/app/src/main/java/juniojsv/mtk/easy/su/GithubRelease.kt): `app/src/main/java/juniojsv/mtk/easy/su/GithubRelease.kt`

### External integrations

- **GitHub releases API**
- **Ad service**

### Other components

- **Device user**
- **Terminal user**

## Connections

- Device user → Main screen: uses (evidence: `app/src/main/java/juniojsv/mtk/easy/su/MainActivity.kt`)
- Main screen → User preferences: reads and saves (evidence: `app/src/main/java/juniojsv/mtk/easy/su/MainActivity.kt`)
- Main screen → UI helpers: uses (evidence: `app/src/main/java/juniojsv/mtk/easy/su/MainActivity.kt`)
- Main screen → Exploit handler: starts attempt (evidence: `app/src/main/java/juniojsv/mtk/easy/su/MainActivity.kt`)
- Exploit handler → Background task: extends (evidence: `app/src/main/java/juniojsv/mtk/easy/su/ExploitHandler.kt`)
- Exploit handler → Root assets: extracts (evidence: `app/src/main/java/juniojsv/mtk/easy/su/ExploitHandler.kt`)
- Exploit handler → User preferences: reads bitness (evidence: `app/src/main/java/juniojsv/mtk/easy/su/ExploitHandler.kt`)
- Exploit handler → Device shell: runs commands (evidence: `app/src/main/java/juniojsv/mtk/easy/su/ExploitHandler.kt`)
- Exploit handler → Root access state: checks for su (evidence: `app/src/main/java/juniojsv/mtk/easy/su/ExploitHandler.kt`)
- Exploit handler → UI helpers: reads output (evidence: `app/src/main/java/juniojsv/mtk/easy/su/ExploitHandler.kt`)
- Exploit handler → Main screen: returns result (evidence: `app/src/main/java/juniojsv/mtk/easy/su/MainActivity.kt`)
- Main screen → Release repository: requests latest release (evidence: `app/src/main/java/juniojsv/mtk/easy/su/MainActivity.kt`)
- Release repository → GitHub releases API: fetches release (evidence: `app/src/main/java/juniojsv/mtk/easy/su/GithubRepository.kt`)
- Release repository → Release data: returns model (evidence: `app/src/main/java/juniojsv/mtk/easy/su/GithubRepository.kt`)
- Main screen → Ad service: loads ads (evidence: `app/src/main/java/juniojsv/mtk/easy/su/MainActivity.kt`)
- Terminal user → Root assets: uses mtk-su (evidence: `README.md`)
