Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

examples: Chromecast casting needs setupwraith (#361)

xbsheng173f758fcbeb
diff --git a/README.md b/README.md
index e302f43f6..98b91609a 100644
--- a/README.md
+++ b/README.md
@@ -347,7 +347,7 @@ three that matter most:
- **macOS blocks `adb connect`** ("No route to host") under Local Network privacy. `tools/tv.py` avoids the binary.
- **Disable the stock launcher only after the new one is installed and running**, or Home lands on a factory test app. The install script orders this for you.
-- **On Google TV the setup wizard** (`com.google.android.tungsten.setupwraith`) can take Home and crash-loop the system after the stock launcher is disabled. Disable it too, and list it in your `debloat.txt` so restore brings it back. But check `dumpsys wifi | grep -o 'cname=[^ ]*'` first: if the Wi-Fi network was saved during setup it belongs to setupwraith, and disabling it deletes the network (re-join it in Settings first; `tools/disable.sh` skips setupwraith until you do). Stuck already? `tools/tv.py 'pm enable --user 0 com.google.android.apps.tv.launcherx'`.
+- **On Google TV the setup wizard** (`com.google.android.tungsten.setupwraith`) can take Home and crash-loop the system after the stock launcher is disabled. Disable it too, and list it in your `debloat.txt` so restore brings it back. But check `dumpsys wifi | grep -o 'cname=[^ ]*'` first: if the Wi-Fi network was saved during setup it belongs to setupwraith, and disabling it deletes the network (re-join it in Settings first; `tools/disable.sh` skips setupwraith until you do). On Google's own Chromecast, disabling it also costs phone casting (YouTube says "Untrusted device") because the Cast receiver takes its credentials from setupwraith; keep it, or re-enable it for a minute after each boot and disable it again. Stuck already? `tools/tv.py 'pm enable --user 0 com.google.android.apps.tv.launcherx'`.
## Questions people ask
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md
index 9c50fbe8d..ab755b0af 100644
--- a/docs/TROUBLESHOOTING.md
+++ b/docs/TROUBLESHOOTING.md
@@ -84,6 +84,23 @@ Things that bit us or contributors, so they don't bite you. Commands use `tools/
then belongs to `android.uid.system`), or use Ethernet. `tools/disable.sh` skips setupwraith while it
owns the network (`FORCE_SETUPWRAITH=1` overrides). Already offline? Rejoin from the TV with its own
remote or a USB keyboard, then turn Wireless debugging back on if it was in use.
+- **Casting from a phone fails with "Untrusted device" after setupwraith is disabled**, seen on
+ Chromecast with Google TV HD (`boreal`) on Google TV 14 build UTTC.250917.004, the build the
+ `examples/google-chromecast-gtv-4k/` list was made on. YouTube on the phone says "Untrusted device.
+ ... couldn't be verified", and logcat repeats `cast_ClientAuthCredsProvisioning: Loading factory
+ credentials for 1P device`, `Failed to find provider info for ...CastInfoProvider` and
+ `cast_shell: No private key, hence empty signature`. The Cast receiver
+ (`com.google.android.apps.mediashell`) loads its factory device credentials from a content provider
+ inside setupwraith (`...tv.setupwraith.libs.castinfo.CastInfoProvider`), so disabling the wizard
+ takes the credentials with it. Re-enable it and within a minute the log shows
+ `SetupWraith|CastInfoProvider: querying cast infos` and `Created singleton instance of
+ ClientAuthSigner`, and casting works. You cannot keep the provider and give up only Home:
+ `pm disable-user` on `setupwraith/.RecoveryActivity` is refused with `SecurityException: Shell
+ cannot change component state`. So either debloat without setupwraith and launcherx, or re-enable
+ setupwraith after each boot, wait for `ClientAuthSigner`, then disable it again: the receiver keeps
+ the credentials in memory, so casting survives until the next reboot. Reported on Google's own
+ Chromecast hardware so far; the Xiaomi Mi Box S 2nd gen list says casting from a Pixel still works
+ there with setupwraith off.
- **The TV drops off Wi-Fi every minute right after the install**, seen on Google TV 14 (Xiaomi
MiTV-MZTU0): the same setupwraith `.RecoveryActivity` took Home and system_server crash-looped
on it. The install script now starts the new launcher before disabling the stock one, sets the
diff --git a/examples/README.md b/examples/README.md
index da48e71be..3771a7aef 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -14,7 +14,7 @@ on that firmware, grouped and commented. These are starting points: comment out
| `byintek-t5-max/` | BYINTEK T5 Max projector (built-in Google TV stick: SkyworthDigital YYT, Amlogic), Brazil | Google TV 14 | Same stick/firmware as Wanbo X5 Pro; telemetry, Privacy Sandbox, xCPE, Skyworth device-info and factory test apps off; setupwraith kept (it owns the saved Wi-Fi here) and launcherx kept enabled as recovery while the fork is HOME; voice, Chromecast, OTA kept; autofocus/keystone/HDMI run by the projector mainboard, not Android |
| `chiq-gtvu65/` | CHiQ AI PONT (Changhong GTVU65, dangni, MediaTek mt5867) | Google TV 14 | Google ad services and auto-installs, Homwee store/help; 1 GB; setupwraith must go (RecoveryActivity component cannot be disabled alone); MediaTek partnercustomizer safe to disable (reboot-checked) |
| `chiq-ai-pont/` | CHiQ AI PONT (DVB93CQ) | Android TV 11 | Anoki ACR, FAST channels, AI PONT, Homwee services |
-| `google-chromecast-gtv-4k/` | Chromecast with Google TV 4K (sabrina) | Google TV 14 | Google telemetry and ad services, ambient mode, launcherx + setupwraith; wireless-debugging pairing, YouTube button remap |
+| `google-chromecast-gtv-4k/` | Chromecast with Google TV 4K (sabrina) | Google TV 14 | Google telemetry and ad services, ambient mode, launcherx + setupwraith; wireless-debugging pairing, YouTube button remap; casting needs setupwraith (its CastInfoProvider holds the receiver's credentials) |
| `ffalcon-65s585c-pro/` | FFalcon (雷鸟) 鹤6 PRO 65S585C Pro (China, tcl_mt5879_cn, MediaTek MT9653) | Android TV 11 | Same platform and firmware build as tcl-q10g-pro; TCL boot ad, analytics, push, home recommendation cards and silent-install channels stay disabled across a reboot; OTA, account, voice, weather, album, WeChat and video call off by choice; debloat only, no third-party launcher or sideloading; reboot-checked |
| `freebox-player-pop/` | Freebox Player POP (Free, fbx8am, Amlogic), IPTV/DVB-T box | Android TV 10 | Free stats, Google feedback and recommendations, partner auto-installs, NES/CTC factory tests; French catch-up, kids and Free apps off by choice, Arte/Spotify/Stremio kept; OQEE is the stock home (HOME priority 3); Chromecast must stay for Spotify Connect; AdGuard DNS blocks pixel.spotify.com and breaks Spotify; 2 GB |
| `haier-android-tv-dvb2k/` | Haier Android TV DVB2K (broadway, HaierATVT56DVB) | Android TV 11 | Anoki ACR, retail demo, Haier content apps and auto-install; 1 GB, 720p; setupwraith left enabled |
diff --git a/examples/google-chromecast-gtv-4k/debloat.txt b/examples/google-chromecast-gtv-4k/debloat.txt
index 91522730a..ff577a733 100644
--- a/examples/google-chromecast-gtv-4k/debloat.txt
+++ b/examples/google-chromecast-gtv-4k/debloat.txt
@@ -16,6 +16,17 @@
# - `cmd package set-home-activity com.gathin.tvhome` returns Success but launcherx stays the default.
# Disable BOTH com.google.android.apps.tv.launcherx and com.google.android.tungsten.setupwraith
# (setupwraith re-enables launcherx), only after the new launcher is installed.
+# - Disabling setupwraith also breaks casting from phones on this build. The Cast receiver
+# (com.google.android.apps.mediashell) reads its factory device credentials from a provider inside
+# setupwraith (com.google.android.libraries.tv.setupwraith.libs.castinfo.CastInfoProvider), so once
+# the wizard is gone and the device has rebooted, YouTube on the phone answers "Untrusted device ...
+# couldn't be verified" and the receiver logs "No private key, hence empty signature" every minute.
+# Keeping the provider while taking Home away does not work: pm disable-user on
+# setupwraith/.RecoveryActivity is refused with a SecurityException. Either debloat only (keep
+# launcherx and setupwraith enabled), or re-enable setupwraith after each boot, wait a minute for
+# "Created singleton instance of ClientAuthSigner" in logcat, then disable it again - the receiver
+# holds the credentials in memory, so casting works until the next reboot
+# (docs/TROUBLESHOOTING.md, "Casting fails with Untrusted device").
# - With launcherx disabled the YouTube button on the remote does nothing. It sends BUTTON_3
# (keycode 190). Button Mapper only remaps added buttons in its paid Pro version; Key Mapper
# (open source, keymapperorg/KeyMapper) does it for free. Play Store lists Key Mapper as incompatible
@@ -32,9 +43,11 @@
# settings put secure screensaver_components com.gathin.tvhome/.ClockDream
# - Animation scales already ship at 0.5x on this build.
#
-# Kept on purpose (all work after this list): Google Assistant (com.google.android.katniss),
-# Cast receiver (com.google.android.apps.mediashell), phone remote (com.google.android.tv.remote.service),
-# Play Store / Play Services, Gboard, Bluetooth, com.google.android.tv.dfuservice (remote firmware updates).
+# Kept on purpose: Google Assistant (com.google.android.katniss), Cast receiver
+# (com.google.android.apps.mediashell), phone remote (com.google.android.tv.remote.service), Play Store /
+# Play Services, Gboard, Bluetooth, com.google.android.tv.dfuservice (remote firmware updates).
+# The receiver itself stays enabled, but casting still needs setupwraith for its credentials
+# (see the setupwraith quirks above).
# Telemetry, feedback and ads
com.google.android.feedback