Skip to content

Instantly share code, notes, and snippets.

@justintime
Last active January 3, 2025 00:40
Show Gist options
  • Save justintime/b8354a57b1f266b8e82c480b2f013d68 to your computer and use it in GitHub Desktop.
Save justintime/b8354a57b1f266b8e82c480b2f013d68 to your computer and use it in GitHub Desktop.
TiVo Stream 4K Debloat + Setup Script

TiVo Stream 4K de-bloat and setup

Purpose

This will take a stock TS4K and debloat it of all the TiVo stuff that slows it down. It will also disable the Google Launcher in favor of Projectivy Launcher. Please don't use this if you don't know exactly what you're doing, I offer no support.

Taken mostly from this forum post

If you wish to disable automatic remote programming (you don't, it's awesome), please see this guide

Setup

  • Download the debloat.sh script from https://gist.github.com/justintime/b8354a57b1f266b8e82c480b2f013d68 to your local machine
  • Boot up the TiVo, join it to Wifi
  • Firmware updates will apply
  • Sign into Google
  • Turn off Location and "Help improve Android"
  • "No thanks" to "Search across all your TV apps, confirm "no thanks"
  • Install apps you want from Play Store, but uncheck TiviMate to install the old 4.7.0 version later
  • Have to sign into TiVo, but we'll disable any phoning home later
  • Skip all the preferences crap
  • Enable Developer Mode by going to Device Preferences --> About --> Build and click it a few times until it tells you that you are a "Developer".
  • Then go to Device Preferences --> Developer Options--> USB Debugging and enable this option.
  • Go to Network & Internet --> Available Networks and click your connected WiFi network to see what your Stream's IP address currently is.
  • Download and install adblink
  • In adblink enter your Stream's IP address in the "Ad Hoc IP" field.
  • Click "Connect". You might be prompted to accept the connection on the Stream itself - accept it and also remember the device if prompted. Note sometimes it seems to take 2 tries to connect.
  • In adblink, launch the File Manager and navigate the left pane to /data/local/tmp/ by selecting it from the dropdown and clicking "Go"
  • Click Push, then drag and drop the debloat.sh script you downloaded earlier into the push window, and click Push.
  • Close the File Manager window and then click "ADB Shell"
  • In the new shell window, run this command:
sh /data/local/tmp/debloat.sh
  • Follow the prompts in the script, but note that errors about packages not being installed are normal

Post-setup Configuration

Install these apps via the app store if you didn't do it as part of setup. Log into each:

  • Max
  • Prime
  • AppleTV
  • Downloader
  • Stremio
  • AirReceiver
  • CX File Explorer
  • Projectivy - restore settings from SMB share to "sync"

Sideload these apps:

  • Tivimate - 4.7.0.3 is Downloader code 366972 or use this link
    • Restore settings from SMB backup
  • SmartTube - get from GitHub or use Downloader code 79015 for beta

Button Mapping

Install "Button Mapper" from the App Store - the Netflix button can't be remapped :( - Under Add Buttons, remap the TiVo button (DVR) to Home - Remap Live button (5124) to Application -> Tivimate - Remap the O button (under the Back button, currently mapped to Home) to Application -> Stremio

Turn off USB Debugging

For security, and probably better performance, turn off USB debugging when done.

#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment