Skip to content

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

examples/xiaomi-mi-box-s: second unit notes

Yveauxef0255547b43
diff --git a/docs/devices/xiaomi-mi-box-s.md b/docs/devices/xiaomi-mi-box-s.md
new file mode 100644
index 000000000..e1b0161cd
--- /dev/null
+++ b/docs/devices/xiaomi-mi-box-s.md
@@ -0,0 +1,54 @@
+# Xiaomi Mi Box S (MIBOX4), second unit
+
+A second Mi Box S, done with `PROMPT.md` and `examples/xiaomi-mi-box-s/debloat.txt` on 2026-10-21.
+Same build as the first unit: `Xiaomi/oneday/oneday:9/PI/3933:user/release-keys`, security patch
+2021-07-05, SDK 28, 2 GB RAM, 1920x1080, `ro.adb.secure=1`. Done with `tools/tv.py` (no adb binary)
+and the `.ps1` scripts.
+
+## What matched the list
+
+Every package in the list was on this unit and could be disabled with `pm disable-user --user 0`. Disabled
+in three batches with screenshots in between (telemetry; PatchWall, rows and updater; casting and
+preloads), then the launcher, then Backdrop after `screensaver_components` was set to `ClockDream`.
+Nothing broke between batches.
+
+- Home: `com.google.android.tvlauncher` before, as on the first unit. The only other HOME claimant was
+ `com.android.tv.settings/.system.FallbackHome`; no setupwraith claim.
+- `launcher/build-and-install.ps1` worked first time: `set-home-activity` with the component, the stock
+ launcher disabled, `mResumedActivity` on `com.gathin.tvhome/.MainActivity`.
+- After a reboot the same 25 packages were disabled: nothing is re-enabled at boot. Home and Wi-Fi came
+ back by themselves. `MemAvailable` was 1.08 GB before (box running for a while) and 1.23 GB right after
+ the reboot.
+- The Wi-Fi pill says only "Wifi": Location is off, as the list header says.
+- USB debugging alone opened port 5555 (`service.adb.tcp.port=5555`, `sys.usb.config=adb`).
+
+## Where this unit differed
+
+- **Nothing was disabled before we started** (`pm list packages -d` was empty). The five apps the list
+ keeps commented out as "already disabled on this unit" (Prime Video, YouTube Music, Play Movies, Play
+ Games, Camera) were all enabled here; they were disabled by choice.
+- **Google Play Music** (`com.google.android.music`) was installed and enabled. The service closed in
+ 2020; disabled with no side effects.
+- **The saved Wi-Fi did not belong to setupwraith**: `dumpsys wifi | grep -o 'cname=[^ ]*'` showed
+ `android.uid.system:1000` and `com.google.uid.shared:10011` only. setupwraith was not needed for the
+ takeover on this Android TV 9 build and was left alone.
+- **The remote's Apps button can be made useful.** It sends scancode 580 (`KEY_APPSELECT`), which
+ `Vendor_2717_Product_32b9.kl` maps to `ALL_APPS`. Android sends that to `com.android.tv.settings`,
+ which does nothing with it (the first unit saw the same, also on the stock launcher). The launcher's
+ `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 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.
+
+An empty `live_tv_package` (no tuner) can be pushed as a theme `config.json` with `tools/theme.ps1`,
+so `config.xml` stays at its defaults.
+
+## Building on Windows without Android Studio
+
+`launcher/build-and-install.ps1` looks for a JDK only in `JAVA_HOME` or Android Studio's `jbr`. A
+Temurin JDK 17 zip plus the Android command-line tools (`sdkmanager "platforms;android-34"
+"build-tools;34.0.0"`, SDK in `%LOCALAPPDATA%\Android\Sdk`) worked with `JAVA_HOME` set to the JDK.
+
+Lived with: one day so far; still to soak for a few days as CONTRIBUTING.md asks.
diff --git a/examples/README.md b/examples/README.md
index 82d19b3bd..04b059b40 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -157,7 +157,7 @@ on that firmware, grouped and commented. These are starting points: comment out
| `xgimi-horizon-s-pro/` | XGIMI Horizon S Pro projector (XK03H, xgimigalileo, MediaTek) | Android TV 11 | First projector: keystone/autofocus/HDMI player kept, factory and burn-in tools, bug-report uploader, Google preloads; HDMI needs `input_action`; voice, Chromecast off by choice |
| `xgimi-mogo-3-pro/` | XGIMI MoGo 3 Pro projector (G0035, altai, MediaTek) | Google TV 14 | Factory and burn-in tools, bug-report uploader, Google feedback, setupwraith, Ambient screensaver, Google preloads; keystone/autofocus/HDMI/MagiCast mirroring kept; XGIMI's remote keys re-enable the stock launcher, so it needs `app_keys` and `stock_home_redirect` (header) |
| `xgimi-mogo-2/` | XGIMI MoGo 2 projector (MoGo, xgimiapollo, pokemon) | Android TV 11 | Short list: XGIMI usage reporter and bug-report uploader, Google feedback, TED, XGIMI music; Chromecast, Smart Connect and the firmware updater off by choice; hardware services and voice kept; Netflix's TV app refuses this model (the regular Android app runs); about a day of use, rebooted twice |
-| `xiaomi-mi-box-s/` | Xiaomi Mi Box S (MIBOX4, oneday), streaming box | Android TV 9 | PatchWall, Mi analytics, Alphonso ad tracking, MiLink; voice, casting, phone remote off by choice |
+| `xiaomi-mi-box-s/` | Xiaomi Mi Box S (MIBOX4, oneday), streaming box | Android TV 9 | PatchWall, Mi analytics, Alphonso ad tracking, MiLink; voice, casting, phone remote off by choice; second unit: Apps button opens Home with HomeKeyService; [notes](../docs/devices/xiaomi-mi-box-s.md) |
| `xiaomi-mi-box-s-2nd-gen/` | Xiaomi Mi Box S 2nd gen (MiTV-AFKR0, jaws), streaming box | Google TV 11 | Mi ad row and PatchWall, Mi analytics, partner auto-installs, update service off by choice; setup wizard off for the launcher, Wi-Fi password re-entry note |
| `xiaomi-mitv-mooq0/` | Xiaomi Mi TV (MiTV-MOOQ0, croods) | Android TV 10 | PatchWall, Mi analytics, MiChannel, TV Manager, Alexa bridge; factory test app also claims HOME; notes from #81 |
| `xiaomi-mi-tv-4a/` | Xiaomi Mi TV 4A (MiTV-MOOQ1) | Android TV 10 | PatchWall, Mi analytics, SmartShare, MiLink |
diff --git a/examples/xiaomi-mi-box-s/debloat.txt b/examples/xiaomi-mi-box-s/debloat.txt
index 596450bcf..d8878fff5 100644
--- a/examples/xiaomi-mi-box-s/debloat.txt
+++ b/examples/xiaomi-mi-box-s/debloat.txt
@@ -25,6 +25,14 @@
# - Survives a reboot: nothing is re-enabled at boot, the launcher stays Home. Free RAM after boot went from
# about 770 MB to 1.15 GB.
# - A process of the disabled stock launcher can linger until the next reboot; `am force-stop` clears it.
+#
+# Second unit (same PI.3933 build), 2026-10-21. Details: docs/devices/xiaomi-mi-box-s.md
+# - Every package below was present and disabled cleanly; nothing was re-enabled after a reboot.
+# - Nothing was disabled beforehand: the "already disabled" apps at the bottom were all enabled there.
+# Google Play Music (com.google.android.music, closed in 2020) was installed too.
+# - 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.
# Xiaomi + Google telemetry and ad tracking
com.miui.tv.analytics # Mi analytics: reads logs and app usage
@@ -68,6 +76,7 @@ com.google.android.backdrop
# com.google.android.videos # Play Movies & TV
# com.google.android.play.games
# com.android.camera2
+# com.google.android.music # Google Play Music, service closed in 2020 (second unit only)
# Stock Google TV launcher, replaced by launcher/
com.google.android.tvlauncher