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.
Accessibility launchers come from data/launchers.json, signed only
jesse-agent-23293710519f206
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex c12a24c..dd214fa 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -36,7 +36,7 @@ These lists live in this repository, in [`data/`](data/), and the app downloads- `data/labels.json`: names shown for common TV apps when the TV can't tell us.- `data/streaming.json`: the streaming services the Remote can have a button for. Each names a logo, which stays in tellyscope-devices' `logos/` with its source and licence in `SOURCES.md`.-Which launchers may turn on an accessibility service is not on any list: it's `ACCESSIBILITY_LAUNCHERS` in [`Launchers.kt`](app/src/main/java/app/tellyscope/data/Launchers.kt), because an accessibility service can read the screen. Add one only for a launcher that keeps Home with its own accessibility service: check the APK's manifest for a service with `BIND_ACCESSIBILITY_SERVICE` and put the version you checked next to it. `LaunchersTest` names every such launcher on purpose, so add yours there too and a reviewer sees it.+A launcher that keeps Home with its own accessibility service carries `"accessibility": "<version>"` in `data/launchers.json`, and only those may have that service turned on. An accessibility service can read the screen, so the field counts only while `data/` passes its signature check: while it fails, Tellyscope turns no launcher's service on, even when you've ticked that you trust the list. Add the field only after checking the APK's manifest for a service with `BIND_ACCESSIBILITY_SERVICE`, with the version you checked as its value. `DataListsTest` names every such launcher on purpose, so add yours there too and a reviewer sees it.The tests use small fixtures in [`app/src/test/resources/fixtures/`](app/src/test/resources/fixtures/) that only check the code: change the real debloat lists in tellyscope-devices and the others in `data/`, not there. The app itself bundles none.diff --git a/README.md b/README.mdindex ca520a3..447be35 100644--- a/README.md+++ b/README.md@@ -96,7 +96,7 @@ Tellyscope downloads two sets of public lists from GitHub, so they can change wi- Remove protection. The built-in protected list always wins, and `protected.json` can only add to it.- Choose an APK to install without a signature. Which launcher APK may be installed, where it downloads from and who must have signed it come only from `data/launchers.json`, and `data/` is signed by the maintainer. Your own lists can't change them. If `data/` fails its signature check, Tellyscope shows the list and its signer and asks before installing anything from it.-- Turn on an accessibility service. The launchers allowed one are built into the app.+- Turn on an accessibility service, unless `data/` passes its signature check. Only `data/launchers.json` names the launchers that may have one, so your own lists can't, and while `data/` fails its check none can.## Get itdiff --git a/adb/src/main/kotlin/app/tellyscope/adb/HomeServices.kt b/adb/src/main/kotlin/app/tellyscope/adb/HomeServices.ktindex 938c0a3..6ea9e32 100644--- a/adb/src/main/kotlin/app/tellyscope/adb/HomeServices.kt+++ b/adb/src/main/kotlin/app/tellyscope/adb/HomeServices.kt@@ -3,7 +3,8 @@ package app.tellyscope.adb/*** The `enabled_accessibility_services` setting, for launchers that keep Home with their own- * accessibility service. Which launchers those are is the app's `ACCESSIBILITY_LAUNCHERS`.+ * accessibility service. Which launchers those are is the app's `data/launchers.json`, its `accessibility`+ * entries, and only while that list passes its signature check.*/object HomeServices {/** [list] is the `enabled_accessibility_services` setting: colon-separated, "null" when unset. */diff --git a/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt b/app/src/main/java/app/tellyscope/data/AdbDeviceSource.ktindex 7188392..6ba2ce1 100644--- a/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt+++ b/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt@@ -99,8 +99,8 @@ class AdbDeviceSource(@Volatile private var paused = falseprivate val hits = ConcurrentHashMap<String, ScanHit>()private val store = DeviceStore(File(appContext.filesDir, "devices.tsv"))- /** Launchers whose accessibility service a switch may turn on: only the built-in ones. */- private val serviceLaunchers = ACCESSIBILITY_LAUNCHERS.keys+ /** Launchers whose accessibility service a switch may turn on: only from a `data/` that passes its check. */+ private val serviceLaunchers get() = SharedLists.serviceLaunchersprivate val saved = ConcurrentHashMap<String, SavedDevice>()/** Remembered TVs that haven't answered since launch: shown offline, not "connecting". */private val restoring = ConcurrentHashMap.newKeySet<String>()@@ -1380,12 +1380,12 @@ internal suspend fun fireHomeBack(}/**- * Turns accessibility [service] on, only for a launcher in [ACCESSIBILITY_LAUNCHERS]. Every path that- * turns one on comes here, so neither a fetched list nor a saved record can name another; false- * for any other, as for a TV that refused.+ * Turns accessibility [service] on, only for a launcher in [SharedLists.serviceLaunchers]. Every path+ * that turns one on comes here, so neither an unsigned list nor a saved record can name another;+ * false for any other, as for a TV that refused.*/internal suspend fun Actions.grant(service: String): Boolean =- service.substringBefore('/') in ACCESSIBILITY_LAUNCHERS && setService(service, true)+ service.substringBefore('/') in SharedLists.serviceLaunchers && setService(service, true)/*** The rest of [switch]'s Undo once its old launcher is on again: Home back to that launcher, thediff --git a/app/src/main/java/app/tellyscope/data/Launchers.kt b/app/src/main/java/app/tellyscope/data/Launchers.ktindex af82f49..98957f2 100644--- a/app/src/main/java/app/tellyscope/data/Launchers.kt+++ b/app/src/main/java/app/tellyscope/data/Launchers.kt@@ -10,22 +10,14 @@ import kotlinx.coroutines.flow.asStateFlowimport kotlinx.coroutines.flow.update/**- * Launchers that keep Home with their own accessibility service, for TVs whose Home button opens- * their own launcher whatever the default is, so Make Home turns that service on, and Undo or a- * switch away from it turns it off. Each with the version whose manifest was read. Built in, never- * fetched: an accessibility service can read the screen, so only a list reviewed here may turn one on.- */-val ACCESSIBILITY_LAUNCHERS = mapOf(- "com.spocky.projengmenu" to "4.72",- "com.overdevs.at4k" to "1.2",- "com.spauldhaliwal.dispatch" to "1.0.175",-)--/**- * A third-party launcher Tellyscope knows, from `launchers.json`. [accessibility] is whether it is- * one of [ACCESSIBILITY_LAUNCHERS], never what the list says. [about] is the line Install a home+ * A third-party launcher Tellyscope knows, from `launchers.json`. [about] is the line Install a home* screen shows; a launcher without one isn't offered there.*+ * [accessibility]: it keeps Home with its own accessibility service, for TVs whose Home button opens+ * their own launcher whatever the default is, so Make Home turns that service on, and Undo or a switch+ * away from it turns it off. The value is the version whose manifest was read. An accessibility service+ * can read the screen, so [SharedLists] keeps it only while `data/` passes its signature check.+ ** Installing it from an APK rather than the Play Store: [signers] are the SHA-256s of the only* certificates it may be signed with (empty: never from an APK), [maxBytes] is past any real copy of* it, and [releases] is its developer's GitHub releases page, the only place the GitHub build@@ -39,9 +31,8 @@ data class KnownLauncher(val maxBytes: Long = DEFAULT_MAX_MB shl 20,val releases: String? = null,val fireOs: Boolean = false,+ val accessibility: String? = null,) {- val accessibility get() = pkg in ACCESSIBILITY_LAUNCHERS-/** It, signed only by its developer: [signers] are the SHA-256s of an APK's certificates. */fun accepts(packageName: String, signers: Set<String>) =packageName == pkg && signers.isNotEmpty() && this.signers.isNotEmpty() && this.signers.containsAll(signers)@@ -50,6 +41,7 @@ data class KnownLauncher(private const val DEFAULT_MAX_MB = 64Lprivate const val MAX_MB = 256Lprivate val SIGNER = Regex("[0-9a-f]{64}")+private val CHECKED = Regex("[0-9][0-9A-Za-z.+-]{0,31}")// "." and ".." are not repo names; they would walk the URL out of the repo.private val RELEASES_PAGE = Regex("https://github\\.com/[A-Za-z0-9-]+/(?!\\.\\.?/)[A-Za-z0-9._-]+/releases")@@ -67,6 +59,7 @@ fun parseLaunchers(text: String): List<KnownLauncher> = try {maxBytes = l.optLong("max_mb", DEFAULT_MAX_MB).coerceIn(1, MAX_MB) shl 20,releases = l.optStringOrNull("releases")?.takeIf(RELEASES_PAGE::matches),fireOs = l.optBoolean("fire_os"),+ accessibility = (l.opt("accessibility") as? String)?.takeIf(CHECKED::matches),).takeIf { PACKAGE.matches(it.pkg) && it.name.isNotEmpty() }}} catch (_: org.json.JSONException) {@@ -147,6 +140,8 @@ object SharedLists {val streaming get() = _state.value.streaming/** `data/`'s address while it fails its check, or null: installing a launcher from it asks first. */val unverified get() = _state.value.unverified+ /** Launchers whose accessibility service may go on ([KnownLauncher.accessibility]): none while `data/` fails its check. */+ val serviceLaunchers: Set<String> get() = launchers.filter { it.accessibility != null }.mapTo(HashSet()) { it.pkg }@Volatile private var data: DeviceLists? = null@Volatile private var source: DeviceLists? = null@@ -181,8 +176,10 @@ object SharedLists {val streaming = data("streaming")?.let(::parseStreaming)val protected = source("protected")?.let(::parseProtected)_state.update { now ->+ val kept = launchers?.ifEmpty { null } ?: now.launchersnow.copy(- launchers = launchers?.ifEmpty { null } ?: now.launchers,+ // Unsigned, a list can't say a launcher's accessibility service may go on.+ launchers = if (verified) kept else kept.map { it.copy(accessibility = null) },labels = labels?.ifEmpty { null } ?: now.labels,streaming = streaming?.ifEmpty { null } ?: now.streaming,protected = protected?.ifEmpty { null } ?: now.protected,diff --git a/app/src/main/java/app/tellyscope/ui/Recommended.kt b/app/src/main/java/app/tellyscope/ui/Recommended.ktindex cc98797..7125850 100644--- a/app/src/main/java/app/tellyscope/ui/Recommended.kt+++ b/app/src/main/java/app/tellyscope/ui/Recommended.kt@@ -21,7 +21,7 @@ data class Recommended(/** In the picker's order: the launchers on `launchers.json` that have an `about` line, in file order. */val RECOMMENDED: List<Recommended> get() =- SharedLists.launchers.mapNotNull { l -> l.about?.let { Recommended(l.pkg, l.name, it, l.accessibility, l) } }+ SharedLists.launchers.mapNotNull { l -> l.about?.let { Recommended(l.pkg, l.name, it, l.accessibility != null, l) } }fun launcherName(pkg: String) = RECOMMENDED.firstOrNull { it.pkg == pkg }?.name ?: AppNames.fallback(pkg)diff --git a/app/src/test/java/app/tellyscope/DataListsTest.kt b/app/src/test/java/app/tellyscope/DataListsTest.ktindex e330dcc..a7186dc 100644--- a/app/src/test/java/app/tellyscope/DataListsTest.kt+++ b/app/src/test/java/app/tellyscope/DataListsTest.kt@@ -32,6 +32,7 @@ class DataListsTest {private val signer = Regex("[0-9a-f]{64}")// "." and ".." are not repo names; they would walk the URL out of the repo.private val releases = Regex("https://github\\.com/[A-Za-z0-9-]+/(?!\\.\\.?/)[A-Za-z0-9._-]+/releases")+ private val checked = Regex("[0-9][0-9A-Za-z.+-]{0,31}")/** The Remote's sheet in dark mode; a service's `dark` fill replaces a colour that sinks into it. */private val darkSheet = 0xFF161D1D@@ -51,8 +52,7 @@ class DataListsTest {val entries = schema1("launchers.json").getJSONArray("launchers").objects()entries.forEachIndexed { i, l ->val where = "launchers.json: launcher ${i + 1}"- // Install details only: a list never asks for an accessibility service.- val unknown = l.keys().asSequence().toSet() - setOf("package", "name", "about", "signers", "max_mb", "releases", "fire_os")+ val unknown = l.keys().asSequence().toSet() - setOf("package", "name", "about", "signers", "max_mb", "releases", "fire_os", "accessibility")if (unknown.isNotEmpty()) errors += "$where: unknown keys ${unknown.sorted()}"val pkg = l.optString("package")if (!package_.matches(pkg)) errors += "$where: not a package name: $pkg"@@ -64,6 +64,9 @@ class DataListsTest {}if (l.has("max_mb") && (l.opt("max_mb") as? Int)?.takeIf { it in 1..256 } == null) errors += "$where: 'max_mb' must be a whole number from 1 to 256"if (l.has("releases") && !releases.matches(l.optString("releases"))) errors += "$where: 'releases' must be https://github.com/<owner>/<repo>/releases"+ if (l.has("accessibility") && (l.opt("accessibility") as? String)?.takeIf(checked::matches) == null) {+ errors += "$where: 'accessibility' must be the version whose manifest you checked, like \"4.72\""+ }if (l.has("fire_os") && l.opt("fire_os") != true) errors += "$where: 'fire_os' can only be true; leave it out otherwise"if (l.opt("fire_os") == true) {fire += pkg@@ -76,6 +79,15 @@ class DataListsTest {assertNone(errors)}+ /**+ * Named here on purpose, so a reviewer sees any launcher that gets to turn on an accessibility service,+ * which can read the screen. Adding one means adding it here too.+ */+ @Test fun theLaunchersWithAnAccessibilityServiceAreNamed() {+ val named = parseLaunchers(text("launchers.json")).filter { it.accessibility != null }.associate { it.pkg to it.accessibility }+ assertEquals(mapOf("com.spocky.projengmenu" to "4.72", "com.overdevs.at4k" to "1.2", "com.spauldhaliwal.dispatch" to "1.0.175"), named)+ }+@Test fun labels() {val errors = mutableListOf<String>()val seen = mutableSetOf<String>()diff --git a/app/src/test/java/app/tellyscope/DataSignatureTest.kt b/app/src/test/java/app/tellyscope/DataSignatureTest.ktindex 93e264d..2ce902d 100644--- a/app/src/test/java/app/tellyscope/DataSignatureTest.kt+++ b/app/src/test/java/app/tellyscope/DataSignatureTest.kt@@ -168,6 +168,21 @@ class DataSignatureTest {assertNull(SharedLists.unverified)}+ /** `accessibility` counts only while `data/` passes: unsigned, every launcher's is dropped and none may turn its service on. */+ @Test fun aLaunchersAccessibilityCountsOnlyWhenDataPasses() = runTest {+ val file = """{"schema":1,"launchers":[{"package":"com.good.home","name":"Good","accessibility":"1.0"}]}""".toByteArray()+ val none = DeviceLists(tmp.newFolder()) { throw IOException("offline $it") }+ val signedIndex = index(2026110301, file).let { withSigs(it, p256(it)) }+ SharedLists.load(lists(tmp.newFolder(), Served(mapOf("index.json" to signedIndex, "launchers.json" to file))), none, fresh = true)+ assertEquals(setOf("com.good.home"), SharedLists.serviceLaunchers)+ assertEquals("1.0", SharedLists.launchers.single().accessibility)++ SharedLists.load(lists(tmp.newFolder(), Served(mapOf("index.json" to index(2026110301, file), "launchers.json" to file))), none, fresh = true)+ assertEquals(DATA_BASE, SharedLists.unverified)+ assertEquals(emptySet<String>(), SharedLists.serviceLaunchers)+ assertNull(SharedLists.launchers.single().accessibility)+ }+/*** The app and the Data check trust the same keys: [DATA_KEYS] is every key in the `.pub` files in* `tools/data-keys/`, read as `tools/data.py` reads them (`#` lines are comments, a file with no key is adiff --git a/app/src/test/java/app/tellyscope/HostileSourceTest.kt b/app/src/test/java/app/tellyscope/HostileSourceTest.ktindex 0f5dd98..6a8082f 100644--- a/app/src/test/java/app/tellyscope/HostileSourceTest.kt+++ b/app/src/test/java/app/tellyscope/HostileSourceTest.kt@@ -233,7 +233,7 @@ class HostileSourceTest {@Test fun aLauncherEntryCannotAskForAccessibility() = runTest {val l = parseLaunchers("""{"schema": 1, "launchers": [{"package": "com.evil.home", "name": "Evil", "about": "x", "accessibility": true, "service": "com.evil.home/.Spy"}]}""").single()- assertFalse(l.accessibility)+ assertNull(l.accessibility)assertFalse(actions.grant("com.evil.home/.Spy"))assertEquals(emptyList<String>(), ran)}diff --git a/app/src/test/java/app/tellyscope/LaunchersTest.kt b/app/src/test/java/app/tellyscope/LaunchersTest.ktindex 4b822dd..3dca304 100644--- a/app/src/test/java/app/tellyscope/LaunchersTest.kt+++ b/app/src/test/java/app/tellyscope/LaunchersTest.kt@@ -4,7 +4,6 @@ package app.tellyscopeimport app.tellyscope.adb.Protectedimport app.tellyscope.adb.ProtectedReason-import app.tellyscope.data.ACCESSIBILITY_LAUNCHERSimport app.tellyscope.data.DATA_BASEimport app.tellyscope.data.DeviceListsimport app.tellyscope.data.LISTS_BASE@@ -39,9 +38,10 @@ class LaunchersTest {assertEquals(launchers.size, launchers.map { it.pkg }.toSet().size)}- /** Named here on purpose, so a reviewer sees any launcher that gets to turn on an accessibility service. */- @Test fun onlyTheBuiltInLaunchersMayTurnOnAnAccessibilityService() {- assertEquals(setOf("com.spocky.projengmenu", "com.overdevs.at4k", "com.spauldhaliwal.dispatch"), ACCESSIBILITY_LAUNCHERS.keys)+ /** The real list's are named in [DataListsTest.theLaunchersWithAnAccessibilityServiceAreNamed]. */+ @Test fun aLauncherWithAccessibilityMayTurnItsServiceOn() {+ assertEquals(setOf("com.spocky.projengmenu"), SharedLists.serviceLaunchers)+ assertEquals("4.72", SharedLists.launchers.first { it.pkg == "com.spocky.projengmenu" }.accessibility)}@Test fun theRecommendedOnesAreTheLaunchersWithAnAboutLineInFileOrder() {@@ -70,7 +70,7 @@ class LaunchersTest {assertTrue(parseLabels("{").isEmpty())}- /** A list from someone's fork can't grant an accessibility service: only [ACCESSIBILITY_LAUNCHERS] can. */+ /** `accessibility` is the version checked, so `true` is no answer; whether it counts is [SharedLists]' call. */@Test fun badEntriesAreDroppedAndOnlySchemaOneCounts() {val text = """{"schema":1,"launchers":[{"package":"com.good.launcher","name":"Good","accessibility":true},@@ -79,7 +79,7 @@ class LaunchersTest {"not an object"]}"""assertEquals(listOf(KnownLauncher("com.good.launcher", "Good")), parseLaunchers(text))- assertTrue(parseLaunchers(text).none { it.accessibility })+ assertTrue(parseLaunchers(text).none { it.accessibility != null })assertTrue(parseLaunchers(text.replace("\"schema\":1", "\"schema\":2")).isEmpty())assertTrue(parseLaunchers("{").isEmpty())}diff --git a/app/src/test/resources/fixtures/launchers.json b/app/src/test/resources/fixtures/launchers.jsonindex 1b3a84e..0b10346 100644--- a/app/src/test/resources/fixtures/launchers.json+++ b/app/src/test/resources/fixtures/launchers.json@@ -3,7 +3,7 @@"launchers": [{ "package": "com.spocky.projengmenu", "name": "Projectivy Launcher", "about": "The most popular. Rows, wallpapers and icons you can change.","signers": ["f6697bf4082ee97511e4de07863193884a015b7ab5860430321bda1042b0aadd"], "max_mb": 64,- "releases": "https://github.com/spocky/miproja1/releases", "fire_os": true },+ "releases": "https://github.com/spocky/miproja1/releases", "fire_os": true, "accessibility": "4.72" },{ "package": "me.efesser.flauncher", "name": "FLauncher", "about": "Simple: your apps in rows, nothing else." },{ "package": "com.wolf.firelauncher", "name": "Wolf Launcher" }]diff --git a/data/index.json b/data/index.jsonindex d9e2ca5..3686581 100644--- a/data/index.json+++ b/data/index.json@@ -1,11 +1,10 @@{- "sigs": ["p256:MEUCIQCHc2UIDDJfANXcX4CHWXdVnutrMAcUGlrMWQ4XrcG8YgIgIfGCBE7vNCw1jhf8CQJNF73Dns/ubruTRSYC3oMOv+s="],"schema": 1,- "version": 2026110302,+ "version": 2026110303,"lists": {"launchers": {"file": "launchers.json",- "sha256": "53bf057e8ed7eb58b517e14d1cf82392e67227ceea9a4dd670d9c11e2c6349d9"+ "sha256": "532ba027e461185fbd9c7ef2e34db75d29c76f81292c65840abefa974b8fe0c7"},"labels": {"file": "labels.json",diff --git a/data/launchers.json b/data/launchers.jsonindex 6b9c952..0b2ec91 100644--- a/data/launchers.json+++ b/data/launchers.json@@ -3,7 +3,9 @@"launchers": [{ "package": "com.spocky.projengmenu", "name": "Projectivy Launcher", "about": "The most popular. Rows, wallpapers and icons you can change.","signers": ["f6697bf4082ee97511e4de07863193884a015b7ab5860430321bda1042b0aadd"], "max_mb": 64,- "releases": "https://github.com/spocky/miproja1/releases", "fire_os": true },- { "package": "me.efesser.flauncher", "name": "FLauncher", "about": "Simple: your apps in rows, nothing else." }+ "releases": "https://github.com/spocky/miproja1/releases", "fire_os": true, "accessibility": "4.72" },+ { "package": "me.efesser.flauncher", "name": "FLauncher", "about": "Simple: your apps in rows, nothing else." },+ { "package": "com.overdevs.at4k", "name": "AT4K Launcher", "accessibility": "1.2" },+ { "package": "com.spauldhaliwal.dispatch", "name": "Dispatch", "accessibility": "1.0.175" }]}