Skip to content

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

docs: the nemo/PatchWall firmware drops non-system HOME candidates (#2415)

xbshengd6d7e3967d7f
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md
index 7fd3a0ca2..e4061a4a1 100644
--- a/docs/TROUBLESHOOTING.md
+++ b/docs/TROUBLESHOOTING.md
@@ -486,6 +486,16 @@ Things that bit us or contributors, so they don't bite you. Commands use `tools/
`FallbackHome`. An opt-in application-ID build worked with the stock launcher still enabled;
see the [device notes and rollback steps](devices/xiaomi-mitv-aetp0-dofus.md). This is different
from a missing default-home picker or a remote that emits ALL_APPS.
+- **China-market Xiaomi refuses the new launcher as Home outright**, seen on a Laser Cinema 2 4K
+ (`nemo`, Android 9, firmware `2.1.3.4134`): `cmd package set-home-activity` answers `cannot be
+ home on user 0`, while the APK does declare `MAIN`/`HOME`/`DEFAULT` and is installed and enabled.
+ This firmware's `PackageManagerService.applyPostResolutionFilter` removes every HOME candidate that
+ is not `FLAG_SYSTEM` when `ro.formovie.launcher_type` is not `AndroidTV` (it reads `Patchwall`
+ here, and a shell `setprop` is refused), so this is a flag test rather than the package-name
+ allowlist above and the alternate application ID it accepted does not help. `query-activities -c
+ android.intent.category.HOME` lists only PatchWall and `FallbackHome`. Keep the stock launcher
+ enabled - disabling it leaves only `FallbackHome` - and see the
+ [device notes](devices/xiaomi-nemo-laser-cinema2.md) for the queries and the firmware code.
- **The new launcher still doesn't own Home** after the stock one is disabled, seen on Google TV
(Xiaomi MiTV-MOOR2). Another system app answers HOME: `com.google.android.tungsten.setupwraith`,
with `.MainActivity` at intent-filter priority 4 and `.RecoveryActivity` at priority 1. You
diff --git a/docs/devices/xiaomi-nemo-laser-cinema2.md b/docs/devices/xiaomi-nemo-laser-cinema2.md
new file mode 100644
index 000000000..291f456ef
--- /dev/null
+++ b/docs/devices/xiaomi-nemo-laser-cinema2.md
@@ -0,0 +1,143 @@
+# Xiaomi Laser Cinema 2 4K (`nemo`): the launcher installs, Home stays with PatchWall
+
+Report for [#2415](https://github.com/Gathin23/cleanyourtv/issues/2415), one unit, same-day checks plus
+a reboot. This is a device note, not a debloat list anyone should copy: the packages below are one
+owner's choices on one firmware build. The debloat half of a run works here; replacing Home does not,
+and the reason is in the firmware rather than in the launcher.
+
+## Device
+
+| Field | Observed value |
+|---|---|
+| Retail model | Xiaomi Laser Cinema 2 4K / `XMJGYY01FM` (China market, Formovie) |
+| `ro.product.manufacturer` / `ro.product.device` | `Formovie` / `nemo` |
+| Mi Home model | `fengmi.projector.l206j` |
+| `ro.board.platform` (as reported) | `m7642` |
+| Android / SDK | 9 / 28 |
+| Firmware | `2.1.3.4134` |
+| Build fingerprint | `Formovie/nemo/nemo:9/PPR2.180905.006.A1/2.1.3.4134:user/release-keys` |
+| Stock Home | `com.mitv.tvhome.pub/com.mitv.tvhome.MainActivityUserMode` (PatchWall) |
+| Launcher tested | versionName 3.1, versionCode 10, from `095b71ad93d99ea28d94d97b06385709d354b795`, built locally with `-PlauncherApplicationId=com.ts.launcher` |
+
+## The firmware drops non-system HOME candidates
+
+The launcher installs, opens and runs. It declares `MAIN` / `HOME` / `DEFAULT`, `pm list packages`
+shows it installed and enabled, and its application flags read `[ HAS_CODE ALLOW_CLEAR_USER_DATA ]`
+with no `SYSTEM` bit. The package manager then refuses to treat it as a Home app:
+
+```text
+$ adb shell cmd package query-activities --brief -a android.intent.action.MAIN -c android.intent.category.HOME
+2 activities found:
+ Activity #0:
+ priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=true
+ com.mitv.tvhome.pub/com.mitv.tvhome.MainActivityUserMode
+ Activity #1:
+ priority=-1000 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=true
+ com.android.tv.settings/.system.FallbackHome
+
+$ adb shell cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.HOME -n com.ts.launcher/com.gathin.tvhome.MainActivity
+No activity found
+
+$ adb shell cmd package resolve-activity --brief -a android.intent.action.MAIN -n com.ts.launcher/com.gathin.tvhome.MainActivity
+priority=0 preferredOrder=0 match=0x0 specificIndex=-1 isDefault=false
+com.ts.launcher/com.gathin.tvhome.MainActivity
+
+$ adb shell getprop ro.formovie.launcher_type
+Patchwall
+```
+
+Reading this set's `services.jar` (dexdump and JADX) found the equivalent of the following in
+`PackageManagerService.applyPostResolutionFilter()`, with branches and null checks that do not matter
+here left out:
+
+```text
+static final boolean LAUNCHER_IS_ANDROIDTV =
+ SystemProperties.get("ro.formovie.launcher_type", "AndroidTV")
+ .equals("AndroidTV");
+
+if (intent.hasCategory("android.intent.category.HOME")
+ && !LAUNCHER_IS_ANDROIDTV
+ && !info.activityInfo.applicationInfo.isSystemApp()) {
+ resolveInfos.remove(i);
+}
+```
+
+`framework.jar` confirms `isSystemApp()` tests `ApplicationInfo.FLAG_SYSTEM`. This particular HOME branch
+consults neither a package-name allowlist nor a Settings key, and the flag is read once when the class
+loads; on this unit the property is `Patchwall`, and even a shell `setprop` to the same value is refused.
+The `cannot be home on user 0` answer from `cmd package set-home-activity` comes later, in
+`setHomeActivity()`, once the requested component has already been dropped from the HOME candidates.
+
+`services.jar` SHA-256, for identifying this exact firmware artifact:
+`70e9cf977f2e9f7608ad0a646953ae1d13825981b9b5241a8bc1bc7db4c3d292`.
+
+What that means for a run on this set:
+
+- Keep `com.mitv.tvhome.pub` enabled. With PatchWall out of the candidate set only
+ `com.android.tv.settings/.system.FallbackHome` is left, and the Home guard in `tools/disable.sh` names
+ Home's owner for exactly this reason.
+- This is **not** the package-name allowlist recorded for MiTV-AETP0 in
+ [`xiaomi-mitv-aetp0-dofus.md`](xiaomi-mitv-aetp0-dofus.md) and in
+ [the troubleshooting page](../TROUBLESHOOTING.md#working-on-the-tv): a filter on `FLAG_SYSTEM` is not a
+ filter on a package name, so the alternate application ID used above (`com.ts.launcher`, the identity
+ that allowlist accepted) is not a HOME candidate on this build either. The same output without
+ `-c android.intent.category.HOME` is what makes the difference visible.
+- Nothing here is a launcher fault: the APK declares HOME and the request is refused before the choice
+ reaches the launcher.
+
+## What was tried locally, and why it is not a regression report
+
+The launcher configuration was customized for this set, and the owner later modified `HomeKeyService` in
+a device-local build (`stockHomeStays()` allowed on Android 9, and the explicit intent used while stock
+HOME stayed active omitted `CATEGORY_HOME`). That avoided the failed HOME launch, but the redirect still
+did not reliably reactivate when PatchWall came back to the foreground, and the accessibility helper is
+disabled again.
+
+These helper experiments are not an upstream regression and are not a fix for this firmware: the central
+finding above stands on the package-manager queries and on the firmware's own code alone. No root, no
+framework modification and no system-app installation was used, and there is no verified workaround to
+recommend from these tests.
+
+## Debloat on the same unit
+
+Twenty packages were disabled with `pm disable-user --user 0`, never uninstalled, with
+`com.mitv.tvhome.pub` left enabled. The disabled flags persisted after a reboot;
+
+```text
+com.miui.analytics
+com.formovie.devicestat
+com.mstar.android.media.tests
+com.xm.webcontent
+com.duokan.videodaily
+com.xiaomi.mitv.shoppub
+com.xiaomi.smarthome.tv
+cn.formovie.fengos.iot
+com.xiaomi.mitv.appstore.common
+com.xiaomi.mitv.pay
+com.xiaomi.mitv.payment
+com.xiaomi.mibox.gamecenter
+com.xiaomi.gamecenter.sdk.service.mibox
+com.xiaomi.tv.common.gallery
+cn.formovie.fengos.fdp.browser
+cn.formovie.fengos.usermanual
+com.formovie.userguide
+com.mitv.mivideoplayer
+com.android.printspooler
+com.fengmi.testsuite
+```
+
+Scope of that list: same-day checks plus one reboot, and `com.formovie.devicestat` still ran as a
+persistent system process afterwards. It is not a several-day validated list, and only the owner of the
+set can say which of these they still want off after living with it.
+
+## Test limits
+
+- The latest `main` was not tested on this set; the build above is from `095b71ad`.
+- Settings pages, input/source switching and sideloading were reported as behaving normally; the physical
+ remote's buttons were not checked against the launcher.
+- No OTA was observed, so whether an update changes `ro.formovie.launcher_type` (and with it the HOME
+ filter) is unknown.
+- The existing Formovie records are other products on other platforms — `MiProjM05` (`eva`, Amlogic,
+ [#928](https://github.com/Gathin23/cleanyourtv/pull/928)) and `Theater`/`hanlla` (Android TV 14,
+ [#1932](https://github.com/Gathin23/cleanyourtv/pull/1932)) — and none of them validates this
+ `nemo`/PatchWall build.
diff --git a/examples/README.md b/examples/README.md
index d80203a5a..ef909efbe 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -430,6 +430,7 @@ Notes for models that have no tested list yet live in [`docs/devices/`](../docs/
- [Sony BRAVIA 4K VH22 (EU firmware)](../docs/devices/sony-bravia-4k-vh22-settings-key.md), `BRAVIA_VH22`, Android 12 `STT2.230505.001.S136`: with `HomeKeyService` off so held Volume ramps, a keyboard-layout overlay maps the remote's Settings key to `CALENDAR` and a small provider app opens Settings; how the layout is selected through `app_process`, the boot-time remote gotcha and what it does not fix ([#1680](https://github.com/Gathin23/cleanyourtv/issues/1680)); no debloat list.
- [Dangbei DBBOXH3 (当贝盒子 H3)](../docs/devices/dangbei-dbboxh3.md) (`rk356x_box`, Rockchip, Android 11 `RD2A.211001.002`, stock `com.dangbei.leard.leradlauncher`): `com.dangbei.dbdownloadrefs` looks like a promo downloader and is a hard dependency of the vendor's `ProcessManagementService` inside `system_server` - disabled, the provider answers null, `forceStopPackages` iterates it unguarded and `system_server` dies on every Home press (four pids, one per press); the crash, the way back past the leftover `stopped` flag, and why the tools cannot refuse the name; no debloat list.
+- [Xiaomi Laser Cinema 2 4K](../docs/devices/xiaomi-nemo-laser-cinema2.md) (`XMJGYY01FM`, Formovie `nemo`, m7642, Android 9 firmware `2.1.3.4134`, China-market PatchWall): the launcher installs and opens but this firmware's `applyPostResolutionFilter` drops every HOME candidate that is not `FLAG_SYSTEM` while `ro.formovie.launcher_type` is `Patchwall`, so `set-home-activity` is refused with `cannot be home on user 0` and the alternate application ID that the MiTV-AETP0 allowlist accepts does not help either; keep PatchWall enabled (only `FallbackHome` is left otherwise), plus a same-day 20-package debloat set that survived one reboot; no validated debloat list.
To add your TV, see [CONTRIBUTING.md](../CONTRIBUTING.md). The quickest way to get a list is to
run the prompt in [PROMPT.md](../PROMPT.md) and copy the packages your assistant disabled.