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
docs: Coocaa home[0] repair lives in the homepage shim
VincentYe123bdcb4040b5cf
diff --git a/SHOWCASE.md b/SHOWCASE.mdindex b25972b59..3b1b95a62 100644--- a/SHOWCASE.md+++ b/SHOWCASE.md@@ -88,7 +88,7 @@ Small apps and scripts that run next to the launcher (or any launcher) and do on| [DVD Video screensaver for Android TV](https://github.com/TheWombRaider/dvd-tv) ([screenshot](https://github.com/TheWombRaider/dvd-tv/blob/main/docs/preview.jpg)) | The bouncing DVD VIDEO logo as an offline native screensaver and launcher preview, measured against reference video; no internet, audio or analytics | TCL Smart TV Pro (G08), Google TV 14; preview tested | [TheWombRaider](https://github.com/TheWombRaider) || [AirPlay receiver installer](https://github.com/nguyenduchoai/tv-vibehack/tree/feat/airplay-receiver) | A script that builds and installs an open-source AirPlay receiver next to the launcher, for iPhone mirroring | Xiaomi MiTV-AESP0, Android TV 9 | [nguyenduchoai](https://github.com/nguyenduchoai) || [Cast Fix](https://github.com/thayford/castfix) | Keeps casting from phones working on a Chromecast with Google TV after setupwraith is disabled for the launcher ([#361](https://github.com/Gathin23/cleanyourtv/issues/361)): at every boot it pairs with the TV's own Wireless debugging, lets the Cast receiver load its credentials from the setup wizard, then switches the wizard off again. No internet access | Chromecast with Google TV HD, Google TV 14 | [thayford](https://github.com/thayford) |-| [coocaa-home-shim](https://github.com/VincentYe123/coocaa-home-shim) | A 15 KB app under a Coocaa homepage package name that hands Home to the launcher on Skyworth's China-market Coocaa OS, where Home is a system property rather than an intent; for two minutes after boot it also moves the stock home aside. No internet permission | Skyworth 7S60_A5, Coocaa OS / Android 8 | [VincentYe123](https://github.com/VincentYe123) |+| [coocaa-home-shim](https://github.com/VincentYe123/coocaa-home-shim) | A 15 KB app under a Coocaa homepage package name that hands Home to the launcher on Skyworth's China-market Coocaa OS, where Home is a system property rather than an intent. At boot it writes that property back when the framework has stored `home[0]` / `home[1]`, and for two minutes it also moves the stock home aside. No internet permission | Skyworth 7S60_A5, Coocaa OS / Android 8 | [VincentYe123](https://github.com/VincentYe123) || [Homelab companion](https://github.com/epochcoder/cleanyourtv/tree/main/companion) ([how it works](https://github.com/epochcoder/cleanyourtv/blob/main/companion/README.md), [screenshots](https://raw.githubusercontent.com/epochcoder/cleanyourtv/d8454d32f53ad47b5f45ba1adfff7353e5c5c9b7/companion/docs/homelab.jpg)) | One app next to the launcher for a self-hosted homelab, with tabs for a Homepage dashboard, one search across Radarr and Sonarr that adds a film or show with one press, qBittorrent downloads named the way Sonarr and Radarr know them, the next two weeks of both calendars, and every setting edited with the remote or pushed from a computer. Its Immich screensaver crossfades recent photos with a slow zoom, pairs portraits side by side and captions the place, date and people, in the manner of Google Photos' ambient mode. Network only to the servers you configure, plus the public poster hosts the Sonarr and Radarr lookups point to; the launcher keeps no network permission | Formovie Laser 4K projector, Android TV 14 | [epochcoder](https://github.com/epochcoder) ([issues](https://github.com/epochcoder/cleanyourtv/issues)) || [3D Pipes: XP Screensaver for Android TV](https://github.com/TheWombRaider/pipes-tv) | The classic 3D Pipes screensaver, rebuilt from the original's published rules and checked against 184 scenes of the real one: a single pipe growing one whole segment at a time, a mix of elbows and ball joints, the 16 classic materials, the rare Utah teapot, a level camera that turns with each scene, and the small-square clear. No internet permission. TCL sets need one app-op (`AUTO_START`) before the system will start a sideloaded screensaver | TCL 75T7 (G08), Google TV 14 | [TheWombRaider](https://github.com/TheWombRaider) || [Weather Clock](https://github.com/matyivagyok/weatherclock-tv) | A screensaver that adds the weather to the launcher's clock: the thin clock and date centred over the ambient glow, with the current conditions, high and low, "feels like" and the next three days from Open-Meteo (no key). Location is automatic from the IP address (ipwho.is, geojs.io as fallback) or a city picked by hand; it only runs while the screensaver is on | Chromecast with Google TV HD, Google TV 14 | [matyivagyok](https://github.com/matyivagyok) |diff --git a/examples/skyworth-7s60-a5/README.md b/examples/skyworth-7s60-a5/README.mdindex 963ec3b7f..becf5a897 100644--- a/examples/skyworth-7s60-a5/README.md+++ b/examples/skyworth-7s60-a5/README.md@@ -38,10 +38,9 @@ PY=tools/venv/bin/python`com.tianci.system` to go Home (Coocaa blocks activity starts from background apps). With thestock home disabled, which is the last step, this no longer happens at all.- **The framework can overwrite the homepage properties at boot** with the literal strings- `home[0]` / `home[1]`. The Home key then does nothing. While `com.ccos.tv.homepage` is installed,- the launcher's boot receiver writes the shim back into those properties and opens Home- (`CoocaaBoot`). It does nothing on a TV where that package is not installed. Coocaa also disables- third-party boot receivers; opening the launcher re-enables its own.+ `home[0]` / `home[1]`. The Home key then does nothing. Shim 2.1 writes this package back into the+ properties at boot, before it asks the system to go Home. Coocaa also disables third-party boot+ receivers; opening the shim re-enables its own.## Install@@ -101,10 +100,8 @@ cannot be read, the Inputs pill opens Coocaa's control center on its source row## Known issues-- The framework writes `home[0]` / `home[1]` into the homepage properties on some boots. A launcher- with `CoocaaBoot` puts the shim back and opens Home; the lines it writes are in- `/sdcard/Android/data/com.coocaa.tvhome/files/boot.log`. On an older launcher, run the `setprop`- line from step 3 again.+- The framework writes `home[0]` / `home[1]` into the homepage properties on some boots. Shim 2.1+ puts itself back. With an older shim, run the `setprop` line from step 3 again.- The TV has no clock battery and starts at 1970-01-01 08:00 until network time arrives a few secondsafter boot, so the launcher's clock can read 08:00 briefly.- `com.coocaa.sky.ccapi` and `com.tianci.user` are Coocaa's payment and account apps: Coocaadiff --git a/launcher/app/src/main/AndroidManifest.xml b/launcher/app/src/main/AndroidManifest.xmlindex 8490b7d1c..80124b58a 100644--- a/launcher/app/src/main/AndroidManifest.xml+++ b/launcher/app/src/main/AndroidManifest.xml@@ -7,7 +7,6 @@<uses-feature android:name="android.hardware.wifi" android:required="false" /><uses-feature android:name="android.hardware.location.gps" android:required="false" />- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /><!-- Needed since Android 10 to read the Wi-Fi network name for the network pill. Never requested at@@ -191,18 +190,6 @@<!-- The remote's Input button (KEYCODE_TV or KEYCODE_TV_INPUT) opens the input switcher, and input_key_keycodes andapp_keys (config.xml or a theme) bring back other remote buttons; see InputKeyService. -->- <!-- Coocaa OS rewrites the homepage properties at boot. This puts them back and opens Home.- It returns immediately when the Coocaa homepage shim is not installed. -->- <receiver- android:name=".CoocaaBoot"- android:directBootAware="true"- android:exported="true">- <intent-filter>- <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />- <action android:name="android.intent.action.BOOT_COMPLETED" />- </intent-filter>- </receiver>-<serviceandroid:name=".InputKeyService"android:exported="false"diff --git a/launcher/app/src/main/java/com/gathin/tvhome/CoocaaBoot.java b/launcher/app/src/main/java/com/gathin/tvhome/CoocaaBoot.javadeleted file mode 100644index 27b26714d..000000000--- a/launcher/app/src/main/java/com/gathin/tvhome/CoocaaBoot.java+++ /dev/null@@ -1,99 +0,0 @@-package com.gathin.tvhome;--import android.content.BroadcastReceiver;-import android.content.ComponentName;-import android.content.Context;-import android.content.Intent;-import android.content.pm.PackageManager;-import android.net.Uri;--import java.io.File;-import java.io.FileWriter;-import java.io.IOException;-import java.lang.reflect.Method;--/**- * Coocaa OS (Skyworth, China) stores Home in persist.service.homepage.* and sometimes overwrites- * those with the literal strings home[0] / home[1] at boot, after which the Home key does nothing.- * When the homepage shim is installed, put the properties back and open this launcher.- */-public class CoocaaBoot extends BroadcastReceiver {-- private static final String SHIM = "com.ccos.tv.homepage";- private static final String SHIM_ACTIVITY = "com.ccos.tv.homepage.LaunchActivity";- private static final Uri SYSTEM = Uri.parse("content://com.tianci.provider");-- /** Something on Coocaa disables third-party boot receivers. An app may re-enable its own. */- static void keepEnabled(Context context) {- ComponentName self = new ComponentName(context, CoocaaBoot.class);- PackageManager pm = context.getPackageManager();- try {- if (pm.getComponentEnabledSetting(self) != PackageManager.COMPONENT_ENABLED_STATE_ENABLED) {- pm.setComponentEnabledSetting(self, PackageManager.COMPONENT_ENABLED_STATE_ENABLED,- PackageManager.DONT_KILL_APP);- }- } catch (RuntimeException ignored) {- }- }-- @Override- public void onReceive(Context context, Intent intent) {- keepEnabled(context);- if (!installed(context, SHIM)) return;- boolean pkg = setProp("persist.service.homepage.pkg", SHIM);- boolean cls = setProp("persist.service.homepage.cls", SHIM_ACTIVITY);- log(context, "boot pkgSet=" + pkg + " clsSet=" + cls- + " now=" + getProp("persist.service.homepage.pkg"));- try {- context.getContentResolver().call(SYSTEM, "COMMON", "gotoHomePage", null);- } catch (RuntimeException e) {- log(context, "gotoHomePage " + e);- }- try {- context.startActivity(new Intent(context, MainActivity.class)- .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED));- } catch (RuntimeException e) {- log(context, "start " + e);- }- }-- private static boolean installed(Context context, String pkg) {- try {- context.getPackageManager().getPackageInfo(pkg, 0);- return true;- } catch (PackageManager.NameNotFoundException e) {- return false;- }- }-- private static boolean setProp(String key, String value) {- try {- Class<?> c = Class.forName("android.os.SystemProperties");- Method set = c.getMethod("set", String.class, String.class);- set.invoke(null, key, value);- return value.equals(getProp(key));- } catch (ReflectiveOperationException | RuntimeException e) {- return false;- }- }-- private static String getProp(String key) {- try {- Class<?> c = Class.forName("android.os.SystemProperties");- Method get = c.getMethod("get", String.class);- Object v = get.invoke(null, key);- return v == null ? "" : v.toString();- } catch (ReflectiveOperationException | RuntimeException e) {- return "";- }- }-- private static void log(Context context, String line) {- File dir = context.getExternalFilesDir(null);- if (dir == null) return;- try (FileWriter w = new FileWriter(new File(dir, "boot.log"), true)) {- w.write(line + "\n");- } catch (IOException ignored) {- }- }-}diff --git a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.javaindex c07273d8a..dca4f8424 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java@@ -351,7 +351,6 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);- CoocaaBoot.keepEnabled(this);setContentView(R.layout.activity_main);density = getResources().getDisplayMetrics().density;// config.xml, overlaid by config.json from a pushed theme (see Config and tools/theme.sh).