# gathin23/cleanyourtv architecture

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

- Interactive diagram: https://gitdiagram.com/gathin23/cleanyourtv
- Repository: https://github.com/gathin23/cleanyourtv
- Video tour (about a minute): https://gitdiagram.com/gathin23/cleanyourtv/video

## Overview

CleanYourTV replaces an Android TV’s ad-filled home with a configurable launcher, while leaving disabled packages installed and providing a restore path. The documented workflow is: connect over Wi‑Fi with ADB, back up package/settings state, disable selected bloat, then install the launcher as Home. The launcher also handles remote-key behavior; the repository tree shows many independent TV add-ons, including screensavers, utilities, calendars, and smart-home integrations. Launcher UI internals and most add-on wiring were not sampled, so those relationships are omitted or marked unverified.

Main entry points: [`tools/disable.sh`](https://github.com/gathin23/cleanyourtv/blob/main/tools/disable.sh) (Bloat disabling), [`launcher/build-and-install.sh`](https://github.com/gathin23/cleanyourtv/blob/main/launcher/build-and-install.sh) (Launcher install), [`launcher`](https://github.com/gathin23/cleanyourtv/tree/main/launcher) (CleanYourTV home), [`launcher/app/src/main/java/com/gathin/tvhome/RemoteKeys.java`](https://github.com/gathin23/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/RemoteKeys.java) (Remote key mapping)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["TV setup"]
  node_backup["State backup<br/>[disable.sh]"]
  node_disable["Bloat disabling<br/>[disable.sh]"]
  node_restore["Restore path<br/>[disable.sh]"]
  node_install["Launcher install"]
end

subgraph group_launcher["Launcher"]
  node_home["CleanYourTV home"]
  node_homekeys["Home key service"]
  node_inputkeys["Input key service"]
  node_remote["Remote key mapping<br/>[RemoteKeys.java]"]
  node_theme["Themes and cards"]
end

subgraph group_addons["TV add-ons"]
  node_frigate["Frigate Glance<br/>[GlanceService.java]"]
  node_frigateconfig[("Frigate settings<br/>[ConfigStore.java]")]
  node_gamecalendar["Game calendars<br/>[Calendar.java]"]
  node_news["News screensaver<br/>[News.java]"]
  node_photos["Photo screensavers"]
  node_smart["Smart home<br/>[HaClient.java]"]
  node_brightness["Brightness control<br/>[DimService.java]"]
  node_tatami["Tatami screensaver<br/>[View.java]"]
end

node_user(("TV owner"))
node_tv["Android TV"]
node_adb["ADB over Wi-Fi"]

node_user -->|"enables debugging"| node_tv
node_user -->|"connects over Wi-Fi"| node_adb
node_adb -->|"backs up"| node_backup
node_backup -->|"precedes"| node_disable
node_adb -->|"disables packages"| node_disable
node_disable -->|"can undo"| node_restore
node_adb -->|"installs"| node_install
node_install -->|"sets as Home"| node_home
node_homekeys -->|"uses key mappings"| node_remote
node_inputkeys -->|"dispatches keys"| node_remote
node_home -.->|"supports"| node_theme
node_frigate -->|"loads settings"| node_frigateconfig

click node_backup "https://github.com/gathin23/cleanyourtv/blob/main/tools/disable.sh"
click node_disable "https://github.com/gathin23/cleanyourtv/blob/main/tools/disable.sh"
click node_restore "https://github.com/gathin23/cleanyourtv/blob/main/tools/disable.sh"
click node_install "https://github.com/gathin23/cleanyourtv/blob/main/launcher/build-and-install.sh"
click node_home "https://github.com/gathin23/cleanyourtv/tree/main/launcher"
click node_homekeys "https://github.com/gathin23/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/HomeKeyService.java"
click node_inputkeys "https://github.com/gathin23/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/InputKeyService.java"
click node_remote "https://github.com/gathin23/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/RemoteKeys.java"
click node_theme "https://github.com/gathin23/cleanyourtv/tree/main/launcher"
click node_frigate "https://github.com/gathin23/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceService.java"
click node_frigateconfig "https://github.com/gathin23/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/ConfigStore.java"
click node_gamecalendar "https://github.com/gathin23/cleanyourtv/blob/main/addons/game-day/app/src/main/java/io/github/justinnewman/gameday/Calendar.java"
click node_news "https://github.com/gathin23/cleanyourtv/blob/main/addons/news-screensaver/app/src/main/java/com/gathin/newsdream/News.java"
click node_photos "https://github.com/gathin23/cleanyourtv/tree/main/addons/photo-screensaver"
click node_smart "https://github.com/gathin23/cleanyourtv/blob/main/addons/smart-home/app/src/main/java/io/github/maxhayim/smarthome/HaClient.java"
click node_brightness "https://github.com/gathin23/cleanyourtv/blob/main/addons/brightness/app/src/main/java/io/github/maxhayim/brightness/DimService.java"
click node_tatami "https://github.com/gathin23/cleanyourtv/blob/main/addons/tatami/plan/src/main/java/io/github/pbanddev/tatami/View.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_backup,node_disable,node_restore,node_install toneBlue
class node_home,node_homekeys,node_inputkeys,node_remote,node_theme toneAmber
class node_frigate,node_frigateconfig,node_gamecalendar,node_news,node_photos,node_smart,node_brightness,node_tatami toneMint
class node_user,node_tv,node_adb toneIndigo
```

## Components

### TV setup

- [State backup](https://github.com/gathin23/cleanyourtv/blob/main/tools/disable.sh): `tools/disable.sh`
- [Bloat disabling](https://github.com/gathin23/cleanyourtv/blob/main/tools/disable.sh): `tools/disable.sh`
- [Restore path](https://github.com/gathin23/cleanyourtv/blob/main/tools/disable.sh): `tools/disable.sh`
- [Launcher install](https://github.com/gathin23/cleanyourtv/blob/main/launcher/build-and-install.sh): `launcher/build-and-install.sh`

### Launcher

- [CleanYourTV home](https://github.com/gathin23/cleanyourtv/tree/main/launcher): `launcher`
- [Home key service](https://github.com/gathin23/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/HomeKeyService.java): `launcher/app/src/main/java/com/gathin/tvhome/HomeKeyService.java`
- [Input key service](https://github.com/gathin23/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/InputKeyService.java): `launcher/app/src/main/java/com/gathin/tvhome/InputKeyService.java`
- [Remote key mapping](https://github.com/gathin23/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/RemoteKeys.java): `launcher/app/src/main/java/com/gathin/tvhome/RemoteKeys.java`
- [Themes and cards](https://github.com/gathin23/cleanyourtv/tree/main/launcher): `launcher`

### TV add-ons

- [Frigate Glance](https://github.com/gathin23/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceService.java): `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceService.java`
- [Frigate settings](https://github.com/gathin23/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/ConfigStore.java): `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/ConfigStore.java`
- [Game calendars](https://github.com/gathin23/cleanyourtv/blob/main/addons/game-day/app/src/main/java/io/github/justinnewman/gameday/Calendar.java): `addons/game-day/app/src/main/java/io/github/justinnewman/gameday/Calendar.java`
- [News screensaver](https://github.com/gathin23/cleanyourtv/blob/main/addons/news-screensaver/app/src/main/java/com/gathin/newsdream/News.java): `addons/news-screensaver/app/src/main/java/com/gathin/newsdream/News.java`
- [Photo screensavers](https://github.com/gathin23/cleanyourtv/tree/main/addons/photo-screensaver): `addons/photo-screensaver`
- [Smart home](https://github.com/gathin23/cleanyourtv/blob/main/addons/smart-home/app/src/main/java/io/github/maxhayim/smarthome/HaClient.java): `addons/smart-home/app/src/main/java/io/github/maxhayim/smarthome/HaClient.java`
- [Brightness control](https://github.com/gathin23/cleanyourtv/blob/main/addons/brightness/app/src/main/java/io/github/maxhayim/brightness/DimService.java): `addons/brightness/app/src/main/java/io/github/maxhayim/brightness/DimService.java`
- [Tatami screensaver](https://github.com/gathin23/cleanyourtv/blob/main/addons/tatami/plan/src/main/java/io/github/pbanddev/tatami/View.java): `addons/tatami/plan/src/main/java/io/github/pbanddev/tatami/View.java`

### Other components

- **TV owner**
- **Android TV**
- **ADB over Wi-Fi**

## Connections

- TV owner → Android TV: enables debugging
- TV owner → ADB over Wi-Fi: connects over Wi-Fi
- ADB over Wi-Fi → State backup: backs up
- State backup → Bloat disabling: precedes
- ADB over Wi-Fi → Bloat disabling: disables packages
- Bloat disabling → Restore path: can undo
- ADB over Wi-Fi → Launcher install: installs
- Launcher install → CleanYourTV home: sets as Home
- Home key service → Remote key mapping: uses key mappings (evidence: `launcher/app/src/main/java/com/gathin/tvhome/HomeKeyService.java`)
- Input key service → Remote key mapping: dispatches keys (evidence: `launcher/app/src/main/java/com/gathin/tvhome/InputKeyService.java`)
- CleanYourTV home → Themes and cards: supports
- Frigate Glance → Frigate settings: loads settings (evidence: `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceService.java`)
