Skip to content

Debloat your Android TV, install apps, browse and transfer files on it, all from your phone. Just 3 MB, no tracking, no root, no PC.

Key launcher priorities by package; one exception in rule 3

jesse-agent-2321dd04ffe221f
diff --git a/README.md b/README.md
index c2424f4..790bb46 100644
--- a/README.md
+++ b/README.md
@@ -108,7 +108,7 @@ Debloating a TV can break it if done carelessly. Tellyscope is built around thes
1. **Disable what came with the TV, never uninstall it.** Tellyscope uses `pm disable-user`, which is reversible from the app or with `pm enable`. Uninstall is offered only for apps `pm list packages -3` lists as installed by the user, and runs plain `pm uninstall` after a confirm that says it can't be undone. Tellyscope never runs `pm uninstall --user 0`, the form that removes a TV's own apps.
2. **Record before changing.** Before the first change on a TV, Tellyscope notes which apps were already off, so **Restore everything** turns back on only what Tellyscope turned off. Every change goes into the TV's history with an Undo. The history lives on the phone and is deleted if you uninstall Tellyscope; a disabled app still shows in the Apps list with **Turn on**.
-3. **Protected list.** Packages the TV needs to boot, install its updates, stay on Wi-Fi, show web pages, show the home screen or accept input are on a protected list. Tellyscope refuses to stop or disable them, and there is no override in the app. A TV's list can add keeps: those only warn in the confirm, and can be overridden. If the TV doesn't say which app is its home screen, Tellyscope refuses to stop or disable anything. The one exception is switching home screens: the old launcher is disabled only after another launcher has become Home and Home has been checked to open it, and the current home screen itself never can be. The one exception: a stock launcher that outranks the rest, e.g. Android TV Home, is turned off first and turned back on if Home still doesn't open the new one. A TV's suggested list never protects fewer apps; its keeps add a warning, not a lock.
+3. **Protected list.** Packages the TV needs to boot, install its updates, stay on Wi-Fi, show web pages, show the home screen or accept input are on a protected list. Tellyscope refuses to stop or disable them, and there is no override in the app. A TV's list can add keeps: those only warn in the confirm, and can be overridden. If the TV doesn't say which app is its home screen, Tellyscope refuses to stop or disable anything. The one exception is switching home screens: the old launcher is disabled only after another launcher has become Home and Home has been checked to open it; a stock launcher that outranks the rest, such as Android TV Home, is turned off first and turned back on if Home still doesn't open the new one. The current home screen itself never can be. A TV's suggested list never protects fewer apps; its keeps add a warning, not a lock.
4. **No root, no exploits.** Only what ADB allows on a stock TV.
5. **Nothing left on the TV.** To show real app names and icons, Tellyscope copies a small helper to `/data/local/tmp`, runs it once and deletes it. The helper only reads through PackageManager: no writes, no permissions, no network.
diff --git a/adb/src/main/kotlin/app/tellyscope/adb/Actions.kt b/adb/src/main/kotlin/app/tellyscope/adb/Actions.kt
index 9b09d3f..80228a0 100644
--- a/adb/src/main/kotlin/app/tellyscope/adb/Actions.kt
+++ b/adb/src/main/kotlin/app/tellyscope/adb/Actions.kt
@@ -87,7 +87,7 @@ class Actions(private val shell: AdbShell) {
Protected.reason(old)?.takeIf { it != ProtectedReason.HOME_SCREEN }?.let { return HomeResult.Refused(it) }
val checked = setHome(to)
val priority = prioritiesIn(homes)
- if (!checked && (priority[from] ?: 0) <= (priority[to] ?: 0)) {
+ if (!checked && (priority[old] ?: 0) <= (priority[pkg] ?: 0)) {
setHome(from)
return HomeResult.Failed("the TV kept its own home screen, so nothing was turned off")
}
@@ -147,14 +147,14 @@ class Actions(private val shell: AdbShell) {
.associateBy { it.substringBefore('/') }
.filterKeys { Protected.reason(it).let { r -> r == null || r == ProtectedReason.HOME_SCREEN } }
- /** Each activity's Home priority, from the `priority=` line `--brief` prints above it. */
+ /** Each package's Home priority, from the `priority=` line `--brief` prints above its activity. */
private fun prioritiesIn(brief: String): Map<String, Int> {
val priorities = mutableMapOf<String, Int>()
var last: Int? = null
for (line in brief.lineSequence().map(String::trim)) {
if (line.startsWith("priority=")) last = line.removePrefix("priority=").substringBefore(' ').toIntOrNull()
else if ('/' in line && ' ' !in line) {
- last?.let { priorities[line] = it }
+ last?.let { priorities[line.substringBefore('/')] = it }
last = null
}
}