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

references/dpi-bypass.md

View on GitHub
# DPI bypass for YouTube (ByeByeDPI)

For owners whose ISP throttles or blocks YouTube with DPI (Russia and similar). ByeByeDPI
(`io.github.romanvht.byedpi`, https://github.com/romanvht/ByeByeDPI) runs ByeDPI locally and routes traffic through
it as a VPN. Nothing leaves the home network: no external server, no account.

## When to offer it

Ask Q-B1 during the Launcher phase when any of these is true: `getprop persist.sys.timezone` is a Russian zone
(`Europe/Moscow`, `Asia/Yekaterinburg`, ...), `getprop persist.sys.locale` is `ru-RU`, the owner speaks Russian,
or the owner says YouTube is slow. Do not offer it when the owner already runs a VPN on the TV: two VPNs cannot run
at once.

## 1. Install

Pick the APK by `getprop ro.product.cpu.abi` (`armeabi-v7a` on most TVs, even 64-bit boards) from the latest
release, put it in its own scratch directory, then:

```sh
adb push ByeByeDPI-<ver>-<abi>-release.apk /data/local/tmp/bbdpi.apk
python <skill>/scripts/tv.py 'pm install -r /data/local/tmp/bbdpi.apk'
python <skill>/scripts/tv.py 'rm /data/local/tmp/bbdpi.apk'
python <skill>/scripts/tv.py 'cmd appops set io.github.romanvht.byedpi ACTIVATE_VPN allow'
```

The `ACTIVATE_VPN` app op is the VPN consent the system dialog would ask for. Without it `ToggleActivity` silently
does nothing in VPN mode (`VpnService.prepare` returns an intent and the activity just finishes).

## 2. Settings (in the app, driven with `uiautomator dump` + `input tap`)

- Mode: **VPN** (default). The YouTube app has no proxy setting.
- DNS: **Google (8.8.8.8)**. Field report, not verified on our TVs: with Cloudflare (1.1.1.1, the default) the
  strategy test gave bad results; set Google DNS before the test. In 1.8.2 source the test runs in proxy mode and
  does not read `dns_ip`; the DNS server is used by VPN mode, so Google DNS matters for real playback either way.
- App filter: **Whitelist** -> select only `com.google.android.youtube.tv`. Other apps keep the direct route.
- Automation: autostart on boot **off**, auto-connect on app open **off**. The launcher starts and stops it.
- Do not restrict ByeByeDPI's background work (`appops.py`): it must keep running while YouTube plays.

## 3. Strategy test

Main screen > Подбор (Strategy test) > Start. About 60 strategies, 10-15 s each, so 10-15 minutes; the owner must
not touch the remote. By default it checks `youtube` and `googlevideo` domains. Apply the best one (most sites
passed) with the app's own "apply" action, or pass it to the toggle: `am start -n
io.github.romanvht.byedpi/.activities.ToggleActivity --es strategy '<args>' --ez only_update true`.

## 4. Start only with YouTube (launcher)

`ToggleActivity` is exported and takes `only_start` / `only_stop` / `only_update` booleans and a `strategy` string.
The launcher uses it (config.xml):

```xml
<string-array name="dpi_apps">
    <item>com.google.android.youtube.tv</item>
</string-array>
```

Opening a `dpi_apps` tile starts the bypass, waits `dpi_delay_ms` (700 ms) for the VPN, then opens the app.
Home coming back stops it. Limits: YouTube opened another way (a YouTube key on the remote, a deep link, recents)
does not start the bypass. Then either open it from the launcher, or leave ByeByeDPI always on: with the whitelist
only YouTube's traffic goes through it.

## 5. Verify

```sh
python <skill>/scripts/tv.py 'dumpsys connectivity | grep -c "VPN CONNECTED"'   # 1 while YouTube is open, 0 at Home
python <skill>/scripts/tv.py 'pidof io.github.romanvht.byedpi:native'          # empty at Home
adb shell dumpsys connectivity | grep "VPN CONNECTED" | grep -o "Uids: <[^>]*>"  # only YouTube's appId
```

Android 11 prints the VPN network differently: no `VPN CONNECTED` line, but `type: VPN[], state: CONNECTED` with
`Uid: <appId> OwnerUid: <byedpi appId>` in `nc{...}` for a single-app whitelist, or `Uids: <{0-10097, 10099-99999}>`
when there is no filter (everything goes through the VPN). `ifconfig tun0` works on every version.

ByeByeDPI ignores Settings while the service runs (the OK press does nothing): stop it with `only_stop` first.
Upgrading over an older version with `pm install -r` keeps its settings, strategy and the `ACTIVATE_VPN` app op
(1.7.5 -> 1.8.2 on CHiQ AI PONT).

Measured on a Skyworth m7332 (1.8 GB): the VPN is up ~460 ms after `only_start`; `Uids: <{10067-10067, 20067-20067}>`
matched YouTube's `appId=10067`. Toybox `grep` on the TV has no `\s` and fails on long pipes: grep on the PC.

Play a video at 1080p for a minute. Then press Home and check the VPN is gone.

## Undo

`pm uninstall io.github.romanvht.byedpi` (an app we installed, not a system package) and empty `dpi_apps`.
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: 198kUpdated 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: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated 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: 194kUpdated Claude CodeCodexVerifiedInstall