Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

docs: a list PR adds only its folder and a tv.json; the TV tables are generated

Gathin23ba84e8f8c427
diff --git a/.github/maintainer/MAINTAINER.md b/.github/maintainer/MAINTAINER.md
index 3d4056ba3..4739ec1ea 100644
--- a/.github/maintainer/MAINTAINER.md
+++ b/.github/maintainer/MAINTAINER.md
@@ -30,7 +30,7 @@ it, and every one of them gets a home. Pick the smallest home that fits (CONTRIB
## Verdicts
- **merge**: correct, in scope, tested where it matters, nothing to change.
-- **merge-with-fix**: a small mechanical change makes it mergeable (add the README/examples row, a string missing
+- **merge-with-fix**: a small mechanical change makes it mergeable (add a missing `tv.json`, a string missing
in one or two locales, drop a stray file, comment out an untested entry, trim a SHOWCASE cell to one line).
Say exactly what to change in `fix`.
- **rework**: worth having but the author must change something real. One clear ask.
@@ -61,7 +61,11 @@ it, and every one of them gets a home. Pick the smallest home that fits (CONTRIB
can be its own folder (#653, #768). It is a judgement call: set confidence accordingly.
- Edits to a list already on main (second units, notes, corrections) are judgement calls; decide only when the
change is clearly right.
-- A new list needs its row in README and examples/README (missing → merge-with-fix: add the rows).
+- A new list needs `examples/<folder>/tv.json` (missing → merge-with-fix: add it). The TV tables in README and
+ examples/README, the brand line and the counts are generated from those files: a list PR never needs README rows,
+ and rows an older PR added are dropped on merge (`tools/gen_tables.py --adopt` turns them into its `tv.json`).
+- After merging lists, the maintainer runs `python3 tools/gen_tables.py` on main and commits what it rewrites
+ (with `--font Fredoka.ttf` it also redraws the card when a count changed); CI on main fails until then.
- `pm hide`/`pm block` needs the matching unhide/unblock undo in the header.
## Scope and taste
@@ -77,7 +81,7 @@ it, and every one of them gets a home. Pick the smallest home that fits (CONTRIB
small fixes for that same device can be one PR. A list bundled inside a launcher feature PR goes as its own PR.
- A PR that conflicts with main gets a kind rebase request (**rework**) naming the conflicting files, whatever
else is true of it (approved 22 Oct). A conflict only in README.md, examples/README.md or SHOWCASE.md is not
- one: those tables are union-merged on merge, so no rebase is needed.
+ one: the TV tables are regenerated on merge and SHOWCASE.md is union-merged, so no rebase is needed.
- Duplicates: when an earlier open PR, or a PR merged in the last week, fixes the same issue in the same files
(or adds mostly the same lines), the later PR is the duplicate: **close** it and name the other one (#873 after
#842, #947 after #924). A stacked series (one PR built on another) is not a duplicate.
@@ -86,7 +90,7 @@ it, and every one of them gets a home. Pick the smallest home that fits (CONTRIB
prebuilt binary. An add-on that duplicates an existing one (same source, same card) folds into it (#972).
- Files nothing links to (screenshots, stray root files, unrelated build changes) are dropped on merge.
- Press and coverage rows need a source that could be opened and checked; leave out what can't be verified.
-- Docs and README must stay in step: a new list needs its row in README and examples/README.
+- Docs and README must stay in step: a new list needs its `tv.json` (the README rows come from it).
## Comment style
Short, human, thankful: name one specific thing that is good about the PR. Name what changes on merge. Rework
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 644389db8..1a8a29cd9 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -5,7 +5,7 @@
### If this adds or changes a TV list
- [ ] `examples/<brand>-<model>/debloat.txt`, header with model, Android version and firmware build
- [ ] Only packages I actually disabled and lived with; anything I had to re-enable is noted
-- [ ] A row in `examples/README.md` and one in the README's TV table
+- [ ] `examples/<brand>-<model>/tv.json` with the TV, OS, brand and notes; nothing changed outside my folder (the README tables are generated from it)
- [ ] Nothing in the list uninstalls
### If this touches the launcher
diff --git a/AGENTS.md b/AGENTS.md
index ce217da2f..8d03d7177 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -62,12 +62,12 @@ share their TV's list afterwards, follow [`docs/workflows/tv-list.md`](docs/work
| Path | What it is |
|---|---|
| `PROMPT.md` | The prompt people paste into their agent. Brand-neutral; safety rules live here. |
-| `README.md` | Front page, with the TV table and the Tools table. `README.zh-CN.md` and `README.vi.md` are translations. |
+| `README.md` | Front page, with the TV table (generated from `examples/*/tv.json` by `tools/gen_tables.py`) and the Tools table. `README.zh-CN.md` and `README.vi.md` are translations. |
| `CONTRIBUTING.md` | The contributor guide for people. "Where does my idea go?" is the routing table. |
| `SECURITY.md` | Private vulnerability reporting. |
| `SHOWCASE.md` | Projects built on this repo that live in their own repositories. |
| `CODE_OF_CONDUCT.md` | Includes the rule against publishing device identifiers, Wi-Fi names and IPs. |
-| `examples/` | One folder per tested TV model: `debloat.txt`, sometimes a `README.md` and a `config.json`. Indexed in `examples/README.md`. |
+| `examples/` | One folder per tested TV model: `debloat.txt`, `tv.json` (its row in the TV tables), sometimes a `README.md` and a `config.json`. Indexed in `examples/README.md`, whose table is generated too. |
| `docs/` | `docs/TROUBLESHOOTING.md`, the module-card contract (`docs/modules.md`), `docs/devices/` for models with notes but no tested list, and the [workflows](#workflows). |
| `launcher/` | The reference launcher, package `com.gathin.tvhome`: plain Java, AndroidX RecyclerView and DynamicAnimation, `minSdk` 26, no `INTERNET` permission. |
| `themes/` | One folder per theme: `config.json`, a required `screenshot.jpg`, optional wallpapers. Keys are documented in `themes/README.md`. |
@@ -100,7 +100,7 @@ install scripts) are usually held for a run on a real TV.
Step-by-step methods in `docs/workflows/`. Read the one that fits before you start; each opens with when to
use it and ends with the check to run.
-- [`tv-list.md`](docs/workflows/tv-list.md): add a tested TV's debloat list with its README rows, or update one.
+- [`tv-list.md`](docs/workflows/tv-list.md): add a tested TV's debloat list with its `tv.json`, or update one.
- [`launcher-switch.md`](docs/workflows/launcher-switch.md): add an off-by-default launcher switch, within the size gate.
- [`translation.md`](docs/workflows/translation.md): add a launcher language, or fill strings missing from one.
- [`theme.md`](docs/workflows/theme.md): add a theme from existing keys, with its screenshot from a real TV.
@@ -115,10 +115,10 @@ use it and ends with the check to run.
| Check | Command or rule |
|---|---|
-| Tests, as CI runs them | `python3 -m unittest discover -s tests -v` after `python3 -m venv tools/venv` and `tools/venv/bin/pip install -r tools/requirements.txt`. On `main`, CI sets `CLEANYOURTV_STRICT=1`, which also checks the README's TV-model count. |
+| Tests, as CI runs them | `python3 -m unittest discover -s tests -v` after `python3 -m venv tools/venv` and `tools/venv/bin/pip install -r tools/requirements.txt`. On `main`, CI sets `CLEANYOURTV_STRICT=1`, which also checks that the TV tables and counts are what `tools/gen_tables.py` writes. |
| Launcher, if you touched `launcher/` | JDK 17, Android SDK platform 34, build-tools 34.0.0. In `launcher/`: `./gradlew --no-daemon testReleaseUnitTest lintRelease assembleRelease`. Lint must stay at zero errors. |
| APK size gate | `launcher/app/build/outputs/apk/release/app-release.apk` must be under 524,288 B (512 KB). Linux: `stat -c %s`, macOS: `stat -f %z`. |
-| README rows | A new list has its row in `README.md` and `examples/README.md`; a theme in `themes/README.md`; an add-on in `addons/README.md`. |
+| README rows | A new list adds only its folder, with a `tv.json`: the TV tables, the brand line and the counts are generated after merging, so leave them alone. A theme has its row in `themes/README.md`; an add-on in `addons/README.md`. |
| One topic per PR | A TV list never rides inside a launcher feature PR. A device's list plus small fixes for that same device can be one PR. |
| Tested on | Say which TV, Android version and firmware you tested on, in the PR template's "Tested on" line. |
| Real TV | Launcher changes are verified on a real TV, not only the emulator: `tools/tv.py --screenshot shots/after.png DPAD_DOWN`. D-pad from every edge (Up, Down, Left, Right). A button handled by an accessibility helper needs a press on the real remote, and a force-stop of the launcher switches the helpers off (`docs/TROUBLESHOOTING.md`). |
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 690450b95..3afb4a125 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -31,8 +31,12 @@ Every brand ships different bloat. If you ran the prompt (or did it by hand) on
whether it matches theirs. `tools/tv.py --probe` prints all three.
3. Only list packages you have actually disabled and lived with for a few days. Note anything that
broke and what you re-enabled.
-4. Add a row to `examples/README.md` and one to the TV table in `README.md`: the tests compare them,
- so a list with a row in only one of the two fails.
+4. Add `examples/<brand>-<model>/tv.json`, the row the TV tables show for your list. Copy
+ `examples/xiaomi-mi-tv-4a/tv.json`: `tv` (the model as the tables name it), `os`, `brand` (spelled as
+ on the README's brand line; a new brand is fine) and `notes` (one line: what the list disables and
+ keeps). Change nothing outside your folder: the TV tables in `README.md` and `examples/README.md`, the
+ brand line and the counts are generated from every folder's `tv.json` after merging, so a PR that
+ edits them only collides with the other open lists.
5. If your TV's Live TV app or stock launcher has a different package name, say so in the header. Where
a script needs the stock launcher, `tools/restore.sh` takes it as its second argument
(`tools/restore.sh <list> <package>`) and `launcher/build-and-install.sh` takes it in the
diff --git a/docs/workflows/docs-notes.md b/docs/workflows/docs-notes.md
index 58b0de9d7..615588026 100644
--- a/docs/workflows/docs-notes.md
+++ b/docs/workflows/docs-notes.md
@@ -10,6 +10,7 @@
themselves go to the maintainer.
- Several tests pin facts in `docs/devices/` notes, `PROMPT.md` and `docs/TROUBLESHOOTING.md` (the
`tests/test_*_note.py` files). If you reword one of those passages, run the suite and keep the fact.
-- Docs and the README stay in step: a new list, theme, add-on or tool gets its row where the others are.
+- Docs and the README stay in step: a new list gets its `tv.json` (the TV tables are generated from it), and a
+ theme, add-on or tool its row where the others are.
Then run the tests: `python3 -m unittest discover -s tests -v`.
diff --git a/docs/workflows/tv-list.md b/docs/workflows/tv-list.md
index e26272f7d..212295f85 100644
--- a/docs/workflows/tv-list.md
+++ b/docs/workflows/tv-list.md
@@ -13,11 +13,21 @@
non-obvious. No duplicates, nothing but package names outside comments.
3. List only packages you actually disabled and lived with for a few days. Note anything you re-enabled.
Mark untested entries as comments.
-4. Add one row to the table in `examples/README.md` (`` | `<folder>/` | TV | OS | Notes | ``) and one to the
- TV table in `README.md` (`| TV | OS |`). The TV cell must be the same text in both; `tests/test_examples.py`
- compares them.
-5. Leave the counts alone (the `TV models` number in the card's alt text, the brand line): CI checks them only
- on `main`, and they are fixed up on merge.
+4. Add `examples/<folder>/tv.json` beside the list, like `examples/xiaomi-mi-tv-4a/tv.json`:
+ ```json
+ {
+ "tv": "Xiaomi Mi TV 4A (MiTV-MOOQ1)",
+ "os": "Android TV 10",
+ "brand": "Xiaomi",
+ "notes": "PatchWall, Mi analytics, SmartShare, MiLink"
+ }
+ ```
+ `tv` and `os` fill the folder's row in both TV tables, `brand` the brand line (spelled as it is there),
+ `notes` the Notes cell in `examples/README.md`: one line of Markdown, links relative to `examples/`, `\|`
+ for a pipe. `tests/test_examples.py` checks the file.
+5. Change nothing outside the folder. The tables in `README.md` and `examples/README.md`, the brand line and the
+ counts (the `TV models` number in the card's alt text) are generated from every `tv.json` by
+ `tools/gen_tables.py`, which a maintainer runs after merging; CI compares them only on `main`.
6. A `README.md` for TV-specific notes and a `config.json` with the dock are welcome in the folder. Do not add
install or restore scripts, Private DNS or AdGuard setup, or `pm uninstall` steps: the folder only
disables, and `tools/disable.sh` and `tools/restore.sh` do the rest.
@@ -30,6 +40,7 @@ list at the end of `examples/README.md`. A folder in `examples/` must have packa
Keep the header accurate: add the second unit's model, firmware and region rather than replacing the first.
Explain each added or re-enabled package in a comment. A list that disables the firmware updater says why in the
header; keeping it enabled is preferred. `pm hide` or `pm block` needs the matching undo in the header. Edits to
-someone else's list are judgement calls, so say in the PR which TV you tested on and for how long.
+someone else's list are judgement calls, so say in the PR which TV you tested on and for how long. If the row
+should say something new, change the folder's `tv.json`, not the tables.
Then run the tests: `python3 -m unittest discover -s tests -v`.