Skip to content

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

docs: document remote key overrides, scancode collision caveats, and Live button behavior

Pattag549cbead08ea
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md
index 685440fd8..0323e040d 100644
--- a/docs/TROUBLESHOOTING.md
+++ b/docs/TROUBLESHOOTING.md
@@ -881,6 +881,17 @@ running back on the list the next time it starts; a helper turned off in Setting
- **All vendor buttons die at once** and `logcat` says `GLOBAL_BUTTON ... process is bad`: the
global-key receiver crashes on the disabled launcherx and Android stops starting it. Map every such
keycode in the helpers, also for disabled apps. See [the MOSR4 note](devices/xiaomi-mitv-mosr4.md).
+- **A remote shortcut (such as a "Live" or TV button) opens Google Play Store or crashes after debloating**:
+ When a target app such as Live Channels (`com.google.android.tv`) is disabled, pressing its physical
+ button makes OEM broadcast receivers (such as Xiaomi's `com.xiaomi.android.tvsetup.partnercustomizer/.GlobalKeyReceiver`)
+ launch a market intent to install the missing package, or crash repeatedly.
+ To remap it cleanly, put its hardware scancode in `app_keys`: `"scan:<scancode>:<package>"` (e.g.
+ `"scan:399:org.smarttube.stable"` on the Xiaomi Mi Box S, read from `getevent -lt`) and rebuild with
+ `INPUT_KEY_SERVICE=1`.
+ **Use the scancode form (`scan:<scancode>`) rather than a raw keycode (`191`):** generic button keycodes
+ like `KEYCODE_BUTTON_4` (191) may be shared with other buttons on some remotes/key layouts, so mapping by keycode
+ can unintentionally hijack other buttons.
+ `scan:` checks match first and target only that specific physical button. See [the Mi Box S note](devices/xiaomi-mi-box-s.md).
- **The list still names the helper but `accessibility_enabled` is `0`**, so nothing is bound and the
button does nothing (not the force stop below): on a TCL C6K Pro (`G08`, Android 14,
[#1047](https://github.com/Gathin23/cleanyourtv/issues/1047)) a reboot left
diff --git a/docs/devices/xiaomi-mi-box-s.md b/docs/devices/xiaomi-mi-box-s.md
index 4a9209186..79a5f4728 100644
--- a/docs/devices/xiaomi-mi-box-s.md
+++ b/docs/devices/xiaomi-mi-box-s.md
@@ -38,6 +38,16 @@ Nothing broke between batches.
`HomeKeyService` catches `KEYCODE_ALL_APPS`, so enabling it (`-HomeKeyService` on
`launcher/build-and-install.ps1`) turns the Apps button into a second Home button. Checked with the
real remote from inside VLC: the press started `com.gathin.tvhome/.MainActivity`.
+- **The remote's Live button opens Google Play if not overridden.** On remotes with a dedicated "Live"
+ button (MDZ-22-AB remote revisions), it sends scancode 399 (mapped to `BUTTON_4` in `Vendor_2717_Product_32b9.kl`).
+ Once `com.google.android.tv` (Live Channels) is disabled, pressing
+ it causes `com.xiaomi.android.tvsetup.partnercustomizer/.GlobalKeyReceiver` to fire a Play Store lookup
+ for the missing package ("Item not found").
+ Map it with `app_keys`: `"scan:399:<package>"` (e.g. `"scan:399:org.smarttube.stable"`) and install
+ with `INPUT_KEY_SERVICE=1` (`-InputKeyService` on Windows) so `InputKeyService` consumes the scancode
+ before `partnercustomizer` sees it. **Do not map it as keycode 191 (`KEYCODE_BUTTON_4`):** that keycode
+ may be shared with other buttons on some remotes/key layouts. The scancode form `scan:399` targets specifically
+ the physical Live button.
- The other buttons, checked with the real remote and `getevent -lt`: Home (`KEY_HOMEPAGE`), Back,
voice (`KEY_VOICECOMMAND`, Assistant kept) and Netflix (`KEY_VIDEO`, scancode 393 is `NETFLIX` in
the same `.kl`) all work with the stock launcher disabled.
diff --git a/examples/xiaomi-mi-box-s/debloat.txt b/examples/xiaomi-mi-box-s/debloat.txt
index 5557cd35a..dfe402cc7 100644
--- a/examples/xiaomi-mi-box-s/debloat.txt
+++ b/examples/xiaomi-mi-box-s/debloat.txt
@@ -33,6 +33,9 @@
# - The saved Wi-Fi belonged to android.uid.system, not setupwraith; setupwraith was not needed.
# - The Apps button (scancode 580, ALL_APPS) opens Home with the launcher's HomeKeyService
# (build-and-install -HomeKeyService). Home, Back, voice and Netflix work without it.
+# - On remotes with a Live button (scancode 399), disabling com.google.android.tv triggers
+# partnercustomizer to open Google Play unless remapped via app_keys ("scan:399:<package>",
+# build-and-install -InputKeyService).
#
# Third unit (same PI.3933 build), Turkey, 2026-09-17 to 2026-10-24 (37 days):
# - Xiaomi's update service enables PatchWall again. Its component applife.LifeKeeper installs