# Xiaomi TV Stick 4K 2nd gen (MiTV-AFMU1, codename twilight, product adastra, Amlogic), Google TV 14 (SDK 34),
# firmware UKG3.250826.001 / V816.0.7.0.UZFAATK. 1.9 GB RAM; /system is full (100%), so nothing frees there.
# Fingerprint: Xiaomi/adastra/twilight:14/UKG3.250826.001/V816.0.7.0.UZFAATK:user/release-keys
#
# One list from two owners (#740 and #749) who reported the same stick: same board, product and firmware.
# Everything below was disabled on at least one of those units; where only one disabled it, or where the two
# chose differently, the line says so. Both ran it for a day, in batches with a reboot in between, so treat
# the package set as provisional (CONTRIBUTING.md) until it has been used for a few days.
#
# Apply:   TV_HOST=<stick ip> tools/disable.sh examples/xiaomi-mitv-afmu1/debloat.txt
# Undo:    TV_HOST=<stick ip> tools/restore.sh examples/xiaomi-mitv-afmu1/debloat.txt com.google.android.apps.tv.launcherx
# Everything is DISABLED, not uninstalled. Comment out any line you want to keep.
#
# A streaming stick: no HDMI-in or tuner, so leave live_tv_package empty in config.xml.
# Stock launcher: com.google.android.apps.tv.launcherx (build-and-install.sh disables it after Home moves).
#
# Notes from these sticks:
# - Shares the twilight board with the Xiaomi TV Box S 3rd gen (MiTV-AFMU0), but the product is adastra and
#   Xiaomi's local media apps (mimusic2, mediaexplorer, mitv.gallery) are not installed.
# - setupwraith's RecoveryActivity (HOME priority 1, launcherx priority 2) takes Home once launcherx is off,
#   so setupwraith has to go too, and it has to go FIRST. Re-enable setupwraith to re-pair the remote.
# - Disabling setupwraith takes the stick off Wi-Fi if the network was saved during first setup: that network
#   belongs to setupwraith, and Android deletes it with the app. Forget the network and join it again in
#   Settings > Network & Internet first; the re-joined network belongs to android.uid.system and survives
#   disabling launcherx and setupwraith.
#   Check before disabling: tools/tv.py "dumpsys wifi" | grep -o 'cname=[^ ]*'
# - Already disabled by the firmware before any change (not listed): Netflix, Prime Video, Mi channels
#   (michannel, atv), Google calendar sync, partner setup, Talkback, Health Connect controller.
#   Removed for user 0 by the firmware after the first reboot (not listed): YouTube Music and Mi Plus.
# - Wireless debugging (port 41817, TLS) is not supported by tools/tv.py; use USB debugging on port 5555.
#   Network debugging was off after a reboot on one unit (seen once); re-enable it before running the tools.
# - Keeping on purpose: Google Play Store, Play Services, TV input and remote services, Bluetooth, Droidlogic.
# - Leave alone: com.xiaomi.android.tvsetup.partnercustomizer, mitv.service, com.droidlogic*, and the YouTube
#   app (com.google.android.youtube.tv stays enabled on both units).
#
# A third unit, same firmware, applied this list with Chromecast kept and then the launcher installed:
# - Netflix (com.netflix.ninja), YouTube Music and partner setup were enabled at the start, not off at the
#   firmware level as above; Netflix ran in the background at about 89 MB PSS.
# - setupwraith owned one saved network, an old one; the network in use belonged to android.uid.system.
#   `tools/tv.py "cmd wifi list-networks"` lists the saved networks in the same order as the cname= lines
#   above, so the two together show which network goes. Only that old network was lost.
# - The remote's YouTube, Netflix and Prime Video buttons do nothing once launcherx is off. They send
#   KEYCODE_BUTTON_3, BUTTON_6 and BUTTON_7 (Vendor_2717_Product_32b9.kl); 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 returned to the new launcher without HOME_KEY_SERVICE.
# - com.google.android.youtube.tv.recommendations shows up in dumpsys meminfo, but it is a process of the
#   YouTube app, not a package: pm disable-user answers "Unknown package".
# - partnercustomizer and partnersetup were disabled here for a day and one reboot with nothing missing
#   (Home, Wi-Fi, the remote and the key helper all came back); the lines are commented out below.
#
# Kept by choice - the two units disagreed here. One kept all of these, the other disabled them and saw no
# problem; uncomment the ones you are happy to lose. The Assistant line costs voice search, and the four after
# it cost casting (Chromecast, Miracast and Mi Connect; phone casting was not tested on the second unit).
# com.google.android.katniss            # Google Assistant voice search
# com.google.android.apps.mediashell    # Chromecast built-in
# com.xiaomi.mitv.smartshare            # Xiaomi screen share
# com.xiaomi.wfdsinkhelperservice       # Miracast sink helper
# com.xiaomi.mi_connect_service         # Mi Connect
# com.google.android.tv.remote.service  # phone remote
# com.google.android.apps.tv.dreamx     # Google ambient screensaver (switch to the Clock dream first)
#
# Streaming apps, kept enabled: uncomment the ones you never use (Netflix and Prime Video are already off at
# the firmware level on this build).
# com.netflix.ninja
# com.google.android.youtube.tv        # stays enabled on both units
# com.amazon.amazonvideo.livingroom

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

# Ad personalisation (Privacy Sandbox and on-device ad services): one unit only
com.android.adservices.api
com.android.ondevicepersonalization.services
com.android.federatedcompute.services

# PatchWall, content rows, promos, auto-installs
com.mitv.tvhome.atv                    # one unit only; already off at the firmware level on the other
com.mitv.tvhome.michannel              # one unit only; already off at the firmware level on the other
com.mitv.tvhome.mitvplus               # one unit only
com.mitv.tvhome.oemtab
com.xm.webcontent                      # Xiaomi promo web pages
android.autoinstalls.config.soc.amlogic # Amlogic partner auto-installs

# Preloaded apps and services not needed on a stick
com.google.android.youtube.tvmusic     # one unit only; the firmware removed it for user 0 after the first reboot
com.google.android.play.games
com.google.android.marvin.talkback     # one unit only; already off at the firmware level on the other
com.mitv.videoplayer                   # Mi video player
com.android.printspooler               # printing
com.netflix.tokenmanager               # Netflix sign-in token, Netflix itself is already off
com.android.providers.contacts         # contacts, nothing on a TV uses it
com.android.health.connect.backuprestore
# com.xiaomi.mitv.updateservice        # kept: firmware updates. One owner disabled it (no updates were offered); uncomment to do the same
# com.xiaomi.android.tvsetup.partnercustomizer # third unit only, one day: Xiaomi first-run wizard and region pages (see "Leave alone" above)
# com.google.android.partnersetup      # third unit only, one day: Google partner setup, RLZ install ping

# Stock launcher and setup wizard, replaced by launcher/ (see notes above)
com.google.android.apps.tv.launcherx    # build-and-install.sh also disables it, after Home has moved
com.google.android.tungsten.setupwraith
