Skip to content

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

addons/: a home for optional module-card apps, kept out of the launcher build

Gathin23315418e8d35c
diff --git a/.github/workflows/addons.yml b/.github/workflows/addons.yml
new file mode 100644
index 000000000..25ebc748c
--- /dev/null
+++ b/.github/workflows/addons.yml
@@ -0,0 +1,42 @@
+name: Add-ons
+
+# Builds only what changed under addons/. Separate from CI on purpose: an add-on can't block or
+# slow the launcher's build, and the launcher's size gate never sees add-on code.
+on:
+ pull_request:
+ paths: ["addons/**"]
+ push:
+ branches: [main]
+ paths: ["addons/**"]
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+ name: Build changed add-ons
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - uses: actions/setup-java@v4
+ with:
+ distribution: temurin
+ java-version: "17"
+ - uses: android-actions/setup-android@v3
+ with:
+ packages: platforms;android-34 build-tools;34.0.0
+ - name: Build each add-on that changed
+ env:
+ BASE: ${{ github.event.pull_request.base.sha || github.event.before }}
+ run: |
+ changed=$(git diff --name-only "$BASE" HEAD -- addons | awk -F/ 'NF>2 {print $2}' | sort -u)
+ [ -z "$changed" ] && { echo "no add-on changed"; exit 0; }
+ for a in $changed; do
+ [ -d "addons/$a" ] || continue
+ [ -f "addons/$a/gradlew" ] || { echo "addons/$a has no gradlew"; exit 1; }
+ echo "::group::addons/$a"
+ (cd "addons/$a" && chmod +x gradlew && ./gradlew --no-daemon assembleRelease)
+ echo "::endgroup::"
+ done
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7a048cf77..8df15ea42 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -94,7 +94,8 @@ different look, and tools around the launcher; this repo keeps one small referen
points at everything else. The rules for a row are on that page.
Things that stay in this repo: debloat lists, fixes and small, opt-in features for the reference
-launcher, prompt and tool improvements. Things that go in the showcase: a second launcher, a
+launcher, prompt and tool improvements. A feature that can be its own small app goes in [`addons/`](addons/README.md)
+as a module card. Things that go in the showcase: a second launcher, a
restyle, a platform port, anything with its own background services or network access.
## Pull requests
diff --git a/README.md b/README.md
index 4b4dab7f2..b387abd96 100644
--- a/README.md
+++ b/README.md
@@ -426,6 +426,7 @@ The **TV** needs Android 8.0 (API 26) or newer: `minSdk` is a compile-time floor
| **24 languages** | Follows the TV's language, with a fully mirrored right-to-left layout for Hebrew |
| **App library** | Optional: browse every installed app and add or remove Home shortcuts. See [the app library guide](docs/app-library.md) |
| **Module cards** | Any TV app can offer its own tile; you approve each one once. See [`docs/modules.md`](docs/modules.md) |
+| **Add-ons** | Optional apps that plug in as module cards, kept in [`addons/`](addons/) and never built into the launcher |
| **Clock screensaver** | A drifting clock over the glow, so nothing burns in |
| **Remote keys** | Keeps the Input, YouTube and gear buttons working after the stock launcher is gone |
diff --git a/SHOWCASE.md b/SHOWCASE.md
index c673c2d26..ae7bbcfb4 100644
--- a/SHOWCASE.md
+++ b/SHOWCASE.md
@@ -8,7 +8,7 @@ Nothing here is reviewed or maintained by this repo. Read the project's own READ
it was built on, and treat it the way you'd treat any app you sideload. Each row links to the
project's own issue tracker.
-**Jump to:** [Home screens built as their own app](#home-screens-built-as-their-own-app) · [Forks of the launcher](#forks-of-the-launcher) · [Screensavers and add-ons](#screensavers-and-add-ons) · [Tools and companion apps](#tools-and-companion-apps) · [Other platforms: Fire TV and LG webOS](#other-platforms-fire-tv-and-lg-webos) · [Guides and write-ups](#guides-and-write-ups) · [Find a project by TV brand](#find-a-project-by-tv-brand) · [Add yours](#add-yours)
+**Jump to:** [Home screens built as their own app](#home-screens-built-as-their-own-app) · [Forks of the launcher](#forks-of-the-launcher) · [Screensavers and add-ons](#screensavers-and-add-ons) · [Tools and companion apps](#tools-and-companion-apps) · [Other platforms: Fire TV and LG webOS](#other-platforms-fire-tv-and-lg-webos) · [Add-ons in this repo](addons/README.md) · [Guides and write-ups](#guides-and-write-ups) · [Find a project by TV brand](#find-a-project-by-tv-brand) · [Add yours](#add-yours)
44 projects so far.
@@ -91,6 +91,10 @@ Fire OS won't let another launcher replace Amazon's home, and LG TVs run webOS r
| [fire-tv-cleanup](https://github.com/itsmeterrylin/fire-tv-cleanup) | A fork aimed at Fire TV: debloat plus a launcher with a macOS-style dock | Fire TV | [itsmeterrylin](https://github.com/itsmeterrylin) |
| [webOS launcher](https://github.com/OmkarK97/webos-vibehack) | The same Apple TV-style home rebuilt as a webOS web app for LG TVs, installed through LG's Developer Mode, with a Home-button watcher that runs on another device | LG OLED C6, webOS 26 | [OmkarK97](https://github.com/OmkarK97) |
+## Add-ons in this repo
+
+Small optional apps that plug into the launcher as module cards live in [`addons/`](addons/README.md), with their own index. They are built separately and never make the launcher bigger.
+
## Guides and write-ups
Walkthroughs other people wrote or recorded. Press coverage is listed in [docs/PRESS.md](docs/PRESS.md).
diff --git a/addons/README.md b/addons/README.md
new file mode 100644
index 000000000..49aca7ff5
--- /dev/null
+++ b/addons/README.md
@@ -0,0 +1,53 @@
+# Add-ons
+
+Small, optional Android TV apps that plug into the launcher as a **module card**, kept in this repo
+so they are easy to find, build and review. The launcher in [`launcher/`](../launcher/) never
+depends on them: it is built, tested and size-checked without this folder, so an add-on can't make
+the core bigger or change how it behaves. You install an add-on only if you want it.
+
+## Add-ons
+
+| Add-on | What it does | Author | Tested on | Permissions |
+|---|---|---|---|---|
+
+None yet. A widget, an info tile, a storage or smart-home card: if it can live as its own small app,
+it can live here. See the rules below.
+
+## How an add-on works
+
+An add-on is a normal Android TV app with its own Gradle project in `addons/<name>/`. It declares a
+card with the existing module-card contract: the how-to is [`docs/modules.md`](../docs/modules.md)
+and the spec is [`docs/specs/card.md`](../docs/specs/card.md). The launcher finds the card, asks the
+TV owner once, and shows it as a tile with the add-on's label, caption and glow colour. Nothing else
+connects the two.
+
+Build one (JDK 17, Android SDK 34, as for the launcher):
+
+```bash
+cd addons/<name> && ./gradlew assembleRelease
+TV_HOST=<tv ip> tools/venv/bin/python -I tools/tv.py --push addons/<name>/app/build/outputs/apk/release/app-release.apk /data/local/tmp/addon.apk
+TV_HOST=<tv ip> tools/venv/bin/python -I tools/tv.py 'pm install -r /data/local/tmp/addon.apk; rm -f /data/local/tmp/addon.apk'
+```
+
+## Rules
+
+- **Its own app.** One folder per add-on, `addons/<name>/`, with its own Gradle project
+ (`settings.gradle`, `app/`), its own package name and its own README.
+- **Only through the module-card spec.** An add-on never edits anything under `launcher/`, and
+ `launcher/` never references `addons/`. If your idea needs a change inside the launcher, it isn't
+ an add-on. Open an issue first instead.
+- **No prebuilt APKs** in the repo. People build from source, as with the launcher.
+- **Permissions up front.** The add-on's README lists every permission it asks for and why, plus
+ any network access or background service. The rules in [`docs/modules.md`](../docs/modules.md)
+ apply: no telemetry without an opt-in, no ads, your own art.
+- **Tested on a real TV.** Say which one in the README and in the table above.
+- **The author maintains it.** Issues about an add-on are assigned to its author. An add-on that
+ breaks on current Android TV versions, or goes unmaintained, may be removed. Its history stays in
+ git, and you can keep it going in a fork listed in [`SHOWCASE.md`](../SHOWCASE.md).
+
+## Adding one
+
+Open a pull request that adds `addons/<name>/` and one row to the table above. The core CI is not
+blocked by add-ons: a separate workflow builds whatever changed under `addons/`, and
+`tests/test_addons.py` checks the folder rules (own Gradle project, a README with a Permissions
+section, no APKs, a row in this table) and that the launcher never includes or references this folder.
diff --git a/tests/test_addons.py b/tests/test_addons.py
new file mode 100644
index 000000000..151bf3eb4
--- /dev/null
+++ b/tests/test_addons.py
@@ -0,0 +1,54 @@
+"""addons/ stays separate from the launcher: the core build never includes it, launcher/ never refers to it,
+and every add-on folder follows the rules in addons/README.md."""
+import re
+import unittest
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parent.parent
+ADDONS = ROOT / "addons"
+LAUNCHER = ROOT / "launcher"
+TEXT = {".gradle", ".kts", ".java", ".kt", ".xml", ".properties", ".sh", ".ps1", ".pro", ".md"}
+
+
+def addon_dirs():
+ return sorted(p for p in ADDONS.iterdir() if p.is_dir()) if ADDONS.is_dir() else []
+
+
+class AddonIsolationTest(unittest.TestCase):
+ def test_core_build_does_not_include_addons(self):
+ for name in ("settings.gradle", "settings.gradle.kts"):
+ settings = LAUNCHER / name
+ if settings.is_file():
+ text = settings.read_text(encoding="utf-8")
+ self.assertNotIn("addons", text, f"launcher/{name} must not include add-ons")
+ self.assertEqual(re.findall(r"include\s*\(?\s*['\"]([^'\"]+)", text), [":app"],
+ "the core build is the launcher app alone")
+
+ def test_launcher_never_references_addons(self):
+ for path in LAUNCHER.rglob("*"):
+ if not path.is_file() or path.suffix not in TEXT or "build" in path.relative_to(LAUNCHER).parts:
+ continue
+ text = path.read_text(encoding="utf-8", errors="ignore")
+ self.assertNotRegex(text, r"(\.\./)+addons/|\baddons/", f"{path.relative_to(ROOT)} refers to addons/")
+
+ def test_no_prebuilt_apks(self):
+ apks = [str(p.relative_to(ROOT)) for p in ADDONS.rglob("*.apk")] if ADDONS.is_dir() else []
+ self.assertEqual(apks, [], "no prebuilt APKs in addons/")
+
+
+class AddonFolderTest(unittest.TestCase):
+ def test_every_addon_follows_the_rules(self):
+ index = (ADDONS / "README.md").read_text(encoding="utf-8") if ADDONS.is_dir() else ""
+ for folder in addon_dirs():
+ with self.subTest(addon=folder.name):
+ self.assertTrue(any((folder / n).is_file() for n in ("settings.gradle", "settings.gradle.kts")),
+ "an add-on is its own Gradle project")
+ readme = folder / "README.md"
+ self.assertTrue(readme.is_file(), "an add-on needs its own README")
+ self.assertRegex(readme.read_text(encoding="utf-8"), r"(?im)^#+\s*permissions",
+ "the README lists its permissions under a Permissions heading")
+ self.assertIn(f"]({folder.name}/)", index, "addons/README.md needs a row linking this add-on")
+
+
+if __name__ == "__main__":
+ unittest.main()