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
examples: add XGIMI MoGo 4 projector (WK08K, altai, MediaTek), Google TV 14
Mathieuc3706d3375bc
diff --git a/examples/xgimi-mogo-4/README.md b/examples/xgimi-mogo-4/README.mdnew file mode 100644index 000000000..0dca2f227--- /dev/null+++ b/examples/xgimi-mogo-4/README.md@@ -0,0 +1,146 @@+# XGIMI MoGo 4 (Google TV 14 portable projector)++Model `WK08K`, device `altai`, MediaTek, 1.8 GB RAM, firmware `UKNV.260612.001.15630599`, French+unit. Both halves work: the debloat list and the Clean Your TV launcher as Home.++**Tested on 24 October 2026, one session of a few hours including one reboot** — not the several+days [CONTRIBUTING](../../CONTRIBUTING.md) asks for. Every entry below was applied and checked on+the real unit; what is not proven is that nothing surfaces after days of use.++Same board as [`xgimi-mogo-3-pro`](../xgimi-mogo-3-pro/), one firmware build older, so that list+applies closely. Differences on this unit: `com.nbcast.wirelessscreen` (MagiCast) is replaced by+`com.xgimi.starmirror`, `com.xgimi.screensaver` and `com.google.android.videos` are not present, and+nothing shipped disabled from the factory (`com.google.android.youtube.tvmusic` is enabled here).++| File | What it is |+|---|---|+| `debloat.txt` | The 22 packages that were disabled, grouped and commented, with what to keep and why |+| `config.json` | Dock order, 5 columns, no tuner, the gear and app buttons, and `stock_home_redirect`; push it with `tools/theme.sh` |++All commands run from the repo root, with the projector's IP in `TV_HOST`.++## Turning ADB on++Settings → System → About → press OK on **Build** 7 times, then Developer options. This firmware+offers **only "Wireless debugging"** — there is no separate network-ADB switch, and USB debugging+alone does not open port 5555. Turning Wireless debugging on also reopens 5555, which is what+`tools/tv.py` uses:++```bash+TV_HOST=<projector-ip> tools/tv.py --probe+```++Google's own `adb` is answered `unauthorized` unless you pair it; `tools/tv.py` authenticates with+its own key and needs no pairing after the first "Allow USB debugging?" prompt.++**Network ADB does not survive a reboot here.** After every restart, Wireless debugging is off again+and the port is closed. Plan the work in one sitting, or expect to walk to the projector.++## Install++1. **Check who owns the Wi-Fi network you are actually on**, before trusting `disable.sh`'s skip+ message. It refuses setupwraith whenever *any* saved network belongs to it, which on this unit was+ a phone hotspot, not the network in use:++ ```bash+ TV_HOST=<projector-ip> tools/tv.py "dumpsys wifi | grep -E '^(\*? ?ID: [0-9])'"+ ```++ The entry marked `Currently Connected: true` is the one that matters. If its `cname` is+ `android.uid.system`, disabling setupwraith is safe and `FORCE_SETUPWRAITH=1` is the right+ override. If it is `com.google.android.tungsten.setupwraith`, forget the network and join it again+ on the projector first.++2. Run:++```bash+TV_HOST=<projector-ip> FORCE_SETUPWRAITH=1 tools/disable.sh examples/xgimi-mogo-4/debloat.txt+TV_HOST=<projector-ip> HOME_KEY_SERVICE=1 launcher/build-and-install.sh+TV_HOST=<projector-ip> tools/theme.sh examples/xgimi-mogo-4+```++`HOME_KEY_SERVICE=1` is not optional on this projector — see below. Pass it on every reinstall;+Android drops the service each time.++## The stock launcher does not stay disabled++`com.google.android.apps.tv.launcherx` re-enabled itself **across the reboot and again within+minutes of being disabled during use**. XGIMI's `com.xgimi.xrmservice` does this on its remote keys,+as the MoGo 3 Pro header already notes.++Do not re-disable it after every boot. `stock_home_redirect` (in `config.json`, needing+`HOME_KEY_SERVICE=1`) sends Home straight back to the new launcher whenever launcherx surfaces, and+that is what actually holds the home screen. Measured: with `HomeKeyService` unbound, one press of+Home landed on the stock Google TV launcher.++Disabling only the home activity, so the package could stay enabled and keep `xrmservice` happy,+does not work on this firmware:++```bash+pm disable --user 0 com.google.android.apps.tv.launcherx/.home.HomeActivity # SecurityException+```++Same refusal as the Hisense set in+[`docs/devices/tcl-55p71b-g09-key-repeat.md`](../../docs/devices/tcl-55p71b-g09-key-repeat.md).++## The helper costs volume-key auto-repeat++With `HomeKeyService` bound, **holding volume up or down moves one step instead of ramping**. The+service binds with `CAPABILITY_CAN_FILTER_KEY_EVENTS` (`capabilities=8` in `dumpsys accessibility`),+and this firmware then drops key repeats — the same mechanism as the TCL, Xiaomi and Hisense sets in+[`docs/devices/tcl-55p71b-g09-key-repeat.md`](../../docs/devices/tcl-55p71b-g09-key-repeat.md).++What the A/B test on this unit showed:++| `enabled_accessibility_services` | Hold volume | Hold D-pad | Home press keeps the new launcher |+| --- | --- | --- | --- |+| `com.gathin.tvhome/.HomeKeyService` | one step per press | repeats normally | yes |+| `""`, with `accessibility_enabled 0` | ramps continuously | repeats normally | **no**, the stock launcher takes over |++Two things differ from that note. Only the **volume** keys lost repeat; a held D-pad direction still+repeats, so navigating the grid is unaffected. And the choice is not the one that note describes: on+those sets dropping the helper costs the gear and app buttons, while here it costs the launcher+itself, because of `xrmservice` above. The owner kept the helper and lives with stepwise volume.++To switch, two `settings` writes either way:++```bash+# helper off: volume ramps, the stock launcher will take Home back+tools/tv.py "settings put secure enabled_accessibility_services ''; settings put secure accessibility_enabled 0"+# helper on+tools/tv.py "settings put secure enabled_accessibility_services com.gathin.tvhome/.HomeKeyService; settings put secure accessibility_enabled 1"+```++`am force-stop com.gathin.tvhome`, a cleaner app and `tools/theme.sh` all drop the helper; `theme.sh`+puts it back.++## Remote buttons++All of these were checked by pressing the real remote, not by injecting keycodes.++| Button | Arrives as | Needs |+| --- | --- | --- |+| Gear / Settings | `KEYCODE_NOTIFICATION` 83 | `settings_key_keycodes`, `HOME_KEY_SERVICE=1` |+| YouTube | `KEYCODE_F4` | `app_keys` |+| Netflix | `KEYCODE_F9` | `app_keys` |+| Prime Video | `KEYCODE_F8` | `app_keys` |+| Input / Source | — | works without a helper |+| Home | — | works; `stock_home_redirect` keeps it on the new launcher |++The keycodes are the MoGo 3 Pro's and were confirmed to work unchanged on this remote.++## Inputs and hardware++Only HDMI 1 exists and it opens through `com.google.android.tv.inputplayer` straight from the Inputs+menu, so no `input_action` is needed (unlike the Horizon S Pro). No tuner, hence+`"live_tv_package": ""`.++Autofocus, trapezoidal correction and the remote were checked by hand after every batch and were+unaffected throughout. The XGIMI packages behind them are listed under "DO NOT DISABLE" in+`debloat.txt`.++## Notes on `config.json`++The dock here is Netflix, YouTube, Prime Video and Apple TV. The tested unit had a fifth dock app+(an IPTV client) that is too personal to ship; with `columns` 5 the free slot fills itself from the+grid, so the dock has no gap. Reorder from the projector with a long press on the Settings pill.diff --git a/examples/xgimi-mogo-4/config.json b/examples/xgimi-mogo-4/config.jsonnew file mode 100644index 000000000..323da9f10--- /dev/null+++ b/examples/xgimi-mogo-4/config.json@@ -0,0 +1,18 @@+{+ "dock_apps": [+ "com.netflix.ninja",+ "com.google.android.youtube.tv",+ "com.amazon.amazonvideo.livingroom",+ "com.apple.atve.androidtv.appletv"+ ],+ "columns": 5,+ "live_tv_package": "",+ "rows_below_dock": 0,+ "settings_key_keycodes": [83],+ "app_keys": [+ "KEYCODE_F4:com.google.android.youtube.tv",+ "KEYCODE_F9:com.netflix.ninja",+ "KEYCODE_F8:com.amazon.amazonvideo.livingroom"+ ],+ "stock_home_redirect": "com.google.android.apps.tv.launcherx"+}diff --git a/examples/xgimi-mogo-4/debloat.txt b/examples/xgimi-mogo-4/debloat.txtnew file mode 100644index 000000000..a47338924--- /dev/null+++ b/examples/xgimi-mogo-4/debloat.txt@@ -0,0 +1,118 @@+# XGIMI MoGo 4 projector (model WK08K, device altai, MediaTek), Google TV / Android 14 (SDK 34),+# build UKNV.260612.001.15630599, France.+#+# Apply: TV_HOST=<projector ip> tools/disable.sh examples/xgimi-mogo-4/debloat.txt+# Undo: TV_HOST=<projector ip> tools/restore.sh examples/xgimi-mogo-4/debloat.txt com.google.android.apps.tv.launcherx+# Everything is DISABLED, not uninstalled. Comment out any line you want to keep.+#+# Tested for one session (a few hours) on 2026-10-24, including one reboot, not the several days+# CONTRIBUTING asks for. Every entry was applied and checked on the real unit; what has not been+# proven is that nothing surfaces after days of use. See README.md in this folder.+#+# Same board (altai) as examples/xgimi-mogo-3-pro, one firmware build older, so that list applies+# closely. Differences on this unit: com.nbcast.wirelessscreen (MagiCast) is replaced by+# com.xgimi.starmirror, com.xgimi.screensaver and com.google.android.videos are not present, and+# nothing was disabled from the factory (com.google.android.youtube.tvmusic ships enabled here).+#+# Stock launcher: com.google.android.apps.tv.launcherx (HOME priority 2), with the setup wizard's+# RecoveryActivity at priority 1, so setupwraith is listed below.+# setupwraith owned one saved Wi-Fi network, a phone hotspot, and NOT the network the projector was+# using: `dumpsys wifi` showed cname=android.uid.system:1000 on the entry with+# "Currently Connected: true". Checking which entry is connected before trusting disable.sh's+# skip message is worth it; FORCE_SETUPWRAITH=1 was used after that check, and ADB and Wi-Fi held.+# Only the unused hotspot entry was lost.+#+# Launcher notes (applied and verified on a real unit on 2026-10-24):+# - Install with HOME_KEY_SERVICE=1, and put this in config.xml or a theme's config.json+# (config.json in this folder has them):+# "live_tv_package": "" no tuner+# "columns": 5+# "settings_key_keycodes": [83] the gear button sends KEYCODE_NOTIFICATION+# "app_keys": ["KEYCODE_F4:com.google.android.youtube.tv",+# "KEYCODE_F9:com.netflix.ninja",+# "KEYCODE_F8:com.amazon.amazonvideo.livingroom"]+# "stock_home_redirect": "com.google.android.apps.tv.launcherx"+# - THE STOCK LAUNCHER DOES NOT STAY DISABLED. launcherx re-enabled itself across the reboot and+# again within minutes of being disabled during use (XGIMI's com.xgimi.xrmservice, as on the+# MoGo 3 Pro). Do not re-disable it after every boot: stock_home_redirect is what holds the new+# home screen. Measured: with HomeKeyService unbound, one press of Home landed on the stock+# Google TV launcher. Disabling only its home activity+# (`pm disable --user 0 com.google.android.apps.tv.launcherx/.home.HomeActivity`) is refused with+# a SecurityException on this firmware, so package-level disable plus the redirect is the only route.+# - HOME_KEY_SERVICE costs volume-key auto-repeat on this firmware: holding volume up/down moves one+# step instead of ramping, the same CAPABILITY_CAN_FILTER_KEY_EVENTS mechanism as+# docs/devices/tcl-55p71b-g09-key-repeat.md (dumpsys accessibility shows capabilities=8). Holding a+# D-pad direction still repeats normally; only the volume keys were affected. Unlike the sets in+# that note, the helper is not optional here: dropping it gives the stock launcher back (above),+# so the trade is the new launcher against the volume ramp, not buttons against the volume ramp.+# The owner kept the helper.+# - HDMI 1 (the only port) opens through com.google.android.tv.inputplayer from the Inputs menu, so+# no input_action is needed (unlike the Horizon S Pro).+# - Network ADB does not survive a reboot: Developer options offers only "Wireless debugging", and+# turning that on also reopens 5555 for tools/tv.py. The stock adb binary is answered+# "unauthorized"; tools/tv.py authenticates with its own key.+# - Screenshots from `screencap -p` start with a vendor log line; tools/tv.py already strips it.+#+# DO NOT DISABLE on this model (projector hardware, inputs, mirroring):+# com.xgimi.autokst # auto keystone correction+# com.xgimi.windowsystem # keystone/window service+# com.xgimi.tof # ToF autofocus+# com.xgimi.misckey # remote keys, focus/keystone shortcuts+# com.xgimi.uiconfiguration # global key receiver, power listener+# com.xgimi.xrmservice # global remote keys, picture/sound adaptation (re-enables the stock launcher, see above)+# com.xgimi.xgimiservice # core XGIMI system service+# com.xgimi.autoinstall # purpose unclear (PermissionRequestActivity only): kept+# com.xgimi.overseas.xgimiatvbootwizard # first-boot wizard+# com.mediatek.tvinput # HDMI input service+# com.mediatek.tv.service # TV service, Netflix key receiver+# com.google.android.tv.inputplayer # HDMI passthrough player and input switcher+# com.xgimi.starmirror # XGIMI screen-mirroring receiver (ships as a user app here)+# com.dolby.android.audio.service # Dolby audio++# Store demo, factory and test tools+fusion.android.tv.demo # RetailDisplay store demo+com.xgimi.atvwifiverify # factory Wi-Fi verification+com.xgimi.minitvfactory # factory menu, file transfer and burn-in (never launched)++# Telemetry and feedback+com.xgimi.bugreportsender # XGIMI bug report uploader+com.google.android.feedback # Google feedback+com.android.tv.feedbackconsent # feedback / diagnostics consent prompt+com.mstar.android.tv.disclaimercustomization # vendor disclaimer screen, first-run only++# Google ad, attribution and on-device personalisation services+com.android.adservices.api # Privacy Sandbox ad services (Topics, attribution)+com.android.ondevicepersonalization.services # on-device ad personalisation+com.android.federatedcompute.services # federated learning for the above+com.google.android.partnersetup # partner / RLZ install-attribution pings++# Google TV setup wizard (claims HOME on Google TV 14; re-enable before a factory reset)+com.google.android.tungsten.setupwraith++# Google preloads+com.google.android.play.games # Play Games+com.google.android.youtube.tvmusic # YouTube Music+com.google.android.marvin.talkback # TalkBack (accessibility), off by choice++# Voice and phone remote (off by choice)+com.google.android.katniss # Google Assistant / Gemini voice search+com.google.android.tv.assistant # assistant LED / hotword service+com.google.android.tv.remote.service # Google TV phone-as-remote, not the Bluetooth remote++# XGIMI extras (off by choice)+com.xgimi.doubanfm # XGIMI music app, speaker-mode screen++# Preinstalled streaming apps (off by choice; they ship as user apps on this French unit)+com.disney.disneyplus # Disney++com.orange.owtv.tv # Orange TV++# Kept by choice on this unit: com.netflix.ninja, com.google.android.youtube.tv,+# com.amazon.amazonvideo.livingroom, com.apple.atve.androidtv.appletv, com.canal.android.canal,+# fr.francetv.pluzz, fr.m6.m6replay, tv.arte.plus7, com.google.android.apps.mediashell (Chromecast),+# com.xgimi.ota.accessories (remote/speaker firmware), com.xgimi.gimiplayer (local player),+# com.google.android.apps.tv.dreamx (Backdrop screensaver). The projector's own firmware updater+# was left enabled.++# Disabled last, after the new launcher was confirmed as Home with+# `dumpsys activity activities | grep mFocusedApp`. It comes back on its own: see the header.+com.google.android.apps.tv.launcherxdiff --git a/examples/xgimi-mogo-4/tv.json b/examples/xgimi-mogo-4/tv.jsonnew file mode 100644index 000000000..412253301--- /dev/null+++ b/examples/xgimi-mogo-4/tv.json@@ -0,0 +1,6 @@+{+ "tv": "XGIMI MoGo 4 projector (WK08K, altai, MediaTek)",+ "os": "Google TV 14",+ "brand": "XGIMI",+ "notes": "Same altai board as the MoGo 3 Pro, one build older: factory and burn-in tools, bug-report uploader, Google feedback and ad services, setupwraith, Google preloads, Assistant and phone remote; keystone/autofocus/HDMI and StarMirror mirroring kept. setupwraith owned a saved hotspot but not the network in use, so check which entry is connected before `FORCE_SETUPWRAITH`. launcherx re-enables itself across a reboot and during use, so `stock_home_redirect` is what holds Home; `HOME_KEY_SERVICE` is therefore not optional, and it costs volume-key auto-repeat (a held D-pad still repeats). Wireless debugging only, and the port closes at every reboot. config.json has the dock; one session of a few hours, reboot-checked"+}