Skip to content

Repository files navigation

📺 Android TV & Xiaomi / Redmi TV Optimization Suite

Python Version License: MIT Platform Root Required

A non-root, automated ADB utility to debloat, privacy-harden, accelerate, and tune Xiaomi, Redmi, and generic Android TV / Google TV devices.

Tip

Looking for Samsung device optimizations? Check out:


🌟 Highlights

  • 🗑️ Safe Debloating: Disables 20+ intrusive OEM telemetry, tracking, demo, and PatchWall services for user 0 (100% reversible without root).
  • 🛡️ Privacy & Anti-Telemetry Hardening: Disables automated crash dumps, background diagnostic reporting, and personalized ad tracking IDs.
  • 📶 Wi-Fi Standby & 15-min Doze Disconnect Fix: Resolves the common Android TV bug where Wi-Fi drops after 15 minutes of inactivity due to Android Doze mode and aggressive Wi-Fi chip sleep.
  • 🛑 Ad-Blocking via Private DNS (DNS-over-TLS): Configures system-wide encrypted DNS (NextDNS, AdGuard, Cloudflare) to block network-level ads and trackers across all apps.
  • ⚡ Snappy UI Performance: Accelerates system animations to 0.5x for responsive navigation.
  • 🔊 Soundbar & Picture Calibration: Configures uncompressed HDMI-ARC bitstream audio, eliminates remote click latency, and removes artificial MEMC motion smoothing (Soap Opera Effect).
  • 🏠 Clean Launcher Setup: Seamlessly configures Projectivy Launcher as the default ad-free home screen.
  • 🔒 Tailscale Anti-Doze: Whitelists Tailscale from Android battery optimization to maintain persistent mesh VPN connections.
  • 🧹 Storage Cache Purge: Deep trims system cache and purges gigabytes of temporary streaming data.

📋 Prerequisites

  1. Enable Developer Options on TV:
    • Go to Settings $\rightarrow$ Device Preferences $\rightarrow$ About.
    • Click Build 7 times until you see "You are now a developer!".
  2. Enable USB / Network Debugging:
    • Go to Settings $\rightarrow$ Device Preferences $\rightarrow$ Developer options.
    • Turn ON USB debugging / Network debugging.
  3. Find your TV's IP Address:
    • Go to Settings $\rightarrow$ Network & Internet $\rightarrow$ select your connected Wi-Fi/Ethernet network.

🚀 Usage

1. Interactive Control Panel

Run the interactive menu to select specific tweaks or inspect device health:

python3 optimize_tv.py

2. 1-Click Complete Auto-Optimization

Execute all optimizations in unattended mode:

python3 optimize_tv.py --auto <TV_IP>

(Example: python3 optimize_tv.py --auto 192.168.1.50)

3. Individual CLI Modes

# Debloat bloatware packages only
python3 optimize_tv.py --debloat

# Purge streaming app caches & temp files
python3 optimize_tv.py --clean

# Configure system-wide Private DNS (AdGuard / NextDNS placeholder)
python3 optimize_tv.py --dns <YOUR_PROFILE_ID>.dns.nextdns.io
# Or using AdGuard:
python3 optimize_tv.py --dns dns.adguard-dns.com
# To disable Private DNS:
python3 optimize_tv.py --dns off

# Boost UI animation scale (0.5x), cap background processes & apply Wi-Fi sleep fixes
python3 optimize_tv.py --speed

# Pair over Wi-Fi debugging (Android 11+ / Google TV)
python3 optimize_tv.py --pair <IP:PORT> <PAIRING_CODE>

# 1-Click Complete Restore (Restore all uninstalled stock apps, power timeouts & settings)
python3 optimize_tv.py --restore

📦 What Gets Optimized?

1. Debloated Packages (Reversible)

Click to view debloated packages list
Package Name Category Purpose
com.miui.tv.analytics Telemetry Xiaomi MIUI TV Analytics Engine
com.xiaomi.statistic Telemetry Xiaomi Background Statistics Service
com.google.android.feedback Telemetry Google Feedback Reporter
com.google.android.tv.bugreportsender Telemetry TV Bug Report Sender
android.autoinstalls.config.xiaomi.amelie Bloatware Xiaomi Partner Auto-Installer
com.xiaomi.floatingframe Bloatware Promotional Overlay Frame
com.duokan.factorytest Bloatware Factory Diagnostic Leftovers
fusion.android.tv.demo Bloatware Retail Demo Mode
com.mitv.tvhome.atv PatchWall PatchWall Launcher ATV Service
com.mitv.tvhome.mitvplus PatchWall Mi TV+ Sponsored Channels
com.mitv.tvhome.michannel PatchWall Mi Channels Service
com.xiaomi.mimusic2 Bloatware Stock Mi Music Player
com.mitv.gallery Bloatware Stock Mi Gallery
com.mitv.videoplayer Bloatware Stock Mi Video Player
com.xiaomi.mitv.tvmanager Bloatware Mi TV Manager RAM Booster
com.xiaomi.mitv.mediaexplorer Bloatware Stock File Explorer
com.xiaomi.mitv.smartshare Bloatware Redundant Screen Mirroring Service
com.google.android.tvrecommendations Ads Sponsored Home Row Recommendation Ads
com.google.android.marvin.talkback Accessibility Background Screen Reader Service
com.android.printspooler Utility Android Print Spooler (Unneeded on TV)

2. Wi-Fi Standby & 15-Minute Sleep Fixes

  • stay_on_while_plugged_in = 3 (Prevents Doze mode from shutting down networking while on AC)
  • screen_off_timeout = 1800000 (Extends inactivity timeout to 30 mins to prevent 15-minute Doze drops)
  • wifi_sleep_policy = 2 (Never disconnect Wi-Fi during standby)
  • wifi_power_save = 0 (Disable aggressive radio power throttling)
  • wifi_suspend_optimizations_enabled = 0 (Prevent Wi-Fi driver suspend freeze)
  • network_wow = 1 (Wake-on-Wireless)
  • network_wol = 1 (Wake-on-LAN)
  • wifi_max_dhcp_retry_count = 5 (Automatic DHCP re-acquisition on wake)
  • ntp_server = time.google.com (Reliable clock sync to prevent SSL/cert timeouts)

3. Private DNS (DNS-over-TLS)

  • private_dns_mode = hostname
  • private_dns_specifier = <YOUR_PROFILE_ID>.dns.nextdns.io or dns.adguard-dns.com

4. Audio & Picture Enhancements

  • sound_effects_enabled = 0 (Eliminates UI click audio stream downsampling & soundbar pops)
  • tv_input_hdmi_edid_version = 1 (Enables HDMI 2.0 Enhanced EDID)
  • tv_picture_advance_video_mjc_effect = 0 (Disables MEMC / Soap Opera Effect)
  • tv_picture_advance_video_mpeg_nr = 0 (Disables MPEG texture smudging)
  • tv_picture_advance_video_dnr = 0 (Disables Digital Noise Reduction blur)
  • tv_picture_video_blue_stretch = 0 (Restores natural color temperature)
  • tv_picture_video_di_film_mode = 1 (Enables 24 FPS Film Mode Cadence)

🔒 Privacy Guarantee

  • No Root Required: All uninstalls are performed via pm uninstall -k --user 0 and can be restored anytime with cmd package install-existing.
  • Zero Identifiers: This repository contains no hardcoded private IP addresses, device serial numbers, or user-specific DNS tokens.

📄 License

This project is licensed under the MIT License.

About

Android TV Optimizer

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages