# Xiaomi TV Box S 3rd gen (MiTV-AFMU0, codename twilight, Amlogic), Google TV on Android 14 (SDK 34),
# firmware UKG3.250826.001 / V816.0.11.0.UZFAABX.
# Fingerprint: Xiaomi/twilight/twilight:14/UKG3.250826.001/V816.0.11.0.UZFAABX:user/release-keys
#
# Apply:   TV_HOST=<box ip> tools/disable.sh examples/xiaomi-mitv-afmu0/debloat.txt
# Undo:    TV_HOST=<box ip> tools/restore.sh examples/xiaomi-mitv-afmu0/debloat.txt com.google.android.apps.tv.launcherx
# Everything is DISABLED, not uninstalled.
# Tested for one evening so far (Home, grid, D-pad, dock apps) and across one reboot: the disabled list and the
# default home survive it. Not lived with for days yet.
#
# Notes from this box:
# - The stock home is com.google.android.apps.tv.launcherx. launcher/build-and-install.sh disables it.
# - setupwraith's RecoveryActivity (HOME priority 1, launcherx 2, a sideloaded launcher 0) takes Home once
#   launcherx is off, so setupwraith has to go too, and it has to go FIRST. Redone in that order (setupwraith,
#   then launcherx), Home went straight to the new launcher. This is the same crash-loop xiaomi-tv-a-pro-2026
#   describes. Re-enable setupwraith to re-pair the remote.
# - Disabling setupwraith takes the box off Wi-Fi in either order if the network was saved during first setup:
#   that network belongs to setupwraith, and Android deletes it with the app. The first run here most likely lost
#   Wi-Fi this way; the redo stayed online because the network had been re-joined by hand in between. Seen on a
#   second box (V816.0.7.0.UZFAABX): disabling setupwraith alone, launcherx still Home, logged
#   "WifiConfigManager: Remove all networks for app ... setupwraith" and dropped Wi-Fi and ADB within a second.
#   The network re-joined in Settings is a new entry owned by android.uid.system and survived disabling
#   launcherx and dreamx. Check before disabling: tools/tv.py "dumpsys wifi" | grep -o 'cname=[^ ]*'
# - Leave alone: com.xiaomi.android.tvsetup.partnercustomizer, mitv.service, com.droidlogic*.
# - With the stock launcher gone, apps without a dock slot just appear in the grid.
#
# A second unit, same firmware (V816.0.11.0.UZFAABX), one evening and one reboot, applied this list with
# YouTube Music, Assistant, Chromecast, Miracast/Mi share and the updater kept, plus the Privacy Sandbox group below:
# - setupwraith owned no saved network here (every cname= was android.uid.system), so Wi-Fi and ADB stayed up.
# - After the reboot, `pm list packages -d` matched what was disabled: the firmware re-enabled nothing.
# - Wireless debugging leaves port 5555 open across reboots: switch off USB/Wireless debugging when done.
# - Remote (Vendor_2717_Product_32b9.kl): once launcherx is off, Netflix (BUTTON_6) still opens Netflix, but
#   YouTube (BUTTON_3, scan 425), Prime Video (BUTTON_7, scan 207), Xiaomi TV+ (BUTTON_5, scan 150) and Apps
#   (ALL_APPS, scan 216) do nothing. config.json in this folder maps them back with app_keys, which needs
#   INPUT_KEY_SERVICE=1 when running build-and-install.sh. The real Home button worked without HOME_KEY_SERVICE.
# - The volume buttons send IR to the TV: `getevent -lt` shows no event on the box while they are held, so a held
#   button not repeating is the TV's doing, with or without a key helper.
# - Remote shortcut keys (Vendor_2717_Product_32b9.kl): YouTube sends BUTTON_3 (scancode 425), Prime Video sends
#   BUTTON_7 (scancode 207), and Apps button sends ALL_APPS (scancode 216). Enable HomeKeyService
#   (settings put secure enabled_accessibility_services com.gathin.tvhome/.HomeKeyService) and push
#   examples/xiaomi-mitv-afmu0/theme/config.json with tools/theme.sh to restore YouTube, map Prime Video, and make
#   the Apps button open Home. See README.md.

# Telemetry and feedback
com.miui.tv.analytics
com.xiaomi.statistic
com.xiaomi.tvqs.overseas.y24           # Xiaomi quality-stats uploader
com.google.android.feedback
com.android.tv.feedbackconsent

# PatchWall, content rows, promos, auto-installs
com.mitv.tvhome.atv
com.mitv.tvhome.michannel
com.mitv.tvhome.mitvplus
com.mitv.tvhome.oemtab
com.xm.webcontent
android.autoinstalls.config.soc.amlogic

# Personal choice: voice assistant, phone remote, Mi cast/share (the mic button stops working)
# KEPT ON here, measured on firmware V816.0.7.0.UZFAABX on two units: the mic button does NOT come
# back by re-enabling katniss alone. com.google.android.tv.remote.service, listed below, is the
# Google TV bridge for the physical remote: with it off, the remote's Bluetooth microphone never
# reaches the assistant, so the button opens the Assistant and it records silence. Re-enable both
# (`pm enable com.google.android.katniss`, then `pm enable com.google.android.tv.remote.service`;
# one package per command) and the mic works.
# Left commented so check.py does not report drift and re-applying the list does not break it again.
# com.google.android.katniss
# com.google.android.tv.remote.service
com.xiaomi.mitv.smartshare
com.xiaomi.wfdsinkhelperservice
com.xiaomi.mi_connect_service

# Preloaded apps
com.disney.disneyplus
com.wbd.hbomax
com.google.android.youtube.tvmusic     # YouTube Music; the second unit kept it (in use)
com.google.android.play.games
com.google.android.marvin.talkback
com.xiaomi.mimusic2
com.xiaomi.mitv.mediaexplorer
com.mitv.videoplayer
com.android.printspooler
com.mitv.gallery

# Ad personalisation (Privacy Sandbox and on-device ad services): second unit only, as on xiaomi-mitv-afmu1 (provisional: one evening, one reboot)
# com.android.adservices.api
# com.android.ondevicepersonalization.services
# com.android.federatedcompute.services

# Personal choice: preloaded streaming apps, kept enabled here. Uncomment the ones you don't use
# com.netflix.ninja                    # Netflix
# com.google.android.youtube.tv        # YouTube
# com.amazon.amazonvideo.livingroom    # Prime Video

# Optional, uncomment if unused
# com.google.android.apps.tv.dreamx    # Google ambient screensaver (switch to the Clock dream first)

# Setup wizard, takes Home after the stock launcher is disabled
com.google.android.tungsten.setupwraith

# Stock Google TV launcher, replaced by launcher/ (build-and-install.sh disables it; listed so restore brings it back)
# com.google.android.apps.tv.launcherx   # launcher/build-and-install.sh disables the stock launcher itself, after Home has moved
