Repository navigation
Description
TV: Xiaomi MiTV-MOOR2 (device venom, MediaTek), Google TV on Android 11 (SDK 30), build RTM5.220609.003.2674. Stock launcher com.google.android.apps.tv.launcherx.
Debloat and launcher both work on this set, but on this Google TV firmware the Home button only reached the new launcher after one extra package was disabled. Details below in case they help the prompt, the scripts or examples/.
Connection
USB debugging on → plain ADB on port 5555 works with tools/tv.py (no pairing / STLS on this firmware).
Debloat (applied today, not lived with for days yet)
Disabled with pm disable-user, nothing broke so far: com.miui.tv.analytics, com.xiaomi.statistic, com.xm.webcontent, android.autoinstalls.config.xiaomi.amelie, fusion.android.tv.demo, com.mitv.tvhome.atv, com.mitv.tvhome.oemtab, com.mitv.tvhome.michannel, com.mitv.tvhome.mitvplus, com.xiaomi.mitv.tvmanager, com.xiaomi.mimusic2, com.mitv.gallery, com.google.android.feedback, com.google.android.play.games, com.xiaomi.mitv.smartshare, com.xiaomi.wfdsinkhelperservice, and com.google.android.apps.tv.dreamx (with the clock screensaver).
Kept on purpose: Chromecast (mediashell), voice (katniss), com.google.android.tv.remote.service, com.google.android.videos, com.xiaomi.mitv.updateservice, Live TV. I'll open a PR for examples/xiaomi-mitv-moor2/ after living with it for a few days, as CONTRIBUTING asks.
Launcher: Home needs setupwraith disabled too
- The debug APK (targetSdk 29) installs fine on this Google TV 11.
cmd package set-home-activity --user 0 com.gathin.tvhome→Success, but HOME still resolves tolauncherx(priority 2).- After
pm disable-user --user 0 com.google.android.apps.tv.launcherx, HOME resolves tocom.google.android.tungsten.setupwraith/.RecoveryActivity(priority 1), not to the launcher (priority 0). Pressing Home would land in Google's setup recovery. - Only after also
pm disable-user --user 0 com.google.android.tungsten.setupwraithdoes HOME resolve tocom.gathin.tvhome/.MainActivity. - Suggestions:
- (a) Have
build-and-installruncmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.HOMEafter disabling the stock launcher, and re-enable it if HOME doesn't resolve tocom.gathin.tvhome. - (b) Mention
setupwraithfor launcherx firmwares in the prompt / Google TV examples, and addpm enable com.google.android.tungsten.setupwraithto the restore.
- (a) Have
- As community reports warn, the remote's YouTube button stopped working. See the next section for the cause and a fix.
Remote app buttons (Xiaomi remote)
The community warning about the YouTube button held on this set:
- YouTube button sends
KEYCODE_BUTTON_3(190). Withlauncherxdisabled nothing handles it, so the press reaches the foreground app and is ignored. The enabledGLOBAL_BUTTONreceivers (MediaTekGlobalKeyReceiver,NetflixKeyReceiver, Xiaomipartnercustomizer) don't take it. - Mi / PatchWall button sends
KEYCODE_BUTTON_5(192). Xiaomi's window policy (MiTVWindowPolicyInjector) handles it ininterceptKeyBeforeQueueingand always startscom.mitv.livetv. That runs before any input filter, so it can't be suppressed. - App button sends
KEYCODE_ALL_APPS(284). On leanback,PhoneWindowManagersendsACTION_ALL_APPSrestricted to the system home app (MATCH_SYSTEM_ONLY). Withlauncherxdisabled no activity handles it, so anALL_APPSintent-filter in the launcher wouldn't help, because it isn't a system app. Consuming the key and startingMainActivityworks. - The Netflix button keeps working: MediaTek handles it.
Fix, the same pattern as #27: a small AccessibilityService that consumes only mapped keys and starts an app on ACTION_UP.
-
KEYCODE_BUTTON_3→com.google.android.youtube.tv. -
KEYCODE_BUTTON_5→ an app of choice. Here that's the provider's TV app, started 700 ms later so it lands on top of the firmware's Live TV start. -
KEYCODE_ALL_APPS→ the launcher'sMainActivity.
Tested with the physical remote: all three work from Home and from inside other apps. Generalising #27's service into a keycode → package table, with the table in config.xml, would cover both cases.
Also works
- Clock screensaver (
screensaver_components→com.gathin.tvhome/.ClockDream). - Third-party overlay apps keep working on top of the new launcher. The "Notifications for Android TV" pop-ups (text + image) from Home Assistant display fine.
Windows build notes
- New Android command-line tools (cmdline-tools 23.0, build 16111833):
sdkmanager.batnow forwards to the newandroidCLI.- The
"platforms;android-34" "build-tools;34.0.0"form from CONTRIBUTING fails with "Package platforms not found": the batch wrapper splits on;. - What works is
android sdk install platforms/android-34 build-tools/34.0.0.
- The
- Git Bash: calling
tools/b64push.py … /data/local/tmp/tvhome.apkdirectly gets the remote path rewritten by MSYS (can't create C:/Program …).MSYS_NO_PATHCONV=1fixes it. - Gradle wrapper:
gradle/wrapper/gradle-wrapper.jarmatches Gradle 9.8.1's published wrapper checksum, whilegradle-wrapper.propertiespins 8.9. That's harmless, but someone verifying against the 8.9 checksum will see a mismatch. - Probably machine-specific: on one Windows 11 PC, Java NIO pipes failed with "Unable to establish loopback connection" (AF_UNIX
connect: Invalid argument), for both the Android CLI's bundled JRE and Temurin 17. Pointing the socket dir elsewhere fixed sdkmanager and Gradle:JAVA_TOOL_OPTIONS=-Djdk.net.unixdomain.tmpdir=C:\jt.
Thanks for the project. The new home screen is a big improvement over the ad rows.
Activity
Shield list: confirm the Home handover, leave setupwraith alone
Gradle wrapper jar matches the pinned 8.9; sdkmanager syntax for new …
Gathin23 commentedon Oct 19, 2026
Thanks for this write-up, it was the clearest of the batch. Where things stand: the MOOR2 list arrived as #65 from another contributor and is merged, along with the README explanation of setupwraith; the install order and post-switch check you suggested went in with #91 and #85. Your key analysis shaped the direction too: #83 added an opt-in accessibility service that routes KEYCODE_ALL_APPS to the launcher, #27 one for the Input button, and the plan is to fold them into a single config-driven key table like you proposed, which would cover the YouTube button as well. Your Windows notes were acted on: the sdkmanager syntax is in README and CONTRIBUTING, and the wrapper jar now matches Gradle 8.9 (38b65eb). Closing this one; a PR for the key table would be very welcome.