JohnWayneeee/cleantv / skills/android-tv-setup
android-tv-setup
UnverifiedSet 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.
scripts/scan.py
View on GitHub#!/usr/bin/env python3
"""Find TVs on the local /24: ADB (5555) and Cast/Android TV Remote ports (8008, 8009, 6466).
scan.py # subnet of the default route
scan.py 192.168.0.0 # another /24
"refused" on 5555 means a live host with ADB off. No answer at all from anything, including the
router, usually means a VPN captures the LAN (see references/connect.md).
"""
import concurrent.futures as cf
import errno
import socket
import sys
PORTS = (5555, 8008, 8009, 6466)
REFUSED = {errno.ECONNREFUSED, 10061}
def local_prefixes():
"""Private /24s of this machine, home-style 192.168.* first. A VPN may own the default route."""
ips = {ai[4][0] for ai in socket.getaddrinfo(socket.gethostname(), None, socket.AF_INET)}
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
s.connect(("192.0.2.1", 9)) # no packet is sent; adds the default-route interface
ips.add(s.getsockname()[0])
finally:
s.close()
private = [ip for ip in ips if ip.startswith(("192.168.", "10.")) or
(ip.startswith("172.") and 16 <= int(ip.split(".")[1]) <= 31)]
order = {"192": 0, "10": 1, "172": 2}
return sorted({ip.rsplit(".", 1)[0] for ip in private}, key=lambda p: (order[p.split(".")[0]], p))
def probe(arg):
host, port = arg
s = socket.socket()
s.settimeout(1.2)
try:
r = s.connect_ex((host, port))
finally:
s.close()
return host, port, "open" if r == 0 else "refused" if r in REFUSED else None
def scan(prefix):
found = {}
with cf.ThreadPoolExecutor(256) as ex:
for host, port, state in ex.map(probe, [(f"{prefix}.{i}", p) for i in range(1, 255) for p in PORTS]):
if state:
found.setdefault(host, []).append(f"{port}:{state}")
if not found:
print(f"{prefix}.0/24: no ADB/Cast ports open. If even the router does not answer ping, "
"a VPN captures this subnet (references/connect.md)")
for host in sorted(found, key=lambda h: int(h.rsplit(".", 1)[1])):
tags = " ".join(sorted(found[host]))
hint = " <- ADB open" if "5555:open" in tags else " <- TV? (cast/remote ports)" if "8009" in tags or "6466" in tags else ""
print(f"{host:16} {tags}{hint}")
def main(a):
for prefix in [x.rsplit(".", 1)[0] for x in a] or local_prefixes():
scan(prefix)
if __name__ == "__main__":
main(sys.argv[1:])
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 196k | Updated | Claude CodeCodex | Verified | Install |
| 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: 193k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 193k | Updated | Claude CodeCodex | Verified | Install |
| 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: 193k | Updated | Claude CodeCodex | Verified | Install |