Skip to content

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

SHOWCASE: two rows the brand index never linked, and the generic line in the recipe

xbsheng4dcb4296edc5
diff --git a/SHOWCASE.md b/SHOWCASE.md
index ed34da4cd..5924e26be 100644
--- a/SHOWCASE.md
+++ b/SHOWCASE.md
@@ -180,9 +180,9 @@ By the TV each project was built and tested on. Most of them run on other Androi
- **Sony:** [Ambient Theme](https://github.com/audiedv/cleanyourtv/tree/ambient-theme), [LiquiTvOs](https://github.com/purnavikas/cleanyourtv/tree/liquitvos), [Cosy TV](https://github.com/samipuro/tv-launcher), [Premium Minimal Home](https://github.com/Lzchyi/cleanyourtv/tree/v2.6.0-redesign), [Sony BRAVIA cinematic Home](https://github.com/Mahadevaswamys1999/cleanyourtv/tree/sony-bravia-vh21), [Photos, weather and a Telegram bot on a Sony BRAVIA](https://github.com/shivamsingh262/cleanyourtv/tree/sony-x82l-sky-photos), [Sony BRAVIA Launcher](https://github.com/udeshvirk/sony-bravia-launcher), [Sony China launcher](https://github.com/roninriddle/tv-vibehack/tree/sony), [TV Remote](https://github.com/HoangTran0410/tv-remote), [TV Remote + Timer Lock](https://github.com/ptrinh/tvhome-remote), [tv-bookshelf](https://github.com/griffincockfoster56/tv-bookshelf), [Vibe Launcher](https://github.com/maydings/vibe-launcher), [WidgeTV](https://github.com/ashfaqhaq/widgetv)
- **TCL:** [Afnon · أفنون](https://github.com/egyjs/afnon-android-tv-launcher), [Clean TV for TCL G10](https://github.com/itsmevizz/cleanyourtv/tree/clean-tv-launcher), [Clean Your TV Companion](https://github.com/gethari/clean-your-tv-companion), [CleanMyTCL-Android9](https://github.com/eddysangalli/CleanMyTCL-Android9), [CleanYourTV UI](https://github.com/matheus-caldeira/cleanyourtv-ui), [CleanYourTV, TCL Edition](https://github.com/Kaikhalid/cleanyourtv), [DVD Video screensaver for Android TV](https://github.com/TheWombRaider/dvd-tv), [freeTV](https://github.com/kienmai160598/freeTV), [Live background and theme sounds](https://github.com/csermet/cleanyourtv/tree/repo-helper), [3D Pipes: XP Screensaver for Android TV](https://github.com/TheWombRaider/pipes-tv), [Minimal Home with Now on TV and a 5-day forecast](https://github.com/elioar/cleanyourtv/tree/minimal-home), [Local-video Home and Netflix pointer](https://github.com/iloveOREO/cleanyourtv/tree/tv/local-video-wallpaper-and-pointer), [Quick panel and Free memory on a TCL G09](https://github.com/cristianrojas07/cleanyourtv/tree/showcase), [Scenes, frosted glass and weather](https://github.com/manas-04/cleanyourtv/tree/feat/wallpapers-weather), [TCL G03: Search, Live, Memory and Shows](https://github.com/gpokhark/cleanyourtv/tree/dev), [TidyTV](https://github.com/jolan94/tidytv), [Weather card and screensaver button](https://github.com/johnny1K/cleanyourtv/tree/weather-card)
- **XGIMI:** [Tellyscope](https://github.com/man15h/tellyscope)
-- **Xiaomi:** [AirPlay receiver installer](https://github.com/nguyenduchoai/tv-vibehack/tree/feat/airplay-receiver), [Aurora screensaver and wallpaper](https://github.com/rakshajag13/tv-vibehack/tree/xiaomi-mitv-axso0-debloat-wallpaper), [Bluetooth pill](https://github.com/nikhiltalreja/cleanyourtv/tree/bluetooth-pill-key-remaps), [CleanTV](https://github.com/0x006E/cleantv), [CleanXiaomiTV](https://github.com/majnioui/CleanXiaomiTV), [CleanYourTV Panel](https://github.com/Pagamase/cleanyourtv-panel), [CleanYourTV: Frutiger Aero](https://github.com/SadmanYasar/cleanyourtv/tree/frutiger-aero-edition), [Control Center](https://github.com/samdegan2311/tv-vibehack/tree/pr/control-center), [ExtremeSlimTV](https://github.com/yositapjani/ExtremeSlimTV), [freeTV](https://github.com/kienmai160598/freeTV), [glassOS-tv](https://github.com/jmarknavarro/glassOS-tv), [Google TV style home](https://github.com/SferaDev/android-tv/tree/dev), [Nothing-style TV launcher](https://github.com/yashraut362/nothing-tv-launcher-CleanYourTV), [Offline ZIP theme library](https://github.com/DipsySu/cleanyourtv/tree/dipsy/personal-theme-showcase), [Readable Home](https://github.com/itismowgli/cleanyourtv/tree/readable-home), [Redmi Glass Launcher](https://github.com/harshsingh0930/tv-vibehack), [Rotating wallpapers and a Wallpaper picker](https://github.com/Alafazam/cleanyourtv/tree/axso2-launcher), [stillOS](https://github.com/maximfakel/stillOS), [Xmen Android 6 port](https://github.com/yukunwu/cleanyourtv/tree/xmen-android6/ports/xmen-android6)
+- **Xiaomi:** [AirPlay receiver installer](https://github.com/nguyenduchoai/tv-vibehack/tree/feat/airplay-receiver), [Android 6 launcher for the MiTV 4S 75](https://github.com/qqwersde/my-tv-signal-android6), [Aurora screensaver and wallpaper](https://github.com/rakshajag13/tv-vibehack/tree/xiaomi-mitv-axso0-debloat-wallpaper), [Bluetooth pill](https://github.com/nikhiltalreja/cleanyourtv/tree/bluetooth-pill-key-remaps), [CleanTV](https://github.com/0x006E/cleantv), [CleanXiaomiTV](https://github.com/majnioui/CleanXiaomiTV), [CleanYourTV Panel](https://github.com/Pagamase/cleanyourtv-panel), [CleanYourTV: Frutiger Aero](https://github.com/SadmanYasar/cleanyourtv/tree/frutiger-aero-edition), [Control Center](https://github.com/samdegan2311/tv-vibehack/tree/pr/control-center), [ExtremeSlimTV](https://github.com/yositapjani/ExtremeSlimTV), [freeTV](https://github.com/kienmai160598/freeTV), [glassOS-tv](https://github.com/jmarknavarro/glassOS-tv), [Google TV style home](https://github.com/SferaDev/android-tv/tree/dev), [Nothing-style TV launcher](https://github.com/yashraut362/nothing-tv-launcher-CleanYourTV), [Offline ZIP theme library](https://github.com/DipsySu/cleanyourtv/tree/dipsy/personal-theme-showcase), [Readable Home](https://github.com/itismowgli/cleanyourtv/tree/readable-home), [Redmi Glass Launcher](https://github.com/harshsingh0930/tv-vibehack), [Rotating wallpapers and a Wallpaper picker](https://github.com/Alafazam/cleanyourtv/tree/axso2-launcher), [stillOS](https://github.com/maximfakel/stillOS), [Xmen Android 6 port](https://github.com/yukunwu/cleanyourtv/tree/xmen-android6/ports/xmen-android6)
-- **Any Android TV (emulator or generic):** [Clean Your TV Companion](https://github.com/gethari/clean-your-tv-companion), [CleanTV by VGS](https://github.com/vgscity/vgs-cleantv), [CleanYourTV Studio](https://github.com/dazdenii/cleanyourtv-studio), [Dynamic wallpapers](https://github.com/BlockException/cleanyourtv/tree/feature/dynamic-wallpaper-797), [SamuraiOS (Cyberpunk TV Launcher)](https://github.com/0x3XPL017/cleanyourtv-cyberpunk-launcher), [Stremio shelf, peek dock and calendar](https://github.com/benfirad/tv-vibehack), [TV Remote](https://github.com/HoangTran0410/tv-remote), [Zen list](https://github.com/lengjingxu/cleanyourtv/tree/zen-list)
+- **Any Android TV (emulator or generic):** [Clean Your TV app](https://github.com/udhaykumarbala/cleanyourtv-app), [Clean Your TV Companion](https://github.com/gethari/clean-your-tv-companion), [CleanTV by VGS](https://github.com/vgscity/vgs-cleantv), [CleanYourTV Studio](https://github.com/dazdenii/cleanyourtv-studio), [Dynamic wallpapers](https://github.com/BlockException/cleanyourtv/tree/feature/dynamic-wallpaper-797), [SamuraiOS (Cyberpunk TV Launcher)](https://github.com/0x3XPL017/cleanyourtv-cyberpunk-launcher), [Stremio shelf, peek dock and calendar](https://github.com/benfirad/tv-vibehack), [TV Remote](https://github.com/HoangTran0410/tv-remote), [Zen list](https://github.com/lengjingxu/cleanyourtv/tree/zen-list)
## Add yours
diff --git a/docs/workflows/showcase.md b/docs/workflows/showcase.md
index 969a5baf4..3d4776a01 100644
--- a/docs/workflows/showcase.md
+++ b/docs/workflows/showcase.md
@@ -3,7 +3,8 @@
**When to use this:** a project built on this repo that lives in its own repository.
1. Add one row to the section of `SHOWCASE.md` that fits (home screens, forks, screensavers and add-ons,
- tools, other platforms), and the project under its TV brand in "Find a project by TV brand".
+ tools, other platforms), and the project under its TV brand in "Find a project by TV brand" - or under
+ "Any Android TV (emulator or generic)" when it names no single brand, as the phone apps do.
2. Bump the two counts by one: `SHOWCASE.md` opens with an `N projects so far.` line, and the "Built
something on top?" row in `README.md` spells the same number in words. `tests/test_showcase_project_count.py`
refuses a row that leaves either of them behind.
diff --git a/tests/test_showcase_brand_index.py b/tests/test_showcase_brand_index.py
index 119c3cd9e..c4268cbf4 100644
--- a/tests/test_showcase_brand_index.py
+++ b/tests/test_showcase_brand_index.py
@@ -1,17 +1,29 @@
-"""SHOWCASE.md's brand index has one line per brand, and the Bluetooth pill fork's row went in twice.
+"""SHOWCASE.md's brand index has one line per brand, and every row has to be reachable from it.
"Find a project by TV brand" is the index a reader uses to answer "which of these runs on my set", and
-docs/workflows/showcase.md asks for a new row to be added under its TV brand. When the Bluetooth pill
-fork landed (row 47, nikhiltalreja's tree) a second `- **Xiaomi:**` line was written below XGIMI
-instead of the fork being added to the Xiaomi line already there, so the page carried Xiaomi twice:
-the first line listed 14 projects without the fork, the second listed all 15. A reader who stopped at
-the first Xiaomi line never saw the fork, and the page looked like it had two Xiaomi sections.
+docs/workflows/showcase.md asks for a new row to be added under its TV brand. Two things went wrong
+there, both caught by the tests below.
-These tests read the index into brand -> links. A brand named twice fails, and the failure prints the
-links only one of the two lines carries, so the fix is to fold them into one line. The brand labels
-are not compared in any order: the list is grouped by hand and is not alphabetical today.
+A brand named twice: when the Bluetooth pill fork landed (row 47, nikhiltalreja's tree) a second
+`- **Xiaomi:**` line was written below XGIMI instead of the fork being added to the Xiaomi line already
+there, so the page carried Xiaomi twice - the first line listed 14 projects without the fork, the
+second all 15, and a reader who stopped at the first Xiaomi line never saw the fork.
-No prose is matched, so rewording a line or renaming a project stays free.
+A row the index never links: the MiTV4-ANSM0 launcher (qqwersde's tree, the same board as the Xmen
+Android 6 port that *is* on the Xiaomi line) and the phone app "Clean Your TV app" (built for Android TV
+sets generally, so no single brand) were both written into the tables and never into the index - which is
+what happens when the recipe says only "under its TV brand" and the project has none. Both are in the
+index now, and step 1 of the recipe names the generic line for a project like that.
+
+These tests read the index into brand -> links and the tables into rows. A brand named twice fails and
+prints the links only one of the two lines carries; a row no index line links fails with its line
+number. Rows whose TV cell names no brand at all (NO_BRAND below) are exempt, and a test keeps each
+exemption honest: one that is no longer on the page fails instead of hiding a row forever. The brand
+labels are not compared in any order: the list is grouped by hand and is not alphabetical today.
+
+A row is matched to an index link by its address, not its label, so renaming a project on one side stays
+free; a trailing page name (`.../tree/x/FORK.md`) is ignored, so the two can address the same tree
+differently.
Run from the repository root: python3 -m unittest discover -s tests -v
"""
@@ -22,12 +34,26 @@ from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
PAGE = ROOT / "SHOWCASE.md"
+RECIPE = ROOT / "docs" / "workflows" / "showcase.md"
SECTION = "## Find a project by TV brand"
END = "## Add yours"
# `- **Xiaomi:** [One](url), [Two](url)`: the bullet docs/workflows/showcase.md asks a row to be added to.
ENTRY = re.compile(r"^- \*\*([^*]+?):\*\*(.*)$")
LINK = re.compile(r"\[([^\]]+)\]\((https?://[^)\s]+)\)")
+# `| [Name](url) | what it is | the TV | the author |`: a table row whose first cell links the project.
+ROW = re.compile(r"^\|\s*\[[^\]]*\]\((https?://[^)\s]+)\)")
+# The page name some rows end their address with: .../tree/tv/local-video-wallpaper-and-pointer/FORK.md
+PAGE_NAME = re.compile(r"/[^/]*\.md$")
+
+# Rows whose TV cell names no brand a reader could look themselves up under, with the reason. Keeping
+# them here rather than on the page means every other unlinked row still fails the test below.
+NO_BRAND = {
+ "https://github.com/lionlev21/cleanyourtv/blob/tv-button-picker/REMOTE_PICKER.md":
+ "its TV cell says 'device details private'",
+ "https://github.com/iyts/cleanyourtv/tree/feat/picture-sound-panel":
+ "its TV cell names a board ('Realtek-based set'), not a brand",
+}
def index(lines):
@@ -55,17 +81,79 @@ def duplicates(entries):
return {brand: group for brand, group in seen.items() if len(group) > 1}
+def canonical(url):
+ """A project's address with the page name and the blob/tree spelling taken out.
+
+ `.../tree/x/FORK.md` and `.../blob/x/FORK.md` are the same tree, and the index and a row are free to
+ address it either way.
+ """
+ url = PAGE_NAME.sub("", url.rstrip("/"))
+ return url.replace("/blob/", "/tree/")
+
+
+def same_project(one, two):
+ """Equal once a trailing page name is dropped, or one address inside the other's tree."""
+ one, two = canonical(one), canonical(two)
+ return one == two or two.startswith(one + "/") or one.startswith(two + "/")
+
+
+def rows(lines):
+ """[(line number, url)] for every table row whose first cell links a project."""
+ found = []
+ for number, line in enumerate(lines, 1):
+ match = ROW.match(line)
+ if match:
+ found.append((number, match.group(1)))
+ return found
+
+
+def unindexed(lines):
+ """[(line number, url)] for the rows no line of the brand index links."""
+ listed = [url for _, _, links in index(lines) for _, url in links]
+ return [(number, url) for number, url in rows(lines) if not any(same_project(url, one) for one in listed)]
+
+
+def generic_label(lines):
+ """The index line for projects with no brand of their own: the one labelled 'Any ...'."""
+ for _, brand, _ in index(lines):
+ if brand.startswith("Any "):
+ return brand
+ return None
+
+
+def steps(page):
+ """The numbered steps of a recipe page, a wrapped step joined onto its first line."""
+ found, current = [], None
+ for line in page.splitlines():
+ match = re.match(r"^(\d+)\. (.*)$", line)
+ if match:
+ if current:
+ found.append(current)
+ current = [int(match.group(1)), match.group(2)]
+ elif current is not None and line.startswith(" ") and line.strip():
+ current[1] += " " + line.strip()
+ elif current is not None and not line.strip():
+ continue
+ elif current is not None:
+ found.append(current)
+ current = None
+ if current:
+ found.append(current)
+ return found
+
+
class BrandIndex(unittest.TestCase):
def setUp(self):
self.lines = PAGE.read_text(encoding="utf-8").splitlines()
self.entries = index(self.lines)
def test_the_index_is_found(self):
- # A parser that reads nothing would make the test below pass for any page.
+ # A parser that reads nothing would make the tests below pass for any page.
self.assertGreaterEqual(
len(self.entries), 20, "the brand index should name the brands the page lists; the parser found fewer"
)
self.assertIn("Xiaomi", [brand for _, brand, _ in self.entries])
+ self.assertIsNotNone(generic_label(self.lines), "no index line for projects with no brand of their own")
def test_no_brand_is_named_twice(self):
repeated = duplicates(self.entries)
@@ -91,9 +179,55 @@ class BrandIndex(unittest.TestCase):
empty = [f"line {number}: {brand}" for number, brand, links in self.entries if not links]
self.assertEqual([], empty, "these brand lines name no project: " + "; ".join(empty))
+ def test_every_row_is_reachable_from_the_index(self):
+ found = rows(self.lines)
+ self.assertGreaterEqual(len(found), 90, "the page's project rows should be read; the parser found fewer")
+ missing = [f"line {number}: {url}" for number, url in unindexed(self.lines) if url not in NO_BRAND]
+ self.assertEqual(
+ [],
+ missing,
+ "these rows are in SHOWCASE.md's tables but no line of 'Find a project by TV brand' links them,\n"
+ "so a reader looking up their own TV misses the project: add each one to the line for the brand\n"
+ "it was built on, or to the 'Any Android TV' line when it names no single brand.\n" + "\n".join(missing),
+ )
+
+ def test_each_exempt_row_is_still_on_the_page(self):
+ found = [url for _, url in rows(self.lines)]
+ stale = [
+ f"{url} ({why})" for url, why in NO_BRAND.items() if not any(same_project(url, one) for one in found)
+ ]
+ self.assertEqual(
+ [],
+ stale,
+ "these rows are exempted from the index test above but are no longer on the page: drop the\n"
+ "exemption, or fix the address it was written with.\n" + "\n".join(stale),
+ )
+
+
+class TheRecipe(unittest.TestCase):
+ def setUp(self):
+ self.lines = PAGE.read_text(encoding="utf-8").splitlines()
+ self.page = RECIPE.read_text(encoding="utf-8")
+
+ def test_the_step_that_asks_for_the_index_names_the_generic_line(self):
+ # A project with no brand of its own (a phone app, a generic add-on) has nowhere to go on a brand
+ # line, and that is how "Clean Your TV app" was left out of the index.
+ label = generic_label(self.lines)
+ found = steps(self.page)
+ self.assertGreaterEqual(len(found), 4, "the showcase recipe's numbered steps should be read")
+ asking = [number for number, text in found if "Find a project by TV brand" in text]
+ self.assertEqual(1, len(asking), f"exactly one step should ask for the brand index entry; read {asking}")
+ step = dict(found)[asking[0]]
+ self.assertIn(
+ label,
+ step,
+ f"step {asking[0]} asks for the 'Find a project by TV brand' entry but does not name\n"
+ f"'{label}', so a project that names no single brand has no line to be added to",
+ )
+
class TheReaderItself(unittest.TestCase):
- """The repo-wide test above is only worth its failures if the reader sees these shapes."""
+ """The repo-wide tests above are only worth their failures if the reader sees these shapes."""
def test_a_brand_named_twice_is_reported(self):
lines = [
@@ -135,6 +269,47 @@ class TheReaderItself(unittest.TestCase):
def test_a_page_without_the_section_reads_as_empty(self):
self.assertEqual([], index(["# Made with cleanyourtv", "- **TCL:** [One](https://example.com/one)"]))
+ def test_a_row_the_index_never_links_is_reported(self):
+ lines = [
+ "| [One](https://example.com/one) | what it is | TCL 43P615 | an author |",
+ "",
+ SECTION,
+ "- **TCL:** [Two](https://example.com/two)",
+ END,
+ ]
+ self.assertEqual([(1, "https://example.com/one")], unindexed(lines))
+
+ def test_a_row_linked_by_another_page_of_its_own_tree_is_quiet(self):
+ # The TCL line links .../tree/tv/local-video-wallpaper-and-pointer while the row links its FORK.md.
+ lines = [
+ "| [Fork](https://example.com/fork/FORK.md) | what it is | TCL | an author |",
+ SECTION,
+ "- **TCL:** [Fork](https://example.com/fork)",
+ END,
+ ]
+ self.assertEqual([], unindexed(lines))
+
+ def test_a_link_outside_the_index_section_is_not_an_entry(self):
+ lines = [
+ "| [One](https://example.com/one) | what it is | TCL | an author |",
+ "## Home screens",
+ "- **TCL:** [One](https://example.com/one)",
+ SECTION,
+ "- **Sony:** [Two](https://example.com/two)",
+ END,
+ ]
+ self.assertEqual([(1, "https://example.com/one")], unindexed(lines))
+
+ def test_two_projects_in_one_tree_are_not_the_same_project(self):
+ self.assertFalse(same_project("https://example.com/fork", "https://example.com/fork-2"))
+ self.assertTrue(same_project("https://example.com/fork", "https://example.com/fork/FORK.md"))
+
+ def test_a_wrapped_step_is_joined_onto_its_first_line(self):
+ page = '1. Add a row, and the project under its TV brand in\n "Find a project by TV brand".\n2. Bump it.\n'
+ found = steps(page)
+ self.assertEqual(2, len(found))
+ self.assertIn("Find a project by TV brand", found[0][1])
+
if __name__ == "__main__":
unittest.main()