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
examples: add OPPO K9 55 (OPPOCNM632) ColorOS TV, Android 9
Cursor Agenta97277a0284b
diff --git a/docs/devices/oppo-k9-55-oppocnm632.md b/docs/devices/oppo-k9-55-oppocnm632.mdnew file mode 100644index 000000000..d5fdb87d8--- /dev/null+++ b/docs/devices/oppo-k9-55-oppocnm632.md@@ -0,0 +1,91 @@+# OPPO K9 55 (OPPOCNM632): ColorOS TV package-name Home allowlist++Tested on an OPPO K9 55 (`OPPOCNM632`), Android 9 / ColorOS TV. The display build id was not+captured. Stock Home is `com.heytap.tv.launcher/com.oneplus.tv.launcher2.HomeLauncher`.+The package lists for this unit live in+[`examples/oppo-k9-55-oppocnm632/debloat.txt`](../../examples/oppo-k9-55-oppocnm632/debloat.txt)+and+[`examples/oppo-k9-55-oppocnm632/debloat-extra.txt`](../../examples/oppo-k9-55-oppocnm632/debloat-extra.txt).++The allowlist and the boot category were first written up for a K9 65 (`OPPOCNM652`, ColorOS TV+2.4) in [aerial-tv's device note](https://github.com/pengchujin/aerial-tv/blob/master/docs/devices/oppo-coloros-tv.md).+The checks below are this 55" set, with this launcher.++## The three allowlisted package ids++ColorOS accepts a HOME install only for three package names:++| Package | Role on this set |+|---|---|+| `com.heytap.tv.launcher` | Stock home. Do not build over it, and do not disable it |+| `com.oneplus.tv.launcher2` | The identity that installed and became Home here |+| `com.oppo.tv.launcher2` | Also allowlisted. Not the identity used on this set |++`pm path com.heytap.tv.launcher` already answers: that name is the system launcher. A build with+`-PlauncherApplicationId=com.heytap.tv.launcher` would be an attempt to replace it. Stop if+`pm path com.oneplus.tv.launcher2` (or `com.oppo.tv.launcher2`, if you have to use that one)+already names some other application.++The default `com.gathin.tvhome` build was blocked as a HOME install on this set. The same refusal+is quoted on the K9 65 note as+`INSTALL_FAILED_DUPLICATE_PERMISSION: App installation is banned, because of launcher categories`.++## Build with the opt-in identity++`MainActivity`'s HOME filter declares `com.heytap.tv.launcher.category.MODERN_HOME`. ColorOS boot+only promotes a HOME that carries that category; the K9 65 note sat on the brand animation until+it was added. The Java namespace stays `com.gathin.tvhome`.++Do not run `launcher/build-and-install.sh` here. It always builds and installs `com.gathin.tvhome`,+then points Home at `com.gathin.tvhome/.MainActivity`. `com.heytap.tv.launcher` is deliberately+absent from that script's `KNOWN_STOCK_LAUNCHERS`: naming it as `STOCK_LAUNCHER` would disable the+stock home. Install by hand, and leave the stock package enabled.++From the repository root:++```bash+export TV_HOST=192.168.1.50+PY=tools/venv/bin/python+"$PY" -I tools/tv.py 'pm path com.oneplus.tv.launcher2'+"$PY" -I tools/tv.py 'pm path com.heytap.tv.launcher'+"$PY" -I tools/tv.py 'cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.HOME'+(cd launcher && ./gradlew assembleRelease -PlauncherApplicationId=com.oneplus.tv.launcher2)+"$PY" -I tools/b64push.py launcher/app/build/outputs/apk/release/app-release.apk /data/local/tmp/tvhome-allowlist.apk+"$PY" -I tools/tv.py 'pm install -r /data/local/tmp/tvhome-allowlist.apk; rm -f /data/local/tmp/tvhome-allowlist.apk'+"$PY" -I tools/tv.py 'am start -W -n com.oneplus.tv.launcher2/com.gathin.tvhome.MainActivity'+```++After the new screen is up, select it as Home and read the resolution back:++```bash+"$PY" -I tools/tv.py 'cmd package set-home-activity --user 0 com.oneplus.tv.launcher2/com.gathin.tvhome.MainActivity'+"$PY" -I tools/tv.py 'cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.HOME'+```++The component is `com.oneplus.tv.launcher2/com.gathin.tvhome.MainActivity`.+`com.oneplus.tv.launcher2/.MainActivity` is the wrong class. `tools/theme.sh` still writes to+`com.gathin.tvhome`; a theme file for this build belongs in+`/sdcard/Android/data/com.oneplus.tv.launcher2/files/config.json`.++## What this set confirmed++Install reported Success for versionName 3.0 / versionCode 9, signed with the debug keystore.+`cmd package set-home-activity` was set to+`com.oneplus.tv.launcher2/com.gathin.tvhome.MainActivity`. `com.heytap.tv.launcher` stayed+enabled. The owner confirmed the home screen. Android 9 is API 28, above the launcher's minSdk 26.++The K9 65 note disabled its stock desktop after declaring the same category and still booted.+That was a different size, a different product code and a different launcher. This set did not+disable `com.heytap.tv.launcher`, and this list does not either. Several-day use, a cold boot+with the stock home disabled, and OTA persistence were not part of the check.++## Undo++```bash+"$PY" -I tools/tv.py 'cmd package set-home-activity --user 0 com.heytap.tv.launcher/com.oneplus.tv.launcher2.HomeLauncher'+"$PY" -I tools/tv.py 'pm uninstall com.oneplus.tv.launcher2'+```++`pm uninstall` here removes the sideloaded launcher only. The debloat lists disable, and+`tools/restore.sh` puts those packages back. The stock home activity on this firmware is+`com.heytap.tv.launcher/com.oneplus.tv.launcher2.HomeLauncher`.diff --git a/examples/oppo-k9-55-oppocnm632/debloat-extra.txt b/examples/oppo-k9-55-oppocnm632/debloat-extra.txtnew file mode 100644index 000000000..db7a1a14f--- /dev/null+++ b/examples/oppo-k9-55-oppocnm632/debloat-extra.txt@@ -0,0 +1,50 @@+# OPPO K9 55 (OPPOCNM632), Android 9 / ColorOS TV — optional slimmer set+# Apply on top of examples/oppo-k9-55-oppocnm632/debloat.txt, only for what you do not use.+# Kept out of both lists: stock home (com.heytap.tv.launcher), Settings, the market, Live TV,+# the file browser, Jellyfin and Miracast.+#+# Apply: TV_HOST=<tv ip> tools/disable.sh examples/oppo-k9-55-oppocnm632/debloat-extra.txt+# Undo: TV_HOST=<tv ip> tools/restore.sh examples/oppo-k9-55-oppocnm632/debloat-extra.txt com.heytap.tv.launcher+# Everything is DISABLED, not uninstalled. Comment out any line you want to keep.+#+# Voice is off by choice. A name-only privacy audit matched com.heytap.speechassist.tv+# (it declares RECORD_AUDIO) and com.heytap.tv.assistant.oppo (system uid; the returned+# appops history had touched RECORD_AUDIO). That shows the op was used, not that audio left+# the TV. Karaoke, the live-streaming app and the watch bridge are off by choice too.++# Gallery, weather, camera and calendar+com.heytap.tv.calendar+com.heytap.tv.camera+com.heytap.tv.cloudgallery+com.heytap.tv.gallery3d+com.heytap.tv.weather++# Calls, speakers, device inspect and the HeyTap things shelf+com.heytap.tv.videocall+com.heytap.tv.btspeaker+com.heytap.tv.heythings+com.heytap.tv.deviceinspect++# Smart home, voice and the OPPO assistant (off by choice)+com.heytap.smarthome.tv+com.heytap.speechassist.tv # declares RECORD_AUDIO+com.heytap.tv.assistant.oppo # system uid; appops history touched RECORD_AUDIO++# Cross-device links and accessories+com.heytap.iot.synergy+com.heytap.iot.relayplayer+com.heytap.ars.sink+com.heytap.optvbtlink+com.heytap.accessory++# Relax, fitness, karaoke, watch and account leftovers (off by choice)+com.coloros.relax.tv+com.health.aisportcoach+com.loostone.tuning+com.okii.watch.tv+com.tencent.karaoketv+com.changba.sd+com.huya.nftv+com.oneplus.tv.android.account+com.oplus.onet+tv.newtv.loginservicediff --git a/examples/oppo-k9-55-oppocnm632/debloat.txt b/examples/oppo-k9-55-oppocnm632/debloat.txtnew file mode 100644index 000000000..69b56e7d3--- /dev/null+++ b/examples/oppo-k9-55-oppocnm632/debloat.txt@@ -0,0 +1,59 @@+# OPPO K9 55 (OPPOCNM632), Android 9 / ColorOS TV+# Stock home: com.heytap.tv.launcher/com.oneplus.tv.launcher2.HomeLauncher.+# The display build id was not captured. See docs/devices/oppo-k9-55-oppocnm632.md+# before replacing Home.+#+# Apply: TV_HOST=<tv ip> tools/disable.sh examples/oppo-k9-55-oppocnm632/debloat.txt+# Undo: TV_HOST=<tv ip> tools/restore.sh examples/oppo-k9-55-oppocnm632/debloat.txt com.heytap.tv.launcher+# Everything is DISABLED, not uninstalled. Comment out any line you want to keep.+#+# Keep com.heytap.tv.launcher enabled. It is the stock home. Do not build the launcher over+# that package name, and do not pass it as STOCK_LAUNCHER: build-and-install.sh would disable+# it, and the default com.gathin.tvhome id is refused as a HOME install. The working build is+# -PlauncherApplicationId=com.oneplus.tv.launcher2, installed by hand (device note).+# Keep com.android.tv.settings enabled.+#+# On this unit the alternate-id launcher installed, set-home-activity succeeded, the stock+# home stayed enabled and the owner confirmed the screen. The packages below are the debloat+# set for that unit (ads, telemetry, factory menus, paid screen-share). It has not been+# described as a several-day run. Factory and AT packages are disabled here and never launched.+# A slimmer optional set is debloat-extra.txt.+#+# Cast / paid screen-share. Already disabled on this unit; listed so a restore record keeps them.+# HeyTap cast, paid mirroring and the Miracast-style share services.++# Cast / paid screen-share+com.heytap.tv.heycast+com.hpplay.happyplay.aw+com.apowersoft.mirror.tv+com.heytap.iot.castservice+com.heytap.optvmiracastservice++# Ads, promo rows, push and the quick-app runtime+com.opos.ott+com.heytap.tv.pictorial+com.heytap.tv.imagewall+com.heytap.tv.msgboard+com.heytap.mcs # HeyTap push+com.nearme.instant.platform.tv++# Telemetry, remote diagnose and crash upload+com.heytap.feedback+com.heytap.tv.remotediagnosing+com.oplus.crashbox++# Factory and engineering menus. Disabled, never launched.+tpv.factorymenu.ui+mediatek.factorymenu.ui+com.cvte.factory.service+com.cvte.factory.at+com.cvte.fac.menu+com.cvte.license.at+com.gaochuang.factory.at+com.konka.factory.at++# Low-value system extras+com.heytap.tv.userguide+com.heytap.tv.oobe # first-run wizard, after setup has finished+com.optv.aiengine+com.heytap.tv.aicaptiondiff --git a/examples/oppo-k9-55-oppocnm632/tv.json b/examples/oppo-k9-55-oppocnm632/tv.jsonnew file mode 100644index 000000000..1ec20ab98--- /dev/null+++ b/examples/oppo-k9-55-oppocnm632/tv.json@@ -0,0 +1,6 @@+{+ "tv": "OPPO K9 55 (OPPOCNM632)",+ "os": "Android 9 (ColorOS TV)",+ "brand": "OPPO",+ "notes": "HeyTap cast and paid screen-share, ads, pictorial, push, telemetry, crash upload and factory menus; optional extra list turns off gallery, weather, voice, karaoke and similar by choice; stock home `com.heytap.tv.launcher` stays enabled; build with `-PlauncherApplicationId=com.oneplus.tv.launcher2` ([device note](../docs/devices/oppo-k9-55-oppocnm632.md))"+}