Skip to content

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

Safety: the core-package guard also refuses the TV middleware (com.cltv.mal, com.mediatek.tis / tv.service / tv.agent), after a Haier boot loop (#1578)

Gathin23fa1a2f00f2b7
diff --git a/PROMPT.md b/PROMPT.md
index 33071ee82..9372db5a1 100644
--- a/PROMPT.md
+++ b/PROMPT.md
@@ -92,8 +92,10 @@ Debloat
`com.google.android.*`, and ext services and ext shared also as the bare `android.ext.services` and
`android.ext.shared`), `com.google.android.overlay.modules*`, `com.android.providers.*` (calendar,
contacts, user dictionary and blocked numbers aside), `com.android.systemui`, `com.android.shell`,
- `com.android.phone`, `com.android.settings`, `com.android.tv.settings` and `android`. An original Mi TV
- Stick never booted again after a list took the first six
+ `com.android.phone`, `com.android.settings`, `com.android.tv.settings` and `android`, nor the TV
+ middleware (`com.cltv.mal`, `com.mediatek.tis`, `com.mediatek.tv.service`, `com.mediatek.tv.agent`:
+ a Haier set restarted in a loop with `com.cltv.mal` off,
+ [#1578](https://github.com/Gathin23/cleanyourtv/issues/1578)). An original Mi TV Stick never booted again after a list took the first six
([#884](https://github.com/Gathin23/cleanyourtv/issues/884)); `tools/disable.sh` refuses such a list.
- Before touching streaming apps, voice assistant, Chromecast, Miracast or the update service, ask me
which ones I use with a checklist question and disable only what I don't tick.
diff --git a/tests/test_core_packages.py b/tests/test_core_packages.py
index 0833eca9e..ce460c191 100644
--- a/tests/test_core_packages.py
+++ b/tests/test_core_packages.py
@@ -10,6 +10,9 @@ Ext services and ext shared also ship under AOSP's bare names, android.ext.servi
android.ext.shared, with no com.android. or com.google.android. in front: the package dumps from an OBE
R3 Ultra (Android 11), a CVTE SMART_TV (Android 12) and a MIBOX4 list both, installed and enabled (#1711).
+The TV middleware is guarded the same way: com.cltv.mal (MediaTek's MAL), com.mediatek.tis, tv.service and
+tv.agent. A Haier H50H5F restarted in a loop after a debloat with com.cltv.mal off (#1578).
+
The PowerShell case needs `pwsh` on PATH and skips without it; CI's Ubuntu runner has it.
"""
import os
@@ -39,6 +42,8 @@ CORE = [
"com.android.providers.downloads",
# AOSP's bare names for the same two modules (#1711).
"android.ext.services", "android.ext.shared",
+ # TV middleware: a Haier H50H5F restarted in a loop with com.cltv.mal off (#1578).
+ "com.cltv.mal", "com.mediatek.tis", "com.mediatek.tv.service", "com.mediatek.tv.agent",
]
# Look alike but are fine: what tested lists disable, and names that only share a prefix.
NOT_CORE = [
@@ -48,6 +53,8 @@ NOT_CORE = [
"com.google.android.tungsten.setupwraith", "com.google.android.apps.tv.launcherx",
"com.android.shell2", "com.example.android.ext.services",
"android.ext.services.overlay", "android.ext.sharedlib", "android.extservices",
+ # Tested lists turn these off: FAST channels, and the Live TV app the factory disables on some sets.
+ "com.cltv.fast", "com.cltv.hybrid", "com.mediatek.tv.settings", "com.mediatek.tis.overlay",
]
diff --git a/tools/check.py b/tools/check.py
index d26f9e9d4..a6934348c 100644
--- a/tools/check.py
+++ b/tools/check.py
@@ -370,7 +370,7 @@ def main():
core = recovery.core_packages(listed)
if core:
# The same refusal as disable.sh: --fix would disable these again (#884).
- sys.stderr.write(f"refusing {list_path}: it disables core Android packages, and without them "
+ sys.stderr.write(f"refusing {list_path}: it disables core Android or TV middleware packages, and without them "
f"the TV may not boot again (#884): {', '.join(core)}. Take these lines out "
f"of the list and run it again. Nothing was checked or changed.\n")
return 2
diff --git a/tools/disable.ps1 b/tools/disable.ps1
index da4edb6be..6fd09eddf 100644
--- a/tools/disable.ps1
+++ b/tools/disable.ps1
@@ -57,12 +57,13 @@ if (-not $pkgs -or $pkgs.Count -eq 0) {
# Core Android packages, the same block as disable.sh: with one of these disabled Android itself can stop
# booting (#884, an original Mi TV Stick). No switch overrides it. Ext services and ext shared also
# ship under AOSP's bare names, android.ext.services and android.ext.shared (#1711). Keep both
-# patterns in step with disable.sh and recovery.py (tests/test_core_packages.py).
-$coreRe = '^(android|android\.ext\.(services|shared)|com\.android\.systemui|com\.android\.shell|com\.android\.phone|com\.android\.settings|com\.android\.tv\.settings|com\.(google\.)?android\.(permissioncontroller|packageinstaller|ext\.services|ext\.shared|modulemetadata)|com\.google\.android\.overlay\.modules.*|com\.android\.providers\..*)$'
+# patterns in step with disable.sh and recovery.py (tests/test_core_packages.py). The TV middleware
+# (com.cltv.mal, com.mediatek.tis / tv.service / tv.agent) is guarded too (#1578, a Haier boot loop).
+$coreRe = '^(android|android\.ext\.(services|shared)|com\.android\.systemui|com\.android\.shell|com\.android\.phone|com\.android\.settings|com\.android\.tv\.settings|com\.(google\.)?android\.(permissioncontroller|packageinstaller|ext\.services|ext\.shared|modulemetadata)|com\.google\.android\.overlay\.modules.*|com\.android\.providers\..*|com\.cltv\.mal|com\.mediatek\.(tis|tv\.service|tv\.agent))$'
$coreOk = '^com\.android\.providers\.(calendar|contacts|userdictionary|blockednumber)$'
$core = @($pkgs | Where-Object { $_ -cmatch $coreRe -and $_ -cnotmatch $coreOk })
if ($core.Count -gt 0) {
- throw "refusing ${List}: it disables core Android packages, and without them the TV may not boot again (#884): $($core -join ', '). Take these lines out of the list (or comment them) and run it again. Nothing was changed on the TV."
+ throw "refusing ${List}: it disables core Android or TV middleware packages, and without them the TV may not boot again (#884, #1578): $($core -join ', '). Take these lines out of the list (or comment them) and run it again. Nothing was changed on the TV."
}
# A Wi-Fi network saved during the first-run wizard belongs to setupwraith, and Android deletes it when
# setupwraith is disabled. Skip it while it owns the saved network; `$env:FORCE_SETUPWRAITH=1` overrides.
diff --git a/tools/disable.sh b/tools/disable.sh
index ec4bb1c4d..10274b334 100755
--- a/tools/disable.sh
+++ b/tools/disable.sh
@@ -59,12 +59,15 @@ fi
# below CORE_OK are the exception: tested lists turn them off and no TV feature uses them.
# Some TVs ship ext services and ext shared under AOSP's bare names, android.ext.services and
# android.ext.shared, with no com.android. or com.google.android. in front (#1711).
+# The TV middleware is guarded the same way: MediaTek's MAL (com.cltv.mal), TV service, agent and input
+# service (com.mediatek.tis). A Haier H50H5F restarted in a loop after a debloat with com.cltv.mal off
+# (#1578), and the Haier-built AQUA MatrixTV list keeps all four.
# Keep CORE_RE and CORE_OK the same in disable.ps1 and recovery.py (tests/test_core_packages.py).
-CORE_RE='^(android|android\.ext\.(services|shared)|com\.android\.systemui|com\.android\.shell|com\.android\.phone|com\.android\.settings|com\.android\.tv\.settings|com\.(google\.)?android\.(permissioncontroller|packageinstaller|ext\.services|ext\.shared|modulemetadata)|com\.google\.android\.overlay\.modules.*|com\.android\.providers\..*)$'
+CORE_RE='^(android|android\.ext\.(services|shared)|com\.android\.systemui|com\.android\.shell|com\.android\.phone|com\.android\.settings|com\.android\.tv\.settings|com\.(google\.)?android\.(permissioncontroller|packageinstaller|ext\.services|ext\.shared|modulemetadata)|com\.google\.android\.overlay\.modules.*|com\.android\.providers\..*|com\.cltv\.mal|com\.mediatek\.(tis|tv\.service|tv\.agent))$'
CORE_OK='^com\.android\.providers\.(calendar|contacts|userdictionary|blockednumber)$'
CORE=$(printf '%s\n' "$PKGS" | grep -E "$CORE_RE" | grep -vE "$CORE_OK" || true)
if [ -n "$CORE" ]; then
- { echo "refusing $LIST: it disables core Android packages, and without them the TV may not boot again (#884):"
+ { echo "refusing $LIST: it disables core Android or TV middleware packages, and without them the TV may not boot again (#884, #1578):"
printf '%s\n' "$CORE" | sed 's/^/ /'
echo "Take these lines out of the list (or comment them) and run it again. Nothing was changed on the TV."; } >&2
exit 1
diff --git a/tools/recovery.py b/tools/recovery.py
index 471325101..66f931df6 100644
--- a/tools/recovery.py
+++ b/tools/recovery.py
@@ -58,7 +58,8 @@ VERSION = 1
# also ship under AOSP's bare names, android.ext.services and android.ext.shared (#1711: an OBE R3
# Ultra, a CVTE SMART_TV and a MIBOX4 list them that way). disable.sh and disable.ps1
# carry the same two patterns (tests/test_core_packages.py keeps the three in step).
-CORE_RE = re.compile(r"^(android|android\.ext\.(services|shared)|com\.android\.systemui|com\.android\.shell|com\.android\.phone|com\.android\.settings|com\.android\.tv\.settings|com\.(google\.)?android\.(permissioncontroller|packageinstaller|ext\.services|ext\.shared|modulemetadata)|com\.google\.android\.overlay\.modules.*|com\.android\.providers\..*)$")
+# The TV middleware too: com.cltv.mal (a Haier H50H5F looped with it off, #1578), com.mediatek.tis, tv.service, tv.agent.
+CORE_RE = re.compile(r"^(android|android\.ext\.(services|shared)|com\.android\.systemui|com\.android\.shell|com\.android\.phone|com\.android\.settings|com\.android\.tv\.settings|com\.(google\.)?android\.(permissioncontroller|packageinstaller|ext\.services|ext\.shared|modulemetadata)|com\.google\.android\.overlay\.modules.*|com\.android\.providers\..*|com\.cltv\.mal|com\.mediatek\.(tis|tv\.service|tv\.agent))$")
CORE_OK = re.compile(r"^com\.android\.providers\.(calendar|contacts|userdictionary|blockednumber)$")