Skip to content

JohnWayneeee/cleantv / skills/android-tv-setup

android-tv-setup

Unverified

Set up an Android TV or Google TV over network ADB - back up, debloat with the owner's choices, switch off screen recognition (ACR) and take the microphone and camera away from vendor apps, tune performance, set picture and sound like a calibrator, replace the home screen with a clean Apple TV style launcher, and set up a YouTube DPI bypass (ByeByeDPI) where the ISP throttles YouTube, verifying every step with screenshots from the TV. Use when the user wants to debloat, clean up, speed up, configure, calibrate or replace the launcher on an Android TV / Google TV set or box (Xiaomi, TCL, Hisense, Sony, Philips, CHiQ/Changhong, Haier, Nvidia Shield and others). Not for Samsung Tizen, LG webOS or Fire TV launchers.

FileKindSize
SKILL.mdskill md7.1 KB
launcher/app/build.gradleother482 B
launcher/app/src/main/AndroidManifest.xmlconfig2.2 KB
launcher/app/src/main/assets/fonts/OFL.txtmarkdown4.3 KB
launcher/app/src/main/assets/fonts/Onest.ttfbinary188.5 KB
launcher/app/src/main/java/com/cleantv/launcher/AppRepository.javaother4.5 KB
launcher/app/src/main/java/com/cleantv/launcher/GlassHighlight.javaother2.8 KB
launcher/app/src/main/java/com/cleantv/launcher/MainActivity.javaother29.2 KB
launcher/app/src/main/java/com/cleantv/launcher/ShimmerDrawable.javaother2.1 KB
launcher/app/src/main/java/com/cleantv/launcher/SkeletonAdapter.javaother2.4 KB
launcher/app/src/main/java/com/cleantv/launcher/TileAdapter.javaother3.0 KB
launcher/app/src/main/res/drawable/banner.xmlconfig491 B
launcher/app/src/main/res/drawable/ic_input.xmlconfig472 B
launcher/app/src/main/res/drawable/ic_settings.xmlconfig1.2 KB
launcher/app/src/main/res/drawable/ic_wifi.xmlconfig489 B
launcher/app/src/main/res/layout/activity_main.xmlconfig7.3 KB
launcher/app/src/main/res/layout/item_tile.xmlconfig1.0 KB
launcher/app/src/main/res/values/config.xmlconfig2.2 KB
launcher/app/src/main/res/values/strings.xmlconfig696 B
launcher/app/src/main/res/values/styles.xmlconfig1.1 KB
launcher/build.gradleother74 B
launcher/gradle.propertiesother109 B
launcher/gradle/wrapper/gradle-wrapper.jarbinary42.7 KB
launcher/gradle/wrapper/gradle-wrapper.propertiesother251 B
launcher/gradlewother8.5 KB
launcher/gradlew.batscript2.8 KB
launcher/settings.gradleother332 B
references/connect.mdmarkdown3.1 KB
references/debloat.mdmarkdown4.0 KB
references/devices/mediatek-mt5889-homwee.mdmarkdown9.6 KB
references/devices/skyworth-m7332.mdmarkdown6.9 KB
references/dpi-bypass.mdmarkdown4.5 KB
references/finish.mdmarkdown2.5 KB
references/launcher.mdmarkdown7.9 KB
references/performance.mdmarkdown3.1 KB
references/picture.mdmarkdown5.5 KB
references/privacy.mdmarkdown5.2 KB
references/questions.mdmarkdown11.6 KB
references/sound.mdmarkdown2.9 KB
scripts/adb-closed.pyscript893 B
scripts/appops.pyscript1.2 KB
scripts/backup.pyscript3.2 KB
scripts/build-install.shscript2.9 KB
scripts/disable.pyscript3.0 KB
scripts/privacy.pyscript5.4 KB
scripts/restore.pyscript1.5 KB
scripts/scan.pyscript2.4 KB
scripts/setting.pyscript1.9 KB
scripts/snapshot.pyscript1.9 KB
scripts/tv.pyscript1.8 KB
scripts/tvlib.pyscript2.4 KB

scripts/tvlib.py

View on GitHub
"""Shared helpers: find adb, find the TV, run shell commands.

Scripts run from the TV's work directory (tvs/<model>/). The TV address comes from
TV_HOST[/TV_PORT] or from a file ./.tv holding "IP:PORT".
"""
import os
import shutil
import subprocess
import sys

WORK = os.getcwd()
BACKUP = os.path.join(WORK, "backup")


def find_adb():
    if os.environ.get("ADB"):
        return os.environ["ADB"]
    exe = "adb.exe" if os.name == "nt" else "adb"
    found = shutil.which("adb")
    if found:
        return found
    candidates = []
    for sdk in (os.environ.get("ANDROID_HOME"), os.environ.get("ANDROID_SDK_ROOT")):
        if sdk:
            candidates.append(os.path.join(sdk, "platform-tools", exe))
    candidates += [
        os.path.join(os.environ.get("LOCALAPPDATA", ""), "Android", "Sdk", "platform-tools", exe),
        os.path.expanduser("~/Library/Android/sdk/platform-tools/adb"),
        os.path.expanduser("~/Android/Sdk/platform-tools/adb"),
    ]
    for c in candidates:
        if os.path.isfile(c):
            return c
    sys.exit("adb not found: install Android platform-tools or set ADB=/path/to/adb")


def find_serial():
    if os.environ.get("TV_HOST"):
        return f"{os.environ['TV_HOST']}:{os.environ.get('TV_PORT', '5555')}"
    if os.path.isfile(".tv"):
        s = open(".tv").read().split()[0]
        return s if ":" in s else s + ":5555"
    sys.exit("TV address unknown: write 'IP:5555' to ./.tv or set TV_HOST")


ADB = find_adb()
_serial = None
_connected = False


def serial():
    global _serial
    if _serial is None:
        _serial = find_serial()
    return _serial


def adb(*args, check=False):
    global _connected
    if not _connected:
        subprocess.run([ADB, "connect", serial()], capture_output=True)
        _connected = True
    r = subprocess.run([ADB, "-s", serial(), *args], capture_output=True)
    if check and r.returncode != 0:
        sys.exit(f"adb {' '.join(args)} failed: {r.stderr.decode(errors='replace').strip()}")
    return r


def sh(cmd):
    """Run one shell command on the TV, return stdout+stderr as text."""
    r = adb("shell", cmd)
    return (r.stdout + r.stderr).decode("utf-8", errors="replace").replace("\r\n", "\n").strip()


def packages(flag=""):
    out = sh(f"pm list packages {flag}")
    return sorted(l.split(":", 1)[1].strip() for l in out.splitlines() if l.startswith("package:"))


def ensure_backup_dir():
    os.makedirs(BACKUP, exist_ok=True)
    return BACKUP
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 193kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 193kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 193kUpdated Claude CodeCodexVerifiedInstall