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
maintainer-bot: the review job runs only in this repository, so forks don't show a red check (#2032)
Gathin239721c7296da6
diff --git a/.github/workflows/maintainer-bot.yml b/.github/workflows/maintainer-bot.ymlindex 24f49a38b..845806e90 100644--- a/.github/workflows/maintainer-bot.yml+++ b/.github/workflows/maintainer-bot.yml@@ -36,12 +36,14 @@ concurrency:cancel-in-progress: truejobs:review:+ # Only here: forks have no OG_PC_API_KEY, so the job would fail on every pull request in them (#2032).if: >-+ github.repository == 'Gathin23/cleanyourtv' && ((github.event_name == 'pull_request_target' && !github.event.pull_request.draft) ||github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ||(github.event_name == 'issue_comment' && github.event.issue.pull_request &&startsWith(github.event.comment.body, '/bot review') &&- contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))+ contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)))runs-on: ubuntu-latest# A single PR review gets 30 minutes; the backfill (workflow_dispatch) and the 6-hourly sweep keep 5 hours.timeout-minutes: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 300 || 30 }}diff --git a/examples/tcl-43c645/build-and-install.sh b/examples/tcl-43c645/build-and-install.shdeleted file mode 100755index c1cd15d4c..000000000--- a/examples/tcl-43c645/build-and-install.sh+++ /dev/null@@ -1,69 +0,0 @@-#!/usr/bin/env bash-# Build launcher/ and install it on a TCL 43C645 / 60C635 as Home, with this folder's config.json-# (dock, Live TV, remote keys) and the remote-key services on.-# To change the dock order, edit dock_apps in config.json and run this again.-# Uses the stock adb binary. Safe to re-run: Android turns accessibility services off on every-# reinstall, so they are switched on again each time.-#-# Usage: TV_HOST=192.168.1.50 examples/tcl-43c645/build-and-install.sh-set -euo pipefail-cd "$(dirname "$0")/../../launcher"-TV="${TV_HOST:?set TV_HOST to the TV IP}:${TV_PORT:-5555}"-export JAVA_HOME="${JAVA_HOME:-$(ls -d "$HOME"/Android/jdk/jdk-17* 2>/dev/null | head -1)}"-export ANDROID_HOME="${ANDROID_HOME:-$HOME/Android/Sdk}"-export PATH="$JAVA_HOME/bin:$PATH"-ADB="${ADB:-$ANDROID_HOME/platform-tools/adb}"-# On WSL2 the adb daemon can hang while forking; run "adb -P 15037 nodaemon server" in another-# terminal and set ADB_PORT=15037.-[ -n "${ADB_PORT:-}" ] && ADB="$ADB -P $ADB_PORT"-A="$ADB -s $TV"-[ -f local.properties ] || echo "sdk.dir=$ANDROID_HOME" > local.properties--# The wrapper jar directly, so a checkout with CRLF line endings in gradlew still builds.-java -Xmx64m -cp gradle/wrapper/gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain assembleRelease -q --console=plain-APK=app/build/outputs/apk/release/app-release.apk--$ADB connect "$TV" >/dev/null-$A push "$APK" /data/local/tmp/tvhome.apk-OUT=$($A shell pm install -r /data/local/tmp/tvhome.apk | tr -d '\r')-$A shell rm -f /data/local/tmp/tvhome.apk-echo "$OUT"-[ "$OUT" = Success ] || { echo "install failed, Home left as it was" >&2; exit 1; }--# This TV's dock, Live TV app and remote keys (examples/tcl-43c645/config.json), overlaid on-# config.xml by the launcher at start. A new theme_revision makes it drop on-TV layout choices.-DIR=/sdcard/Android/data/com.gathin.tvhome/files-$A shell mkdir -p "$DIR"-$A push ../examples/tcl-43c645/config.json "$DIR/config.json" >/dev/null-$A shell "printf '%s' $(date +%s) > $DIR/theme_revision"--START=$($A shell am start -W -a android.intent.action.MAIN -c android.intent.category.HOME -n com.gathin.tvhome/.MainActivity | tr -d '\r')-echo "$START" | grep -q 'Status: ok' || { echo "launcher did not start, Home left as it was" >&2; exit 1; }--$A shell pm grant com.gathin.tvhome android.permission.ACCESS_FINE_LOCATION-$A shell cmd package compile -m speed -f com.gathin.tvhome >/dev/null-# Stock Home and the Google TV setup wizard (which claims Home once launcherx is off). A no-op when-# debloat.txt already disabled setupwraith.-$A shell pm disable-user --user 0 com.google.android.tungsten.setupwraith-$A shell pm disable-user --user 0 com.google.android.apps.tv.launcherx-$A shell cmd package set-home-activity --user 0 com.gathin.tvhome/.MainActivity-HOME_NOW=$($A shell cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.HOME | tail -n 1 | tr -d '\r')-echo "Home: $HOME_NOW"-case "$HOME_NOW" in- com.gathin.tvhome/*) ;;- *) echo "Home is not the new launcher; putting launcherx back" >&2- $A shell pm enable com.google.android.apps.tv.launcherx- $A shell cmd package set-home-activity --user 0 com.google.android.apps.tv.launcherx/.home.HomeActivity- exit 1 ;;-esac--# InputKeyService: Input button and the Netflix/YouTube/Prime buttons (app_keys).-# HomeKeyService: the TCL and gear buttons open Settings (settings_key_keycodes).-# The reinstall unbinds them, and they bind again only when the list changes: clear it first.-$A shell settings put secure enabled_accessibility_services "''"-sleep 1-$A shell settings put secure enabled_accessibility_services \- com.gathin.tvhome/.InputKeyService:com.gathin.tvhome/.HomeKeyService-$A shell settings put secure accessibility_enabled 1-$A shell input keyevent HOME-echo "Installed. Check the remote buttons with the real remote."diff --git a/examples/tcl-43c645/restore.sh b/examples/tcl-43c645/restore.shdeleted file mode 100755index ee10d3173..000000000--- a/examples/tcl-43c645/restore.sh+++ /dev/null@@ -1,32 +0,0 @@-#!/usr/bin/env bash-# Undo examples/tcl-43c645: re-enable every package in debloat.txt, give Home back to the Google TV-# launcher and switch the launcher's accessibility services off. Nothing was uninstalled, so this-# brings the TV back to how it shipped. Pass --uninstall to remove the custom launcher as well.-#-# Usage: TV_HOST=192.168.1.50 examples/tcl-43c645/restore.sh [--uninstall]-# Re-enable one app only: adb shell pm enable <package>-set -euo pipefail-cd "$(dirname "$0")"-TV="${TV_HOST:?set TV_HOST to the TV IP}:${TV_PORT:-5555}"-ADB="${ADB:-${ANDROID_HOME:-$HOME/Android/Sdk}/platform-tools/adb}"-[ -n "${ADB_PORT:-}" ] && ADB="$ADB -P $ADB_PORT"-A="$ADB -s $TV"-$ADB connect "$TV" >/dev/null--# Package names only; the list is checked so nothing else reaches the TV's shell.-PKGS=$(tr -d '\r' < debloat.txt | sed -E 's/#.*$//' | awk 'NF {print $1}')-for p in $PKGS; do- [[ "$p" =~ ^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z0-9_]+)+$ ]] || { echo "skipping bad entry: $p" >&2; continue; }- # One pm call per shell: chained pm commands can stop silently after the first.- $A shell pm enable "$p" | tr -d '\r'-done--$A shell settings put secure enabled_accessibility_services "''"-# launcherx is not in debloat.txt: build-and-install.sh disables it.-$A shell pm enable com.google.android.apps.tv.launcherx | tr -d '\r'-$A shell cmd package set-home-activity --user 0 com.google.android.apps.tv.launcherx/.home.HomeActivity-if [ "${1:-}" = --uninstall ]; then- $A shell pm uninstall com.gathin.tvhome-fi-$A shell input keyevent HOME-echo "Home: $($A shell cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.HOME | tail -n 1)"