Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.
Python adbadblockandroid-tvandroid-tv-launcherapple-tvbloatware-removalclaude-codedebloatfire-tvgoogle-tvlauncherprivacysmart-tvsony-braviatclvibe-codingxiaomi
Set home with a full component (Android 9); find JDK/SDK without Homebrew
Jatin-LeafLoans2a2cd65df930
diff --git a/README.md b/README.mdindex 7ab7c1b4a..2d98529ca 100644--- a/README.md+++ b/README.md@@ -60,6 +60,8 @@ TV_HOST=192.168.1.50 launcher/build-and-install.shNeeds JDK 17 and the Android SDK (platform 34, build-tools 34.0.0). On macOS:`brew install openjdk@17 android-commandlinetools && sdkmanager "platforms;android-34" "build-tools;34.0.0"`.+Without Homebrew, the script also finds a JDK 17 known to `/usr/libexec/java_home` and an SDK in+`~/Library/Android/sdk` (Android Studio's default).## Talking to the TV by handdiff --git a/launcher/build-and-install.sh b/launcher/build-and-install.shindex 00fbbe8e6..b09691352 100755--- a/launcher/build-and-install.sh+++ b/launcher/build-and-install.sh@@ -4,8 +4,8 @@ set -euo pipefailcd "$(dirname "$0")": "${TV_HOST:?set TV_HOST to the TV IP address, e.g. TV_HOST=192.168.1.50 $0}"STOCK_LAUNCHER="${STOCK_LAUNCHER:-com.google.android.tvlauncher}"-export JAVA_HOME="${JAVA_HOME:-/opt/homebrew/opt/openjdk@17}"-export ANDROID_HOME="${ANDROID_HOME:-/opt/homebrew/share/android-commandlinetools}"+export JAVA_HOME="${JAVA_HOME:-$(/usr/libexec/java_home -v 17 2>/dev/null || echo /opt/homebrew/opt/openjdk@17)}"+export ANDROID_HOME="${ANDROID_HOME:-$([ -d ~/Library/Android/sdk ] && echo ~/Library/Android/sdk || echo /opt/homebrew/share/android-commandlinetools)}"export PATH="$JAVA_HOME/bin:$PATH"[ -f local.properties ] || echo "sdk.dir=$ANDROID_HOME" > local.properties./gradlew assembleDebug -q --console=plain@@ -16,7 +16,7 @@ printf '%s\n' \"pm install -r /data/local/tmp/tvhome.apk" \"rm -f /data/local/tmp/tvhome.apk" \"pm grant com.gathin.tvhome android.permission.ACCESS_FINE_LOCATION 2>/dev/null; echo location-granted" \- "cmd package set-home-activity --user 0 com.gathin.tvhome" \+ "cmd package set-home-activity --user 0 com.gathin.tvhome/.MainActivity" \"pm disable-user --user 0 $STOCK_LAUNCHER" \| "$PY" -I ../tools/tv.py --batchecho "Installed. Press Home on the remote to see it."diff --git a/tools/restore.sh b/tools/restore.shindex 858304fda..e4a8f6856 100755--- a/tools/restore.sh+++ b/tools/restore.sh@@ -11,7 +11,8 @@ PY=tools/venv/bin/python{grep -vE '^\s*(#|$)' "$LIST" | sed -E 's/\s+#.*$//' | awk '{print "pm enable " $1}'echo "pm enable $STOCK"- echo "cmd package set-home-activity --user 0 $STOCK"+ # resolve the stock HOME component on the TV (Android 9 needs pkg/activity, not just pkg)+ echo "cmd package set-home-activity --user 0 \$(cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.HOME $STOCK | tail -n 1)"echo "settings put global window_animation_scale 1.0"echo "settings put global transition_animation_scale 1.0"echo "settings put global animator_duration_scale 1.0"