# drsexo/frosty architecture

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

- Interactive diagram: https://gitdiagram.com/drsexo/frosty
- Repository: https://github.com/drsexo/frosty

## Overview

Frosty is a root-managed Android battery optimization module, configured through its WebUI. The main flow is user settings in the UI, API-mediated preference storage or shell actions, then device power-management changes. The README also documents GMS freezing, Doze controls, screen-off automation, battery-saver tuning, and system/RAM optimizations. The excerpts show API calls to the app/deep-Doze scripts and a preferences file; many other script dispatches reference `frosty.sh`, which is absent from the supplied tree, so those links are left unverified.

Main entry points: [`module/webroot/api.js`](https://github.com/drsexo/frosty/blob/main/module/webroot/api.js) (WebUI API), [`module/webroot/app.js`](https://github.com/drsexo/frosty/blob/main/module/webroot/app.js) (WebUI), [`module/config/user_prefs`](https://github.com/drsexo/frosty/blob/main/module/config/user_prefs) (User preferences), [`module/scripts/gms_freeze.sh`](https://github.com/drsexo/frosty/blob/main/module/scripts/gms_freeze.sh) (GMS freezing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web interface"]
  node_webui["WebUI<br/>[app.js]"]
  node_api["WebUI API<br/>[api.js]"]
end

subgraph group_control["Settings and control"]
  node_prefs["User preferences"]
  node_gms["GMS freezing<br/>[gms_freeze.sh]"]
  node_tracking["Tracking controls<br/>[kill_tracking.sh]"]
end

subgraph group_power["Power management"]
  node_appdoze["App Doze<br/>[app_doze.sh]"]
  node_deepdoze["Deep Doze<br/>[deep_doze.sh]"]
  node_screenoff["Screen-off automation<br/>[screen_off_opt.sh]"]
  node_batterysaver["Battery-saver tuner<br/>[battery_saver.sh]"]
  node_whitelists["Doze whitelists<br/>[app_doze.sh]"]
end

subgraph group_tuning["System tuning"]
  node_kernel["Kernel tweaks<br/>[kernel_tweaks.sh]"]
  node_ram["RAM optimizer<br/>[ram_optimizer.sh]"]
  node_ramclean["RAM cleaner<br/>[ram_clean.sh]"]
  node_sys["System tweaks<br/>[sys_tweaks.sh]"]
  node_logs["Log killing<br/>[kill_logs.sh]"]
end

node_user(("Device owner"))

node_user -->|"configures"| node_webui
node_webui -->|"calls"| node_api
node_api -->|"reads and writes"| node_prefs
node_api -->|"dispatches"| node_appdoze
node_api -->|"dispatches"| node_deepdoze
node_api -.->|"configures"| node_gms
node_api -.->|"configures"| node_screenoff
node_api -.->|"configures"| node_batterysaver
node_api -.->|"configures"| node_kernel
node_api -.->|"configures"| node_ram
node_api -.->|"dispatches"| node_ramclean
node_api -.->|"configures"| node_sys
node_api -.->|"configures"| node_tracking
node_api -.->|"configures"| node_logs
node_api -.->|"manages"| node_whitelists

click node_webui "https://github.com/drsexo/frosty/blob/main/module/webroot/app.js"
click node_api "https://github.com/drsexo/frosty/blob/main/module/webroot/api.js"
click node_prefs "https://github.com/drsexo/frosty/blob/main/module/config/user_prefs"
click node_gms "https://github.com/drsexo/frosty/blob/main/module/scripts/gms_freeze.sh"
click node_appdoze "https://github.com/drsexo/frosty/blob/main/module/scripts/app_doze.sh"
click node_deepdoze "https://github.com/drsexo/frosty/blob/main/module/scripts/deep_doze.sh"
click node_screenoff "https://github.com/drsexo/frosty/blob/main/module/scripts/screen_off_opt.sh"
click node_batterysaver "https://github.com/drsexo/frosty/blob/main/module/scripts/battery_saver.sh"
click node_kernel "https://github.com/drsexo/frosty/blob/main/module/scripts/kernel_tweaks.sh"
click node_ram "https://github.com/drsexo/frosty/blob/main/module/scripts/ram_optimizer.sh"
click node_ramclean "https://github.com/drsexo/frosty/blob/main/module/scripts/ram_clean.sh"
click node_sys "https://github.com/drsexo/frosty/blob/main/module/scripts/sys_tweaks.sh"
click node_tracking "https://github.com/drsexo/frosty/blob/main/module/scripts/kill_tracking.sh"
click node_logs "https://github.com/drsexo/frosty/blob/main/module/scripts/kill_logs.sh"
click node_whitelists "https://github.com/drsexo/frosty/blob/main/module/scripts/app_doze.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_webui,node_api toneBlue
class node_prefs,node_gms,node_tracking toneAmber
class node_appdoze,node_deepdoze,node_screenoff,node_batterysaver,node_whitelists toneMint
class node_kernel,node_ram,node_ramclean,node_sys,node_logs toneRose
class node_user toneIndigo
```

## Components

### Web interface

- [WebUI](https://github.com/drsexo/frosty/blob/main/module/webroot/app.js): `module/webroot/app.js`
- [WebUI API](https://github.com/drsexo/frosty/blob/main/module/webroot/api.js): `module/webroot/api.js`

### Settings and control

- [User preferences](https://github.com/drsexo/frosty/blob/main/module/config/user_prefs): `module/config/user_prefs`
- [GMS freezing](https://github.com/drsexo/frosty/blob/main/module/scripts/gms_freeze.sh): `module/scripts/gms_freeze.sh`
- [Tracking controls](https://github.com/drsexo/frosty/blob/main/module/scripts/kill_tracking.sh): `module/scripts/kill_tracking.sh`

### Power management

- [App Doze](https://github.com/drsexo/frosty/blob/main/module/scripts/app_doze.sh): `module/scripts/app_doze.sh`
- [Deep Doze](https://github.com/drsexo/frosty/blob/main/module/scripts/deep_doze.sh): `module/scripts/deep_doze.sh`
- [Screen-off automation](https://github.com/drsexo/frosty/blob/main/module/scripts/screen_off_opt.sh): `module/scripts/screen_off_opt.sh`
- [Battery-saver tuner](https://github.com/drsexo/frosty/blob/main/module/scripts/battery_saver.sh): `module/scripts/battery_saver.sh`
- [Doze whitelists](https://github.com/drsexo/frosty/blob/main/module/scripts/app_doze.sh): `module/scripts/app_doze.sh`

### System tuning

- [Kernel tweaks](https://github.com/drsexo/frosty/blob/main/module/scripts/kernel_tweaks.sh): `module/scripts/kernel_tweaks.sh`
- [RAM optimizer](https://github.com/drsexo/frosty/blob/main/module/scripts/ram_optimizer.sh): `module/scripts/ram_optimizer.sh`
- [RAM cleaner](https://github.com/drsexo/frosty/blob/main/module/scripts/ram_clean.sh): `module/scripts/ram_clean.sh`
- [System tweaks](https://github.com/drsexo/frosty/blob/main/module/scripts/sys_tweaks.sh): `module/scripts/sys_tweaks.sh`
- [Log killing](https://github.com/drsexo/frosty/blob/main/module/scripts/kill_logs.sh): `module/scripts/kill_logs.sh`

### Other components

- **Device owner**

## Connections

- Device owner → WebUI: configures (evidence: `README.md`)
- WebUI → WebUI API: calls (evidence: `module/webroot/app.js`)
- WebUI API → User preferences: reads and writes (evidence: `module/webroot/api.js`)
- WebUI API → App Doze: dispatches (evidence: `module/webroot/api.js`)
- WebUI API → Deep Doze: dispatches (evidence: `module/webroot/api.js`)
- WebUI API → GMS freezing: configures
- WebUI API → Screen-off automation: configures
- WebUI API → Battery-saver tuner: configures
- WebUI API → Kernel tweaks: configures
- WebUI API → RAM optimizer: configures
- WebUI API → RAM cleaner: dispatches
- WebUI API → System tweaks: configures
- WebUI API → Tracking controls: configures
- WebUI API → Log killing: configures
- WebUI API → Doze whitelists: manages
