8000 Xiaomi MiTV-MOOR2 (Google TV, Android 11): works; Home needs setupwraith disabled, remote app buttons need a key service · Issue #53 · Gathin23/cleanyourtv · GitHub
[go: up one dir, main page]

Skip to content
8000

Xiaomi MiTV-MOOR2 (Google TV, Android 11): works; Home needs setupwraith disabled, remote app buttons need a key service #53

Closed

Description

@buhito81

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 to launcherx (priority 2).
  • After pm disable-user --user 0 com.google.android.apps.tv.launcherx, HOME resolves to com.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.setupwraith does HOME resolve to com.gathin.tvhome/.MainActivity.
  • Suggestions:
    • (a) Have build-and-install run cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.HOME after disabling the stock launcher, and re-enable it if HOME doesn't resolve to com.gathin.tvhome.
    • (b) Mention setupwraith for launcherx firmwares in the prompt / Google TV examples, and add pm enable com.google.android.tungsten.setupwraith to the restore.
  • 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). With launcherx disabled nothing handles it, so the press reaches the foreground app and is ignored. The enabled GLOBAL_BUTTON receivers (MediaTek GlobalKeyReceiver, NetflixKeyReceiver, Xiaomi partnercustomizer) don't take it.
  • Mi / PatchWall button sends KEYCODE_BUTTON_5 (192). Xiaomi's window policy (MiTVWindowPolicyInjector) handles it in interceptKeyBeforeQueueing and always starts com.mitv.livetv. That runs before any input filter, so it can't be suppressed.
  • App button sends KEYCODE_ALL_APPS (284). On leanback, PhoneWindowManager sends ACTION_ALL_APPS restricted to the system home app (MATCH_SYSTEM_ONLY). With launcherx disabled no activity handles it, so an ALL_APPS intent-filter in the launcher wouldn't help, because it isn't a system app. Consuming the key and starting MainActivity works.
  • 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's MainActivity.

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

  1. New Android command-line tools (cmdline-tools 23.0, build 16111833): sdkmanager.bat now forwards to the new android CLI.
    • 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.
  2. Git Bash: calling tools/b64push.py … /data/local/tmp/tvhome.apk directly gets the remote path rewritten by MSYS (can't create C:/Program …). MSYS_NO_PATHCONV=1 fixes it.
  3. Gradle wrapper: gradle/wrapper/gradle-wrapper.jar matches Gradle 9.8.1's published wrapper checksum, while gradle-wrapper.properties pins 8.9. That's harmless, but someone verifying against the 8.9 checksum will see a mismatch.
  4. 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

  1. Gathin23 commented on Oct 19, 2026

    @Gathin23
    Owner

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0