|
#!/bin/sh |
|
#################################################################### |
|
## use ADB push to copy this to /data/local/tmp/debloat.sh |
|
## and run it from ADB shell with `sh /data/local/tmp/debloat.sh` |
|
#################################################################### |
|
|
|
# Package Inventory |
|
# ---------------- |
|
# System and Services: |
|
# com.utsmta.app - MOTA app for device management |
|
# com.droidlogic.overlay - Amlogic system overlay |
|
# com.droidlogic.SubTitleService - Amlogic subtitle service |
|
# com.google.android.tvrecommendations - Android TV recommendations |
|
# com.google.android.tv - Android TV core app |
|
# com.google.android.tvlauncher - Android TV launcher |
|
# |
|
# TiVo Components: |
|
# com.tivo.tivoplusplayer - TiVo Plus streaming service |
|
# com.tivo.tvlaunchercustomization - TiVo launcher customization |
|
# com.tivo.atom - TiVo Stream app |
|
# com.nes.bugtracker - TiVo bug tracking service |
|
# com.nes.tvbugtracker - TiVo TV bug tracker |
|
# com.nes.tvglobalkeyhandler - TiVo remote control handler |
|
# com.nes.daemonservice - TiVo background service |
|
# com.nes.skywayclient - TiVo Skyway client service |
|
# com.limark.deviqcoreagent - Device IQ monitoring agent |
|
# |
|
# Streaming Services: |
|
# com.netflix.ninja - Netflix |
|
# com.sling - Sling TV |
|
# com.tubitv - Tubi TV |
|
# tv.pluto.android - Pluto TV |
|
# com.pluto.tv - Pluto TV (alternate package) |
|
# com.hulu.livingroomplus - Hulu |
|
# com.amazon.imdb.tv.android.app - Amazon Freevee |
|
# com.imdbtv.livingroom - Amazon Freevee (alternate package) |
|
# com.starz.starzplay - Starz |
|
# com.bydeluxe.d3.android.program.starz - Starz (alternate package) |
|
# |
|
# Google Services: |
|
# com.google.android.youtube.tv - YouTube TV |
|
# com.google.android.youtube.tvmusic - YouTube Music |
|
# com.google.android.youtube - YouTube mobile app |
|
# com.google.android.apps.youtube.tv - YouTube TV app |
|
# com.google.android.videos - Google Play Movies & TV |
|
# com.google.android.play.games - Google Play Games |
|
# com.google.android.tv.bugreportsender - Android TV bug reporter |
|
# |
|
# Additional Apps: |
|
# ar.tvplayer.tv - TiviMate IPTV player |
|
|
|
# Packages to uninstall |
|
UNINSTALL_PACKAGES="\ |
|
com.utsmta.app \ |
|
com.tivo.tivoplusplayer \ |
|
com.tivo.tvlaunchercustomization \ |
|
com.droidlogic.overlay \ |
|
com.nes.bugtracker \ |
|
com.nes.tvglobalkeyhandler \ |
|
com.nes.daemonservice \ |
|
com.nes.skywayclient \ |
|
com.droidlogic.SubTitleService \ |
|
com.limark.deviqcoreagent \ |
|
com.netflix.ninja \ |
|
com.sling \ |
|
com.tubitv \ |
|
tv.pluto.android \ |
|
com.hulu.livingroomplus \ |
|
com.amazon.imdb.tv.android.app \ |
|
com.imdbtv.livingroom \ |
|
com.pluto.tv \ |
|
com.starz.starzplay \ |
|
com.bydeluxe.d3.android.program.starz \ |
|
com.google.android.youtube.tv \ |
|
com.google.android.tv \ |
|
com.google.android.youtube.tvmusic \ |
|
com.google.android.videos \ |
|
com.google.android.play.games \ |
|
com.google.android.tvrecommendations \ |
|
com.nes.tvbugtracker \ |
|
com.google.android.tv.bugreportsender" |
|
|
|
# Disable these packages |
|
DISABLE_PACKAGES="\ |
|
com.tivo.atom \ |
|
com.google.android.tvlauncher" |
|
|
|
# Function to check and set device name |
|
check_device_name() { |
|
current_name=$(settings get global device_name) |
|
if [ "$current_name" = "TiVo Stream 4K" ] || [ -z "$current_name" ]; then |
|
echo "Device name is default. Please enter new device name:" |
|
read new_name |
|
settings put global device_name "$new_name" |
|
echo "Device name set to: $new_name" |
|
else |
|
echo "Device name already customized: $current_name" |
|
fi |
|
} |
|
|
|
# Function to set animation scales |
|
set_animation_scales() { |
|
echo "Setting animation scales to 0.5x..." |
|
settings put global window_animation_scale 0.5 |
|
settings put global transition_animation_scale 0.5 |
|
settings put global animator_duration_scale 0.5 |
|
} |
|
|
|
# Function to uninstall packages |
|
uninstall_packages() { |
|
echo "Uninstalling packages..." |
|
for package in $UNINSTALL_PACKAGES; do |
|
echo "Uninstalling $package" |
|
pm uninstall -k --user 0 "$package" |
|
done |
|
} |
|
|
|
# Function to disable packages |
|
disable_packages() { |
|
echo "Disabling packages..." |
|
for package in $DISABLE_PACKAGES; do |
|
echo "Disabling $package" |
|
pm disable-user --user 0 "$package" |
|
done |
|
} |
|
|
|
# Function to manage Play Store auto-update settings |
|
manage_updates() { |
|
mode=$1 |
|
if [ "$mode" = "disable" ]; then |
|
echo "Opening Play Store to disable auto-updates..." |
|
message="Please:\n1. Open Play Store settings menu\n2. Select 'Auto-update apps'\n3. Choose 'Don't auto-update apps'" |
|
else |
|
echo "Opening Play Store to re-enable auto-updates..." |
|
message="Please:\n1. Open Play Store settings menu\n2. Select 'Auto-update apps'\n3. Choose your preferred auto-update setting" |
|
fi |
|
|
|
am start com.android.vending |
|
echo "$message" |
|
echo "Press Enter when done" |
|
read dummy |
|
} |
|
|
|
# Function to disable updates |
|
disable_updates() { |
|
manage_updates "disable" |
|
} |
|
|
|
# Function to undo changes |
|
undo_changes() { |
|
echo "Restoring default settings..." |
|
|
|
# Reset animation scales |
|
settings put global window_animation_scale 1.0 |
|
settings put global transition_animation_scale 1.0 |
|
settings put global animator_duration_scale 1.0 |
|
|
|
# Re-enable disabled packages |
|
echo "Re-enabling disabled packages..." |
|
for package in $DISABLE_PACKAGES; do |
|
echo "Re-enabling $package" |
|
pm enable --user 0 "$package" |
|
done |
|
|
|
# Update Play Store settings |
|
manage_updates "enable" |
|
|
|
# Restore uninstalled packages |
|
echo "Attempting to restore uninstalled packages..." |
|
for package in $UNINSTALL_PACKAGES; do |
|
echo "Restoring $package" |
|
cmd package install-existing "$package" |
|
done |
|
} |
|
|
|
# Function to install projengmenu if needed |
|
install_projengmenu() { |
|
if ! pm list packages | grep -q "com.spocky.projengmenu"; then |
|
echo "Projector Engine Menu not found. Opening Play Store..." |
|
am start -a android.intent.action.VIEW -d "market://details?id=com.spocky.projengmenu" |
|
echo "Please install Projector Engine Menu" |
|
echo "Press Enter when installation is complete" |
|
read dummy |
|
else |
|
echo "Projector Engine Menu already installed." |
|
fi |
|
} |
|
|
|
# Main execution with argument handling |
|
case "$1" in |
|
"undo") |
|
echo "Starting undo process..." |
|
undo_changes |
|
;; |
|
*) |
|
echo "Starting TiVo Stream 4K debloat script..." |
|
check_device_name |
|
set_animation_scales |
|
uninstall_packages |
|
disable_packages |
|
disable_updates |
|
install_projengmenu |
|
echo "Debloat process completed." |
|
echo "Would you like to reboot now? (y/n)" |
|
read answer |
|
case "$answer" in |
|
y|Y) |
|
echo "Rebooting..." |
|
reboot |
|
;; |
|
*) |
|
echo "Skipping reboot." |
|
;; |
|
esac |
|
;; |
|
esac |