Skip to content

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

From #105 by ScaryFr92: tv.py reuses ~/.android/adbkey, French strings, two README tips

Gathin239c1ac1c569a9
diff --git a/README.md b/README.md
index 4c128569a..645228815 100644
--- a/README.md
+++ b/README.md
@@ -207,7 +207,7 @@ a folder with a `config.json` (and optionally a `wallpaper.jpg`) pushed to the T
`tools/theme.sh themes/<name>`, which the launcher reads as an overlay over `config.xml`. Three ship
in [`themes/`](themes/), and the keys are documented there. `tools/theme.sh --reset` goes back.
-**Language** follows the TV: English, German, Spanish, Catalan, Russian, Simplified Chinese and Thai so far. If your
+**Language** follows the TV: English, German, Spanish, Catalan, French, Russian, Simplified Chinese and Thai so far. If your
TV doesn't offer yours system-wide, Android 13 and later can set it for the launcher alone, e.g. Catalan:
`tools/tv.py 'cmd locale set-app-locales com.gathin.tvhome --locales ca'`.
@@ -316,6 +316,10 @@ Things that bit us or contributors, so they don't bite you.
USB debugging off when you're done; the launcher doesn't need it.
- **Windows PowerShell 5.1 adds a byte-order mark** to text piped into a program, which turned the
first batch command into gibberish. `tv.py` now strips it, and the `.ps1` scripts pipe clean UTF-8.
+- **"Allow USB debugging?" comes back** although `adb devices` already works: `tv.py` used its own
+ key next to the one platform-tools had registered. It now reuses `~/.android/adbkey` when that
+ exists. Every attempt with an unaccepted key queues one more prompt on the TV, so dismiss them all
+ (Back) before testing with key presses.
- **Git Bash rewrites paths** like `/data/local/tmp` into Windows paths. The scripts set
`MSYS_NO_PATHCONV=1` for you. Set `JAVA_HOME` and `ANDROID_HOME` before building there.
@@ -324,6 +328,12 @@ Things that bit us or contributors, so they don't bite you.
- **Chained `pm` commands** (`pm disable a; pm disable b`) may silently stop after the first. Run
one per shell call; `--batch` does exactly that.
- **Large pushes hang** through the Python client. Use `tools/b64push.py` for APKs.
+- **`adb exec-out screencap -p` gives a broken PNG** on some MediaTek Xiaomi sets: the binary prints
+ `Init wrapper sys mutex successful` on stdout first. Save on the TV and pull the file instead:
+ `screencap -p /data/local/tmp/s.png`.
+- **Play Protect blocked the launcher** ("unsafe app blocked, built for an older version of Android")
+ and `pm install` hung, then failed with `INSTALL_FAILED_VERIFICATION_FAILURE`, while it targeted
+ SDK 29. It targets 34 now; if you built an old checkout, rebuild.
- **Screenshots come out empty** while Live TV, an HDMI input or Netflix is on screen, seen on TCL
and a [Sony KDL-49W800G](https://github.com/Gathin23/cleanyourtv/issues/92). Press Home before
`screencap`. An empty capture means nothing about the ADB connection or playback; check those
diff --git a/launcher/app/src/main/res/values-fr/strings.xml b/launcher/app/src/main/res/values-fr/strings.xml
new file mode 100644
index 000000000..58a154cc2
--- /dev/null
+++ b/launcher/app/src/main/res/values-fr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">Accueil</string>
+ <string name="inputs">Sources</string>
+ <string name="wifi">Wi-Fi</string>
+ <string name="settings">Paramètres</string>
+ <string name="choose_input">Sources</string>
+ <string name="connected">Connecté</string>
+ <string name="standby">En veille</string>
+ <string name="not_connected">Aucun appareil</string>
+ <string name="live_tv">TV en direct</string>
+ <string name="no_inputs">Aucune source trouvée</string>
+ <string name="good_morning">Bonjour</string>
+ <string name="good_afternoon">Bon après-midi</string>
+ <string name="good_evening">Bonsoir</string>
+ <string name="good_night">Bonne nuit</string>
+ <string name="ethernet">Ethernet</string>
+ <string name="offline">Hors ligne</string>
+ <string name="not_available">Indisponible sur cette TV</string>
+ <string name="cant_open">Impossible d\'ouvrir %1$s</string>
+ <string name="date_format">EEEE d MMMM</string>
+ <string name="dream_name">Horloge</string>
+</resources>
diff --git a/launcher/app/src/main/res/xml/locales_config.xml b/launcher/app/src/main/res/xml/locales_config.xml
index 6f2fe3cf9..8e6c73bdf 100644
--- a/launcher/app/src/main/res/xml/locales_config.xml
+++ b/launcher/app/src/main/res/xml/locales_config.xml
@@ -7,6 +7,7 @@
<locale android:name="de" />
<locale android:name="ca" />
<locale android:name="es" />
+ <locale android:name="fr" />
<locale android:name="ru" />
<locale android:name="zh-CN" />
<locale android:name="th" />
diff --git a/tools/tv.py b/tools/tv.py
index ab25568ea..04ac527f3 100644
--- a/tools/tv.py
+++ b/tools/tv.py
@@ -22,6 +22,11 @@ if not HOST:
"(find it under Settings → Network, or look for the TV in `arp -a`)")
KEYDIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "adbkey")
KEY = os.path.join(KEYDIR, "adbkey")
+# Reuse the stock adb key when the TV already trusts it (platform-tools / Android Studio users), so the
+# "Allow USB debugging?" prompt doesn't come back a second time for this client. From #105.
+ADB_KEY = os.path.join(os.path.expanduser("~"), ".android", "adbkey")
+if not os.path.exists(KEY) and os.path.exists(ADB_KEY) and os.path.exists(ADB_KEY + ".pub"):
+ KEY = ADB_KEY
def get_signer():