Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.
Python adbadblockandroid-tvandroid-tv-launcherapple-tvbloatware-removalclaude-codedebloatfire-tvgoogle-tvlauncherprivacysmart-tvsony-braviatclvibe-codingxiaomi
README: the quick start clones the repo before it pastes the prompt (#1617)
xbsheng76bc13d23f19
diff --git a/README.ja.md b/README.ja.mdindex 147395525..bab769cf9 100644--- a/README.ja.md+++ b/README.ja.md@@ -50,10 +50,12 @@| ステップ | やること ||---|---|| 1. テレビで | **設定 → システム(またはデバイス設定)→ 端末情報** を開き、**ビルド** の項目で OK を 7 回押します。戻って **開発者向けオプション** を開き、**USB デバッグ** をオンにします。ネットワークデバッグ / ADB デバッグのスイッチがあればそれもオンにします。メニューの名前は機種によって異なります。 |-| 2. パソコンで | [`PROMPT.md`](PROMPT.md) の内容をアシスタントに貼り付け、テレビの機種名を記入します。 |+| 2. パソコンで | リポジトリを複製してそのフォルダをアシスタントで開き(`git clone https://github.com/Gathin23/cleanyourtv`)、[`PROMPT.md`](PROMPT.md) の内容をアシスタントに貼り付けてテレビの機種名を記入します。 || 3. アシスタントに答える | テレビにデバッグの許可を求められたら **許可** を押し、よく使うアプリ、ドックに置きたいアプリ、音声アシスタント・Chromecast・システムアップデートを残すかどうかをアシスタントに伝えます。 || 4. 確認する | 指示に従ってバックアップ、無効化、インストールを行い、アプリの起動、リモコンのボタン、HDMI 入力の切り替え、復元方法を試します。 |+複製する理由:アシスタントは独自のスクリプトを書かず、このリポジトリの `tools/disable.sh` と `launcher/build-and-install.sh` を使います。バックアップ、ホーム画面の保護、復元用の記録はそこにあります。+## ランチャーの機能- **シンプルなホーム画面**:暗い背景に、デフォルトでよく使う 4 つのアプリを下部のドックに並べます。diff --git a/README.md b/README.mdindex 71f4256ac..61aaaa98a 100644--- a/README.md+++ b/README.md@@ -65,9 +65,12 @@ Any of these work: Claude Code (on [0G Private Computer](https://pc.0g.ai) or an| Where | What to do ||---|---|| **1. On the TV** | Settings → Device Preferences → About → press OK on **Build** seven times → back → Developer options → **USB debugging** on. If you see a Network or ADB debugging toggle, turn that on too. Keep the TV on. |-| **2. On your computer** | Paste [`PROMPT.md`](PROMPT.md) into your assistant and fill in your TV model. |+| **2. On your computer** | Clone the repo and open that folder in your assistant (`git clone https://github.com/Gathin23/cleanyourtv`), then paste [`PROMPT.md`](PROMPT.md) and fill in your TV model. || **3. Follow along** | Accept "Allow USB debugging?" on the TV, then answer the checklist: which apps you use, the dock size and app order, whether to keep the voice assistant, Chromecast and updates. |+Cloning matters: the assistant reuses this repo's `tools/disable.sh` and `launcher/build-and-install.sh`+instead of writing its own, and that is where the backup, the Home guard and the restore record live.+The assistant backs up, debloats, builds and installs the launcher, and checks each step withscreenshots pulled from the TV. With this repo as context it takes about fifteen minutes.diff --git a/README.vi.md b/README.vi.mdindex 5c88838ee..4baf78355 100644--- a/README.vi.md+++ b/README.vi.md@@ -50,10 +50,12 @@ Bạn cần một máy tính nối cùng mạng với TV và một trợ lý l| Bước | Làm gì ||---|---|| 1. Trên TV | Vào **Cài đặt → Hệ thống (hoặc Tuỳ chọn thiết bị) → Giới thiệu**, bấm OK bảy lần vào mục **Bản dựng / Build**, quay lại mở **Tuỳ chọn nhà phát triển** và bật **USB debugging**. Nếu có thêm công tắc gỡ lỗi mạng / ADB thì bật luôn. Tên menu khác nhau tuỳ máy. |-| 2. Trên máy tính | Dán nội dung [`PROMPT.md`](PROMPT.md) cho trợ lý và điền model TV của bạn. |+| 2. Trên máy tính | Sao chép kho lưu trữ và mở thư mục đó trong trợ lý (`git clone https://github.com/Gathin23/cleanyourtv`), rồi dán nội dung [`PROMPT.md`](PROMPT.md) cho trợ lý và điền model TV của bạn. || 3. Trả lời trợ lý | Bấm **Allow** khi TV hỏi cho phép gỡ lỗi, rồi cho trợ lý biết bạn hay dùng ứng dụng nào, muốn để app nào trên thanh dock, có giữ trợ lý giọng nói, Chromecast và cập nhật hệ thống hay không. || 4. Kiểm tra | Làm theo hướng dẫn để sao lưu, dọn dẹp và cài đặt, rồi thử mở ứng dụng, nút remote, chuyển nguồn HDMI và cách khôi phục. |+Vì sao cần sao chép kho lưu trữ: trợ lý dùng luôn `tools/disable.sh` và `launcher/build-and-install.sh` của kho này thay vì tự viết bộ công cụ riêng, và bản sao lưu, lớp bảo vệ Home cùng bản ghi khôi phục đều nằm trong đó.+## Launcher có gì- **Màn hình chính tối giản**: nền tối, mặc định bốn ứng dụng hay dùng trên thanh dock phía dưới.diff --git a/README.zh-CN.md b/README.zh-CN.mdindex 380bef8ec..a04d23375 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -38,10 +38,12 @@| 步骤 | 操作 ||---|---|| 1. 电视端 | 打开「设置 → 设备偏好设置 → 关于」,在「版本号 / Build」上连续按七次确定,返回后进入开发者选项,开启 USB 调试。如果另有网络调试或 ADB 调试开关,也需要开启。菜单名称因机型而异。 |-| 2. 电脑端 | 将 [`PROMPT.md`](PROMPT.md) 的内容交给助手,填写电视型号。 |+| 2. 电脑端 | 先克隆仓库并在助手中打开该文件夹(`git clone https://github.com/Gathin23/cleanyourtv`),再将 [`PROMPT.md`](PROMPT.md) 的内容交给助手,填写电视型号。 || 3. 确认需求 | 在电视上接受调试授权,告诉助手常用应用、底部快捷栏中的应用,以及是否保留语音助手、Chromecast 和系统更新。 || 4. 检查结果 | 按提示完成备份、清理和安装,检查应用启动、遥控器操作、输入源和恢复路径。 |+先克隆仓库的意义在于:助手会直接使用本仓库的 `tools/disable.sh` 和 `launcher/build-and-install.sh`,不会另写一套;备份、默认桌面保护和恢复记录都在其中。+## 桌面功能- **简洁首页**:深色背景,默认四个常用应用组成底部快捷栏。diff --git a/tests/test_readme_quick_start_clone.py b/tests/test_readme_quick_start_clone.pynew file mode 100644index 000000000..e434f13a0--- /dev/null+++ b/tests/test_readme_quick_start_clone.py@@ -0,0 +1,212 @@+"""The quick start's second step pasted PROMPT.md and never said to clone the repo first.++PROMPT.md is a prompt, not the repository. It sends the assistant to questions the repo answers:+`tools/tv.py` for the connection, `tools/disable.sh`, which writes the restore record and holds the+Home guard, `launcher/build-and-install.sh`, which builds the launcher and checks Home came back,+`examples/` for a tested list, `docs/` for the notes. Its own opening has one sentence about that -+"If you cloned this repo, mention that" - and nothing on any page said what to clone, so step 2 of+the quick start ("paste PROMPT.md into your assistant") was followed literally by a reader who had+only the web page. #1617 is that session on a TCL 50C755: the assistant answered that "the repo+tools you mention (tools/tv.py, tools/disable.sh, docs/, examples/) aren't in this folder" and said+it would write equivalent helper scripts itself, which is the one path the safety rules exist to+close - a hand-written disable loop has no restore record and no Home guard.++So all four READMEs clone first, in the same row that names the prompt, and say why on the line+under the table: the assistant reuses this repo's `tools/disable.sh` and `launcher/build-and-install.sh`+instead of writing its own. The paragraph names both scripts rather than describing them, so a reader+can see what the clone buys before they run anything.++PROMPT.md is the maintainer's file (AGENTS.md, and .github/maintainer/MAINTAINER.md holds it), so the+prompt-side half of #1617 - naming the repo inside the prompt itself - is left to them; this is the+installation half the reporter asked for, which is a README.++The owner/repo the clone URL must carry is read out of .github/ISSUE_TEMPLATE/config.yml instead of+being copied in, so a fork or a rename moves the URL with the page rather than leaving a dead command.++Run from the repository root: python3 -m unittest discover -s tests -v+"""+import re+import unittest+from pathlib import Path++ROOT = Path(__file__).resolve().parents[1]+ISSUE_TEMPLATE = ROOT / ".github" / "ISSUE_TEMPLATE" / "config.yml"+PROMPT = ROOT / "PROMPT.md"+# `| first | second |`, the two-column shape the quick start uses.+ROW = re.compile(r"^\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*$")+SEPARATOR = re.compile(r"^[-: ]+$")+STEP_TWO = re.compile(r"^\**\s*2\.")+++def pages():+ """The English README and every translation beside it."""+ return [ROOT / "README.md"] + sorted(ROOT.glob("README.*.md"))+++def rows(text):+ """Table rows as (first cell, last cell), the separator row dropped."""+ found = []+ for line in text.splitlines():+ match = ROW.match(line.strip())+ if not match or SEPARATOR.match(match.group(1)):+ continue+ found.append((match.group(1), match.group(2)))+ return found+++def prompt_rows(text):+ """The table rows that name PROMPT.md - the quick start's paste step is meant to be the only one."""+ return [(first, rest) for first, rest in rows(text) if "PROMPT.md" in rest]+++def slug():+ """owner/repo, read from the issue template's links so a rename moves the clone URL too."""+ match = re.search(r"github\.com/([\w.-]+/[\w.-]+)/", ISSUE_TEMPLATE.read_text(encoding="utf-8"))+ return match.group(1) if match else ""+++def clone_problems(text, owner_repo):+ """What is wrong with a page's paste step, as sentences; empty when the step clones first."""+ found = prompt_rows(text)+ if len(found) != 1:+ return [f"{len(found)} table rows name PROMPT.md: the quick start must have one paste step"]+ first, rest = found[0]+ problems = []+ if not STEP_TWO.match(first):+ problems.append(f"the row naming PROMPT.md reads {first!r}, not step 2")+ if "git clone" not in rest:+ problems.append("the row that pastes PROMPT.md does not clone the repo first")+ elif f"github.com/{owner_repo}" not in rest:+ problems.append(f"the clone command does not name github.com/{owner_repo}")+ elif rest.index("git clone") > rest.index("PROMPT.md"):+ problems.append("the clone command comes after PROMPT.md in the row")+ return problems+++def note_after(text, needle):+ """The paragraph that follows the table row containing `needle`, wrapping joined, or ''."""+ lines = text.splitlines()+ for index, line in enumerate(lines):+ if line.strip().startswith("|") and needle in line:+ rest = lines[index + 1:]+ break+ else:+ return ""+ while rest and (rest[0].strip().startswith("|") or not rest[0].strip()):+ rest = rest[1:]+ paragraph = []+ for line in rest:+ if not line.strip():+ break+ paragraph.append(line.strip())+ return " ".join(paragraph)+++class TheCloneStep(unittest.TestCase):+ def test_the_slug_is_read_out_of_the_issue_template(self):+ self.assertTrue(ISSUE_TEMPLATE.is_file(), "no .github/ISSUE_TEMPLATE/config.yml to read the repo from")+ self.assertRegex(slug(), r"^[\w.-]+/[\w.-]+$",+ "the issue template names no github.com/<owner>/<repo> URL")++ def test_four_readmes_are_read(self):+ found = pages()+ self.assertEqual(4, len(found), f"expected README.md and three translations, read {[p.name for p in found]}")+ for page in found:+ self.assertGreaterEqual(len(rows(page.read_text(encoding="utf-8"))), 3,+ f"{page.name} parses as fewer than three table rows")++ def test_every_readme_clones_before_it_pastes_the_prompt(self):+ owner_repo = slug()+ for page in pages():+ with self.subTest(page=page.name):+ problems = clone_problems(page.read_text(encoding="utf-8"), owner_repo)+ self.assertEqual([], problems, f"{page.name}: {problems}")++ def test_the_line_under_the_table_says_what_the_clone_buys(self):+ """The two scripts the assistant would otherwise rewrite, named as paths so they are findable."""+ for page in pages():+ with self.subTest(page=page.name):+ note = note_after(page.read_text(encoding="utf-8"), "PROMPT.md")+ for path in ("tools/disable.sh", "launcher/build-and-install.sh"):+ self.assertIn(path, note,+ f"{page.name}'s line under the quick start does not name {path}: {note!r}")++ def test_the_prompt_still_assumes_a_clone(self):+ """The page sends a reader to clone because the prompt's own opening asks about it."""+ self.assertIn("If you cloned this repo", PROMPT.read_text(encoding="utf-8"),+ "PROMPT.md no longer mentions a clone, so the README's clone step has nothing behind it")+++class TheReader(unittest.TestCase):+ """clone_problems() against pages written here, so a broken reader fails rather than the page."""++ GOOD = (+ "| Where | What to do |\n"+ "|---|---|\n"+ "| **1. On the TV** | USB debugging on. |\n"+ "| **2. On your computer** | Clone the repo (`git clone https://github.com/o/r`), then paste "+ "[`PROMPT.md`](PROMPT.md). |\n"+ )++ def test_a_page_that_clones_first_is_quiet(self):+ self.assertEqual([], clone_problems(self.GOOD, "o/r"))++ def test_a_row_without_the_clone_is_reported(self):+ text = self.GOOD.replace("Clone the repo (`git clone https://github.com/o/r`), then paste ",+ "Paste ")+ self.assertEqual(["the row that pastes PROMPT.md does not clone the repo first"],+ clone_problems(text, "o/r"))++ def test_a_clone_after_the_prompt_is_reported(self):+ text = self.GOOD.replace(+ "Clone the repo (`git clone https://github.com/o/r`), then paste [`PROMPT.md`](PROMPT.md).",+ "Paste [`PROMPT.md`](PROMPT.md) from `git clone https://github.com/o/r`.")+ self.assertEqual(["the clone command comes after PROMPT.md in the row"], clone_problems(text, "o/r"))++ def test_another_repository_is_reported(self):+ text = self.GOOD.replace("github.com/o/r", "github.com/someone/fork")+ self.assertEqual(["the clone command does not name github.com/o/r"], clone_problems(text, "o/r"))++ def test_the_step_number_is_read(self):+ text = self.GOOD.replace("**2. On your computer**", "**4. Later**")+ self.assertEqual(["the row naming PROMPT.md reads '**4. Later**', not step 2"],+ clone_problems(text, "o/r"))++ def test_two_rows_naming_the_prompt_are_reported(self):+ text = self.GOOD + "| **3. Later** | Paste [`PROMPT.md`](PROMPT.md) again. |\n"+ self.assertEqual(["2 table rows name PROMPT.md: the quick start must have one paste step"],+ clone_problems(text, "o/r"))++ def test_a_clone_in_prose_is_not_the_step(self):+ """A page that clones in a paragraph and pastes in a row with no clone is still a page that pastes first."""+ text = "`git clone https://github.com/o/r`\n\n" + self.GOOD.replace(+ "Clone the repo (`git clone https://github.com/o/r`), then paste ", "Paste ")+ self.assertEqual(["the row that pastes PROMPT.md does not clone the repo first"],+ clone_problems(text, "o/r"))++ def test_the_separator_row_is_not_a_step(self):+ self.assertEqual([], clone_problems(self.GOOD, "o/r"))+ self.assertEqual(3, len(rows(self.GOOD)), "the header and two steps are three rows; the separator is not one")+++class TheNoteReader(unittest.TestCase):+ """note_after() finds the paragraph under the table, not a mention anywhere on the page."""++ TABLE = "| 1. On the TV | x |\n| 2. On your computer | paste [`PROMPT.md`](PROMPT.md) |\n"++ def test_a_wrapped_paragraph_is_joined(self):+ text = self.TABLE + "\nCloning matters: `tools/disable.sh`\nand `launcher/build-and-install.sh`.\n"+ note = note_after(text, "PROMPT.md")+ self.assertIn("`tools/disable.sh` and `launcher/build-and-install.sh`", note)++ def test_a_mention_further_down_the_page_is_not_the_note(self):+ text = self.TABLE + "\nSomething else.\n\n## Later\n\n`tools/disable.sh` is described here.\n"+ self.assertEqual("Something else.", note_after(text, "PROMPT.md"))+ self.assertNotIn("tools/disable.sh", note_after(text, "PROMPT.md"))++ def test_a_page_without_the_row_has_no_note(self):+ self.assertEqual("", note_after("| 1. On the TV | x |\n", "PROMPT.md"))+++if __name__ == "__main__":+ unittest.main()