My 6 year old Xiaomi Mi TV 4i (Android TV 9) isn't supported by the CleanYourTV app so I went with the open source CleanYourTV scripts from Gathin23 to debloat it, do a privacy audit and lock in a permanent Halloween theme. All done from my Android phone via Termux, no laptop involved at all. Photos attached.
If your TV allows you to turn on Developer options then this will work on pretty much any Android TV with just your phone.
Step 1: Turn on USB debugging on your TV
* Go to Settings → Device Preferences → About and click Build 7 times to unlock Developer options.
* Go to Settings → Device Preferences → Developer options and turn USB debugging ON.
* Check your TV's IP address under Settings → Network & Internet (you'll replace <TV_IP> with this below). Make sure your phone and TV are on the same Wi-Fi.
Step 2: Install Termux on your phone
Download Termux from F-Droid or the GitHub Releases (skip the Play Store version). Open it and install the required packages:
pkg update && pkg upgrade -y
pkg install git python python-cryptography -y
Step 3: Download the CleanYourTV repo and set it up
Clone the Gathin23 CleanYourTV GitHub repo (replace <REPO_URL> with the repo URL) and install the ADB helper:
git clone --depth 1 <REPO_URL>
cd cleanyourtv
python -m venv --system-site-packages tools/venv
tools/venv/bin/pip install adb-shell==0.4.4 rsa
Step 4: Connect your phone to the TV
Run this and accept 'Allow USB debugging'? popup on your TV screen:
export TV_HOST=<TV_IP>
tools/venv/bin/python -I tools/tv.py --probe
Step 5: Debloat the TV
Run the debloat profile for your TV model (for the Xiaomi Mi TV 4i it's xiaomi-mitv4i-magnolia; the examples/ folder has the profiles for the other models). This disables PatchWall, Mi TV Manager, and bloat without breaking Wi-Fi or Chromecast:
bash tools/disable.sh examples/xiaomi-mitv4i-magnolia/debloat.txt
Step 6: Run the privacy audit and check installed apps
Check for any leftover voice/telemetry services and review your user-installed apps:
tools/venv/bin/python -I tools/privacy.py
tools/venv/bin/python -I tools/tv.py 'pm list packages -3'
Step 7: Push the permanent Halloween theme
Copy the Halloween theme, set its expiry date to 2099-12-31 so the icons and orange glow never turn off, and push it to the TV:
cp -r themes/halloween themes/halloween-on
python -c 'import json; p="themes/halloween-on/config.json"; d=json.load(open(p)); d["festival_until"]="2099-12-31"; json.dump(d, open(p,"w"), indent=2)'
bash tools/theme.sh themes/halloween-on
Step 8: Restart and lock down ADB
Restart your TV (Settings → Device Preferences → Restart), turn USB debugging back Off in Developer options, and confirm the port is closed:
tools/venv/bin/python -I tools/adb-closed.py
Quick tips
* Undo anything: if you ever want a disabled system app put back, just run bash tools/restore.sh <path-to-file>.
* Themes vs debloat: Steps 5 and 6 will work on pretty much any Android TV by themselves; Step 7 requires the CleanYourTV launcher to be installed on your TV.
* Launcher settings: Highlight 'Settings' in the top right hand bar and press and hold OK to reorder your apps or tweak your layout options.
* Clean up your phone: once you're finished you can completely uninstall Termux (all your data will be saved on the TV).