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.

Launchers, app names and streaming lists come from data/

jesse-agent-2329778a91b4ddc
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 33850b0..26490d2 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -26,19 +26,19 @@ The per-TV lists behind **Debloat** and the Overview's list card live in the [te
### Using your own lists
-You don't have to trust ours. Fork tellyscope-devices, edit the lists in your fork, and keep `index.json` on schema 1 with each file's sha256 updated. Then in the app open **Settings** (in the ⋮ menu at the top right), open **Advanced** at the bottom, tap **Use your own debloat lists**, and paste the raw address of the folder that holds `index.json`, for example `https://raw.githubusercontent.com/<you>/tellyscope-devices/main/`. Only HTTPS is accepted, and a source that doesn't serve a schema 1 index is refused without changing anything. Switching drops the cached lists. While your source is in use, the review step says where the list came from. The built-in protected list still wins over any list, and **Reset to default** goes back to tellyscope-devices.
+You don't have to trust ours. Fork tellyscope-devices, edit the lists in your fork, and keep `index.json` on schema 1 with each file's sha256 updated. Then in the app open **Settings** (in the ⋮ menu at the top right), open **Advanced** at the bottom, tap **Use your own debloat lists**, and paste the raw address of the folder that holds `index.json`, for example `https://raw.githubusercontent.com/<you>/tellyscope-devices/main/`. Only HTTPS is accepted, and a source that doesn't serve a schema 1 index is refused without changing anything. Switching drops the cached lists. While your source is in use, the review step says where the list came from. Your source supplies only debloat lists and extra protected apps: launchers, app names and streaming services always come from this repository's `data/`. The built-in protected list still wins over any list, and **Reset to default** goes back to tellyscope-devices.
## Launchers, app names and streaming services
-These lists live in tellyscope-devices too, next to the debloat lists, and the app downloads them from the same source: change one there with a pull request and it reaches people without an app release. A fork's source supplies them as well. File formats and checks are in that repo's README.
+These lists live in this repository, in [`data/`](data/), and the app downloads them from `main`: change one here with a pull request, and it reaches people once it's on `main`, without an app release. Keep `data/index.json` in step: it gives each file's sha256, and the app uses only files that match. [`DataListsTest`](app/src/test/java/app/tellyscope/DataListsTest.kt) checks the lists, the logos and the index, and says which sha256 changed. tellyscope-devices still has older copies that earlier versions of the app download; they're frozen until they're retired, so don't edit them there. File formats are in that repo's README.
-- `lists/launchers.json`: the third-party launchers Tellyscope knows. One with an `"about"` line is offered in **Install a home screen**, in the file's order. On Fire OS, which has no Play Store, only Projectivy is offered, while it's on the list: Tellyscope downloads it from its developer's GitHub releases and installs only an APK signed with the certificate pinned in [`LauncherDownload.kt`](app/src/main/java/app/tellyscope/data/LauncherDownload.kt). On Android TV the same download is offered as **Download directly**, under the Play Store and after a warning. Projectivy is the only launcher with a pinned release and signer, so it's the only one offered either way (`downloadable` in [`LauncherFlowUi.kt`](app/src/main/java/app/tellyscope/ui/LauncherFlowUi.kt)).
-- `lists/labels.json`: names shown for common TV apps when the TV can't tell us.
-- `lists/streaming.json` and `logos/`: the streaming services the Remote can have a button for, with their logos.
+- `data/launchers.json`: the third-party launchers Tellyscope knows. One with an `"about"` line is offered in **Install a home screen**, in the file's order. On Fire OS, which has no Play Store, only Projectivy is offered, while it's on the list: Tellyscope downloads it from its developer's GitHub releases and installs only an APK signed with the certificate pinned in [`LauncherDownload.kt`](app/src/main/java/app/tellyscope/data/LauncherDownload.kt). On Android TV the same download is offered as **Download directly**, under the Play Store and after a warning. Projectivy is the only launcher with a pinned release and signer, so it's the only one offered either way (`downloadable` in [`LauncherFlowUi.kt`](app/src/main/java/app/tellyscope/ui/LauncherFlowUi.kt)).
+- `data/labels.json`: names shown for common TV apps when the TV can't tell us.
+- `data/streaming.json` and `data/logos/`: the streaming services the Remote can have a button for, with their logos.
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.
-The tests use small fixtures in [`app/src/test/resources/fixtures/`](app/src/test/resources/fixtures/) that only check the code: change the real lists in tellyscope-devices, not there. The app itself bundles none.
+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.
## README screenshots
diff --git a/README.md b/README.md
index 8764a63..229c4dd 100644
--- a/README.md
+++ b/README.md
@@ -52,7 +52,7 @@ Tellyscope talks to your Android TV, Google TV, NVIDIA Shield or Fire TV over Wi
- **Connect.** Finds TVs on your Wi-Fi, looking again every 10 seconds or when you tap **Rescan**, or add one by IP. Works with network debugging and with Android 11+ wireless debugging and its pairing code. TVs reconnect by themselves.
- **See how it's doing.** Free space, CPU, RAM and network speed, plus what's paired or plugged in. **Advanced monitor** has CPU and RAM by app, processes, network and data used.
-- **Debloat.** Matches your TV to one of 330+ tested lists (adapted from [cleanyourtv](https://github.com/Gathin23/cleanyourtv)) and shows every app it will turn off before it does. Untick anything you use, or a whole group from its heading, then watch each app turn off. No list for your model? Pick from the maker's lists, or by hand.
+- **Debloat.** Matches your TV to one of 330+ tested lists (adapted from [cleanyourtv](https://github.com/Gathin23/cleanyourtv), kept in [tellyscope-devices](../../../tellyscope-devices)) and shows every app it will turn off before it does. Untick anything you use, or a whole group from its heading, then watch each app turn off. No list for your model? Pick from the maker's lists, or by hand.
- **Apps.** See what's running and what's on the TV. Turn off apps you don't want, turn them back on any time, and uninstall the ones you added yourself.
- **Install apps.** From an APK, split APKs or an `.apks`/`.xapk`/`.apkm` bundle on your phone; the picker opens in Downloads and shows only apps. It says first whether it's new, an update or an older version.
- **A better home screen.** Install Projectivy or FLauncher and make it Home. Android TV installs it from the TV's Play Store, or Projectivy can be downloaded directly after a warning. Fire TV has no Play Store, so Tellyscope downloads Projectivy from its developer's GitHub releases and installs it only if its signature matches. Switch between launchers, or back to the TV's own, from the Home screen card in Tweaks; only the TV's own is ever turned off. A launcher's accessibility service turns on only if you say yes.
@@ -83,7 +83,20 @@ Debloating a TV can break it if done carelessly. Tellyscope keeps to these rules
4. **You see it first.** Every change names the apps it touches and asks before it runs.
5. **No root, no exploits.** Only what ADB allows on a stock TV.
6. **Nothing left on the TV.** Two small helpers run from `/data/local/tmp`: one reads app names and icons and is deleted at once, the other runs the Remote and is deleted when the Remote closes.
-7. **Private.** No ads, tracking or accounts. The only internet requests fetch the shared lists from GitHub (debloat lists, launchers, app names and streaming services with their logos, or [your own fork](CONTRIBUTING.md#using-your-own-lists)), check for a new version every 30 minutes, which you can turn off in Settings, and download Projectivy from its developer's GitHub releases when you ask for it. Everything else stays on your Wi-Fi, except the DNS lookup of each TV's name during the scan.
+7. **Private.** No ads, tracking or accounts. The only internet requests fetch the [shared lists](#the-shared-lists) from GitHub (debloat lists, or [your own fork](CONTRIBUTING.md#using-your-own-lists), plus launchers, app names and streaming services with their logos), check for a new version every 30 minutes, which you can turn off in Settings, and download Projectivy from its developer's GitHub releases when you ask for it. Everything else stays on your Wi-Fi, except the DNS lookup of each TV's name during the scan.
+
+## The shared lists
+
+Tellyscope downloads two sets of public lists from GitHub, so they can change without an app release. Both histories are public.
+
+- **Debloat lists and extra protected apps**, from [tellyscope-devices](../../../tellyscope-devices). [Your own lists](CONTRIBUTING.md#using-your-own-lists) replace these, and only these.
+- **Launchers, app names and streaming services with their logos**, from this repository's [`data/`](data/) on `main`, where changes are reviewed alongside the app's code.
+
+**What the lists can't do:**
+
+- Remove protection. The built-in protected list always wins, and `protected.json` can only add to it.
+- Choose an APK to install. The only launcher Tellyscope downloads is Projectivy, from the release page and signer pinned in the app; `launchers.json` only decides whether it's offered.
+- Turn on an accessibility service. The launchers allowed one are built into the app.
## Get it
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index daf9b05..8a34963 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -31,6 +31,11 @@ android {
applicationIdSuffix = ".alpha"
versionNameSuffix = "-alpha.$run"
}
+
+ // Where the launcher, app name and streaming lists are downloaded from (DATA_BASE). Before
+ // data/ is on main, -Ptellyscope.data=<raw folder URL ending in /> tries it from a branch.
+ val data = providers.gradleProperty("tellyscope.data").orNull ?: "https://raw.githubusercontent.com/man15h/tellyscope/main/data/"
+ buildConfigField("String", "DATA_BASE", "\"$data\"")
}
// Only the languages Tellyscope is translated into: drops the ~80 other locales AndroidX and
@@ -79,6 +84,7 @@ android {
buildFeatures {
compose = true
+ buildConfig = true
}
// The helpers' pure parts (BannerColors) are unit-tested like app code.
diff --git a/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt b/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt
index 58a237f..a54a047 100644
--- a/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt
+++ b/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt
@@ -129,12 +129,14 @@ class AdbDeviceSource(
private val helperDex by lazy { appContext.assets.open("label-helper.jar").use { it.readBytes() } }
private val appNames = AppNames(File(appContext.filesDir, "app-names"))
private val lists = DeviceLists(File(appContext.filesDir, "lists"))
+ /** `data/`'s launcher, app name and streaming lists and logos; never the user's source. */
+ private val data = DeviceLists(File(appContext.filesDir, "data"), default = DATA_BASE)
/** [historyKey] → the keep entries of that TV's list, once it has been looked up. */
private val keep = ConcurrentHashMap<String, Set<String>>()
init {
Connector.init(File(appContext.filesDir, "adbkey.pem"))
- scope.launch(Dispatchers.IO) { SharedLists.load(lists) }
+ scope.launch(Dispatchers.IO) { SharedLists.load(data, lists) }
}
/** Remembered TVs reconnect in the background from launch; [known] waits for the file read. */
@@ -909,7 +911,7 @@ class AdbDeviceSource(
when (lists.setSource(url)) {
SourceResult.Ok -> {
keep.clear() // the old source's keep entries
- scope.launch(Dispatchers.IO) { SharedLists.load(lists, fresh = true) }
+ scope.launch(Dispatchers.IO) { SharedLists.load(data, lists, fresh = true) }
}
SourceResult.NotHttps -> throw UiTextException(UiText(R.string.data_lists_not_https))
SourceResult.Unreachable -> throw UiTextException(UiText(R.string.data_lists_unreachable))
diff --git a/app/src/main/java/app/tellyscope/data/DeviceLists.kt b/app/src/main/java/app/tellyscope/data/DeviceLists.kt
index 936eabc..187c1e1 100644
--- a/app/src/main/java/app/tellyscope/data/DeviceLists.kt
+++ b/app/src/main/java/app/tellyscope/data/DeviceLists.kt
@@ -2,6 +2,7 @@
package app.tellyscope.data
+import app.tellyscope.BuildConfig
import app.tellyscope.R
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.Dispatchers
@@ -15,11 +16,14 @@ import java.net.HttpURLConnection
import java.net.URL
import java.security.MessageDigest
+/** Where the per-TV debloat lists and the extra protected apps live: the tellyscope-devices repo. */
+const val LISTS_BASE = "https://raw.githubusercontent.com/man15h/tellyscope-devices/main/"
+
/**
- * Where the per-TV debloat lists live, with the launcher, app name and streaming lists and the
- * Remote's logos: the tellyscope-devices repo.
+ * Where the launcher, app name and streaming lists and the Remote's logos live: `data/` in this
+ * app's own repo, on `main`. `-Ptellyscope.data=<folder>` points a build elsewhere, to try a branch.
*/
-const val LISTS_BASE = "https://raw.githubusercontent.com/man15h/tellyscope-devices/main/"
+val DATA_BASE: String = BuildConfig.DATA_BASE
/** One row of `index.json`. [match] is null for lists nobody has matched to a TV yet. */
data class ListEntry(
@@ -102,7 +106,7 @@ fun merge(maker: String, lists: List<DeviceList>): DeviceList = DeviceList(
/** A file the index names outside `devices/`, checked against [sha256] like a device file. */
data class ListFile(val file: String, val sha256: String)
-/** [lists] by name (`launchers`, `labels`, `streaming`, `protected`) and [logos] by logo name; empty on an index from before they moved here. */
+/** [lists] by name (`launchers`, `labels`, `streaming`, `protected`) and [logos] by logo name; empty on an index without them. */
data class ListIndex(
val commit: String?,
val devices: List<ListEntry>,
@@ -154,7 +158,8 @@ sealed interface Suggestions {
/** Same rule tellyscope-devices checks; a name goes into a `pm` shell line. */
internal val PACKAGE = Regex("[A-Za-z][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)+")
private val FILE = Regex("devices/[A-Za-z0-9][A-Za-z0-9._-]*\\.json")
-private val LIST_FILE = Regex("lists/[a-z]+\\.json")
+/** Under `lists/` in tellyscope-devices, at the top of `data/`; never the index's own name. */
+private val LIST_FILE = Regex("(lists/)?(?!index\\.json)[a-z]+\\.json")
private val LOGO_FILE = Regex("logos/[a-z0-9]+\\.png")
private val SHA256 = Regex("[0-9a-f]{64}")
/** A list id goes into `picks.tsv`, one tab-separated line per TV, so no tab or newline. */
@@ -174,13 +179,13 @@ fun matches(rule: Map<String, List<String>>?, props: Map<String, String?>): Bool
/**
* Null unless it is a schema 1 index. Entries with a missing field, bad file name or checksum are
- * dropped, in `devices`, `lists` and `logos` alike.
+ * dropped, in `devices`, `lists` and `logos` alike. `data/`'s index has no `devices`.
*/
fun parseIndex(text: String): ListIndex? = try {
val o = jsonObject(text)
if (o.optInt("schema") != SCHEMA) null else ListIndex(
commit = o.optJSONObject("source")?.optStringOrNull("commit")?.takeIf { COMMIT.matches(it) },
- devices = o.getJSONArray("devices").objectsOrSkip { d ->
+ devices = o.optJSONArray("devices")?.objectsOrSkip { d ->
ListEntry(
id = d.getString("id"),
name = plainText(d.getString("name"), NAME_MAX),
@@ -191,7 +196,7 @@ fun parseIndex(text: String): ListIndex? = try {
file = d.getString("file"),
sha256 = d.getString("sha256"),
).takeIf { LIST_ID.matches(it.id) && it.name.isNotEmpty() && FILE.matches(it.file) && SHA256.matches(it.sha256) }
- },
+ }.orEmpty(),
lists = o.files("lists", LIST_FILE),
logos = o.files("logos", LOGO_FILE),
)
@@ -251,34 +256,36 @@ fun suggest(list: DeviceList, apps: List<AppInfo>, sdk: Int?): List<SuggestedGro
}
/**
- * Fetches and caches the index, device files, lists and logos under [dir]. A failed fetch falls
- * back to the cache; a file is only used (and cached) when its sha256 matches the index. Hand picks
- * are remembered per [historyKey].
+ * Fetches and caches the index, device files, lists and logos under [dir], from [default] or the
+ * user's own source. A failed fetch falls back to the cache; a file is only used (and cached) when
+ * its sha256 matches the index. Hand picks are remembered per [historyKey]. `data/` ([DATA_BASE])
+ * is read through one of these too, with its own [dir] and never a source of the user's.
*/
class DeviceLists(
private val dir: File,
private val fetch: suspend (String) -> ByteArray = ::download,
+ private val default: String = LISTS_BASE,
) {
private val lock = Mutex()
private var index: ListIndex? = null
private val picks = File(dir, "picks.tsv")
private val sourceFile = File(dir, "source.txt")
- /** The folder holding `index.json`: one the user set, else [LISTS_BASE]. Checked again here, so a stored address that isn't `https` is never used. */
- val base: String get() = custom()?.let(::normalize) ?: LISTS_BASE
+ /** The folder holding `index.json`: one the user set, else [default]. Checked again here, so a stored address that isn't `https` is never used. */
+ val base: String get() = custom()?.let(::normalize) ?: default
- /** The user's own source, or null for tellyscope-devices. */
+ /** The user's own source, or null for [default]. */
@Synchronized
fun custom(): String? = sourceFile.takeIf { it.exists() }?.readText()?.trim()?.ifEmpty { null }
/**
- * Points the lists at [url], or back at [LISTS_BASE] with null. The new source must answer
+ * Points the lists at [url], or back at [default] with null. The new source must answer
* with a schema 1 index first; otherwise nothing changes. The cached lists are dropped, so
* nothing from the old source lingers; picks stay, and a pick the new source lacks falls
* back to matching.
*/
suspend fun setSource(url: String?): SourceResult = lock.withLock {
- val next = if (url == null) LISTS_BASE else normalize(url) ?: return@withLock SourceResult.NotHttps
+ val next = if (url == null) default else normalize(url) ?: return@withLock SourceResult.NotHttps
val text = attempt { fetch(next + "index.json") }?.decodeToString()
// Going back to the default always works, offline too: its lists load once online.
if (text == null && url != null) return@withLock SourceResult.Unreachable
@@ -292,7 +299,7 @@ class DeviceLists(
dir.mkdirs()
if (text != null) File(dir, "index.json").writeText(text)
synchronized(this@DeviceLists) {
- if (next == LISTS_BASE) sourceFile.delete() else sourceFile.writeText(next)
+ if (next == default) sourceFile.delete() else sourceFile.writeText(next)
}
}
index = parsed
@@ -318,20 +325,16 @@ class DeviceLists(
file(entry.file, entry.sha256)?.let { parseList(it.decodeToString(), entry.id) }
/**
- * The launcher, app name, streaming and protected lists the index names, each from cache or the network.
- * One that can't be had is null in [SharedFiles], so the caller keeps what it has.
+ * The list the index names [name] (`launchers`, `labels`, `streaming` or `protected`), from cache
+ * or the network. Null when it can't be had, so the caller keeps what it has.
*/
- suspend fun shared(): SharedFiles {
- val lists = index()?.lists.orEmpty()
- suspend fun get(name: String) = lists[name]?.let { file(it.file, it.sha256) }?.decodeToString()
- return SharedFiles(get("launchers"), get("labels"), get("streaming"), get("protected"))
- }
+ suspend fun shared(name: String): String? =
+ index()?.lists?.get(name)?.let { file(it.file, it.sha256) }?.decodeToString()
- /** The lists as last cached, without the network, for the moment before [shared] answers; each only while it matches the cached index. */
- suspend fun cachedShared(): SharedFiles = withContext(Dispatchers.IO) {
+ /** [name]'s list as last cached, without the network, for the moment before [shared] answers; only while it matches the cached index. */
+ suspend fun cachedShared(name: String): String? = withContext(Dispatchers.IO) {
val lists = File(dir, "index.json").takeIf { it.exists() }?.readText()?.let(::parseIndex)?.lists.orEmpty()
- fun read(name: String) = lists[name]?.let { f -> cached(f.file)?.takeIf { sha256(it) == f.sha256 } }?.decodeToString()
- SharedFiles(read("launchers"), read("labels"), read("streaming"), read("protected"))
+ lists[name]?.let { f -> cached(f.file)?.takeIf { sha256(it) == f.sha256 } }?.decodeToString()
}
/**
@@ -402,9 +405,6 @@ class DeviceLists(
}
}
-/** The raw text of each shared list; null for one not available. */
-data class SharedFiles(val launchers: String?, val labels: String?, val streaming: String?, val protected: String? = null)
-
enum class SourceResult { Ok, NotHttps, Unreachable, NotAList }
val NOT_A_LIST: UiText = UiText(R.string.data_lists_not_a_list)
diff --git a/app/src/main/java/app/tellyscope/data/Launchers.kt b/app/src/main/java/app/tellyscope/data/Launchers.kt
index 652b239..5c87580 100644
--- a/app/src/main/java/app/tellyscope/data/Launchers.kt
+++ b/app/src/main/java/app/tellyscope/data/Launchers.kt
@@ -100,11 +100,13 @@ data class Shared(
)
/**
- * The lists anyone can change without an app release, from the list source next to the debloat
- * lists ([DeviceLists]): the last cached copy at launch, then the source's. A list the source
- * can't give keeps what was there. The app bundles none, so before the first fetch they are empty;
- * a build with `fixtures/` among its Java resources (the tests) starts from those instead. The
- * protected list goes on to [Protected.extra], on top of the built-in one.
+ * The lists anyone can change without an app release: launchers, app names, streaming services and
+ * the Remote's logos from `data/` ([DATA_BASE]), and the protected list from the list source next to
+ * the debloat lists ([DeviceLists]), which may be the user's own. Each is the last cached copy at
+ * launch, then the downloaded one; a list that can't be had keeps what was there. The app bundles
+ * none, so before the first fetch they are empty; a build with `fixtures/` among its Java resources
+ * (the tests) starts from those instead. The protected list goes on to [Protected.extra], on top of
+ * the built-in one.
*/
object SharedLists {
private val _state = MutableStateFlow(seed())
@@ -113,35 +115,52 @@ object SharedLists {
val labels get() = _state.value.labels
val streaming get() = _state.value.streaming
+ @Volatile private var data: DeviceLists? = null
@Volatile private var source: DeviceLists? = null
- /** The cached lists from [lists], then the source's; [fresh] drops the old ones first, for a new source. */
- suspend fun load(lists: DeviceLists, fresh: Boolean = false) {
+ /** The cached lists from [data] and [lists], then downloaded; [fresh] drops the old protected list first, for a new source. */
+ suspend fun load(data: DeviceLists, lists: DeviceLists, fresh: Boolean = false) {
+ this.data = data
source = lists
- if (fresh) reset(seed()) else apply(lists.cachedShared())
- apply(lists.shared())
+ if (fresh) reset(_state.value.copy(protected = emptyMap()))
+ apply(data::cachedShared, lists::cachedShared)
+ refresh()
}
- /** The source's lists again; one already downloaded is read from the cache, so this is cheap once online. */
+ /** The lists again; one already downloaded is read from the cache, so this is cheap once online. */
suspend fun refresh() {
- source?.let { apply(it.shared()) }
+ val data = data ?: return
+ val source = source ?: return
+ apply(data::shared, source::shared)
}
/** A logo's PNG, at four times its size in dp; null until it can be had. */
- suspend fun logo(name: String): ByteArray? = source?.logo(name)
-
- private fun apply(f: SharedFiles) {
+ suspend fun logo(name: String): ByteArray? = data?.logo(name)
+
+ /** Launchers, labels and streaming from [data]; only the protected list from [source]. */
+ private suspend fun apply(data: suspend (String) -> String?, source: suspend (String) -> String?) {
+ val launchers = data("launchers")?.let(::parseLaunchers)
+ val labels = data("labels")?.let(::parseLabels)
+ val streaming = data("streaming")?.let(::parseStreaming)
+ val protected = source("protected")?.let(::parseProtected)
_state.update { now ->
Shared(
- launchers = f.launchers?.let(::parseLaunchers)?.ifEmpty { null } ?: now.launchers,
- labels = f.labels?.let(::parseLabels)?.ifEmpty { null } ?: now.labels,
- streaming = f.streaming?.let(::parseStreaming)?.ifEmpty { null } ?: now.streaming,
- protected = f.protected?.let(::parseProtected)?.ifEmpty { null } ?: now.protected,
+ launchers = launchers?.ifEmpty { null } ?: now.launchers,
+ labels = labels?.ifEmpty { null } ?: now.labels,
+ streaming = streaming?.ifEmpty { null } ?: now.streaming,
+ protected = protected?.ifEmpty { null } ?: now.protected,
)
}
Protected.extra = _state.value.protected
}
+ /** Back to the lists it starts with, and no list sources; for tests. */
+ internal fun reseed() {
+ data = null
+ source = null
+ reset(seed())
+ }
+
private fun reset(shared: Shared) {
_state.value = shared
Protected.extra = shared.protected
diff --git a/app/src/test/java/app/tellyscope/DataListsTest.kt b/app/src/test/java/app/tellyscope/DataListsTest.kt
new file mode 100644
index 0000000..43c0bf4
--- /dev/null
+++ b/app/src/test/java/app/tellyscope/DataListsTest.kt
@@ -0,0 +1,155 @@
+// SPDX-License-Identifier: GPL-3.0-only
+
+package app.tellyscope
+
+import app.tellyscope.data.Png
+import app.tellyscope.data.RemoteButtons
+import app.tellyscope.data.parseIndex
+import app.tellyscope.data.parseLabels
+import app.tellyscope.data.parseLaunchers
+import app.tellyscope.data.parseStreaming
+import org.json.JSONArray
+import org.json.JSONObject
+import org.junit.Assert.assertEquals
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.robolectric.RobolectricTestRunner
+import org.robolectric.annotation.Config
+import java.io.File
+import java.security.MessageDigest
+
+/**
+ * The real lists in `data/`, which the app downloads from `main`: the app drops what it can't read,
+ * so a bad entry would vanish quietly. Each test collects every problem and fails on all of them.
+ * org.json is Android's, so this runs under Robolectric.
+ */
+@RunWith(RobolectricTestRunner::class)
+@Config(sdk = [35])
+class DataListsTest {
+ private val data = File("../data")
+ private val package_ = Regex("[A-Za-z][A-Za-z0-9_]*(\\.[A-Za-z0-9_]+)+")
+ private val logoName = Regex("[a-z0-9]+")
+ private val hex = Regex("#[0-9A-Fa-f]{6}")
+
+ /** The Remote's sheet in dark mode; a service's `dark` fill replaces a colour that sinks into it. */
+ private val darkSheet = 0xFF161D1D
+
+ /** Logos are drawn at four times their size in dp and have to fit the smallest pill, 72 × 30 dp. */
+ private val logoMax = 72 * 4 to 30 * 4
+
+ private fun text(name: String) = File(data, name).readText()
+ private fun schema1(name: String): JSONObject = JSONObject(text(name)).also { assertEquals("$name: schema", 1, it.optInt("schema")) }
+ private fun JSONArray.objects() = (0 until length()).map { getJSONObject(it) }
+ private fun JSONObject.nonEmpty(key: String) = (opt(key) as? String)?.isNotBlank() == true
+ private fun sha256(b: ByteArray) = MessageDigest.getInstance("SHA-256").digest(b).joinToString("") { "%02x".format(it) }
+
+ private fun assertNone(errors: List<String>) = assertEquals("", errors.joinToString("\n"))
+
+ @Test fun launchers() {
+ val errors = mutableListOf<String>()
+ val seen = mutableSetOf<String>()
+ val entries = schema1("launchers.json").getJSONArray("launchers").objects()
+ entries.forEachIndexed { i, l ->
+ val where = "launchers.json: launcher ${i + 1}"
+ val unknown = l.keys().asSequence().toSet() - setOf("package", "name", "about")
+ 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"
+ if (!l.nonEmpty("name")) errors += "$where: 'name' must be a non-empty string"
+ if (l.has("about") && !l.nonEmpty("about")) errors += "$where: 'about' must be a non-empty string"
+ if (!seen.add(pkg)) errors += "$where: $pkg is listed twice"
+ }
+ if (errors.isEmpty()) assertEquals("launchers.json: the app drops none", entries.size, parseLaunchers(text("launchers.json")).size)
+ assertNone(errors)
+ }
+
+ @Test fun labels() {
+ val errors = mutableListOf<String>()
+ val seen = mutableSetOf<String>()
+ for (g in schema1("labels.json").getJSONArray("groups").objects()) {
+ val labels = g.getJSONObject("labels")
+ for (pkg in labels.keys()) {
+ val where = "labels.json: '${g.optString("name")}'"
+ if (pkg != "android" && !package_.matches(pkg)) errors += "$where: not a package name: $pkg"
+ if (!labels.nonEmpty(pkg)) errors += "$where: $pkg needs a name"
+ if (!seen.add(pkg)) errors += "$where: $pkg is listed twice"
+ }
+ }
+ if (errors.isEmpty()) assertEquals("labels.json: the app drops none", seen.size, parseLabels(text("labels.json")).size)
+ assertNone(errors)
+ }
+
+ @Test fun streamingAndLogos() {
+ val errors = mutableListOf<String>()
+ val names = mutableSetOf<String>()
+ val packages = mutableSetOf<String>()
+ val used = mutableSetOf<String>()
+ for (g in schema1("streaming.json").getJSONArray("groups").objects()) {
+ for (s in g.getJSONArray("services").objects()) {
+ val where = "streaming.json: '${s.optString("name")}'"
+ if (!s.nonEmpty("name")) errors += "$where: 'name' must be a non-empty string"
+ val pkgs = s.optJSONArray("packages")?.let { a -> (0 until a.length()).map { a.optString(it) } }.orEmpty()
+ if (pkgs.isEmpty()) errors += "$where: 'packages' must list at least one package"
+ for (p in pkgs) {
+ if (!package_.matches(p)) errors += "$where: not a package name: $p"
+ if (!packages.add(p)) errors += "$where: $p belongs to another service too"
+ }
+ for (key in listOf("color", "color2", "dark")) {
+ if ((key == "color" || s.has(key)) && !hex.matches(s.optString(key))) errors += "$where: '$key' must be #RRGGBB"
+ }
+ s.optString("dark").takeIf { hex.matches(it) }?.let { dark ->
+ val c = RemoteButtons.contrast(0xFF000000 or dark.substring(1).toLong(16), darkSheet)
+ if (c < 3) errors += "$where: 'dark' is ${"%.2f".format(c)}:1 against the dark sheet, under 3:1"
+ }
+ val logo = s.optString("logo")
+ if (!logoName.matches(logo)) errors += "$where: 'logo' must be lowercase letters and digits"
+ else if (!File(data, "logos/$logo.png").isFile) errors += "$where: logos/$logo.png is missing"
+ used += logo
+ if (!names.add(s.optString("name"))) errors += "$where: listed twice"
+ }
+ }
+ if (errors.isEmpty()) assertEquals("streaming.json: the app drops none", names.size, parseStreaming(text("streaming.json")).size)
+
+ val rows = Regex("^\\| *([a-z0-9]+) *\\|", RegexOption.MULTILINE).findAll(text("logos/SOURCES.md")).map { it.groupValues[1] }.toSet()
+ for (f in File(data, "logos").listFiles().orEmpty().sortedBy { it.name }) {
+ if (f.name == "SOURCES.md") continue
+ val where = "logos/${f.name}"
+ if (f.nameWithoutExtension !in rows) errors += "$where: needs a row in logos/SOURCES.md with its source and licence"
+ if (f.extension != "png" || !logoName.matches(f.nameWithoutExtension)) {
+ errors += "$where: logos are <lowercase letters and digits>.png"
+ continue
+ }
+ val b = f.readBytes()
+ val size = Png.size(b)
+ if (size == null) errors += "$where: not a PNG"
+ else if (size.first > logoMax.first || size.second > logoMax.second) errors += "$where: ${size.first}x${size.second} is over ${logoMax.first}x${logoMax.second}"
+ if (!Png.ok(b)) errors += "$where: the app won't show it (Png.ok)"
+ if (f.nameWithoutExtension !in used) errors += "$where: no service in streaming.json uses it"
+ }
+ assertNone(errors)
+ }
+
+ /** `index.json` names every list and logo with its sha256, as the app checks each download. */
+ @Test fun theIndexMatchesTheFiles() {
+ val errors = mutableListOf<String>()
+ val index = parseIndex(text("index.json"))
+ if (index == null) {
+ assertNone(listOf("index.json: not a schema 1 index the app reads"))
+ return
+ }
+ val expected = listOf("launchers", "labels", "streaming").associateWith { "$it.json" } +
+ File(data, "logos").listFiles().orEmpty().filter { it.extension == "png" }.associate { "logo ${it.nameWithoutExtension}" to "logos/${it.name}" }
+ val listed = index.lists + index.logos.mapKeys { "logo ${it.key}" }
+ for ((name, path) in expected) {
+ val entry = listed[name]
+ val sha = sha256(File(data, path).readBytes())
+ when {
+ entry == null -> errors += "index.json: $name ($path) is missing"
+ entry.file != path -> errors += "index.json: $name names ${entry.file}, not $path"
+ entry.sha256 != sha -> errors += "index.json: $path's sha256 is $sha"
+ }
+ }
+ (listed.keys - expected.keys).forEach { errors += "index.json: $it isn't in data/" }
+ assertNone(errors)
+ }
+}
diff --git a/app/src/test/java/app/tellyscope/DeviceListsTest.kt b/app/src/test/java/app/tellyscope/DeviceListsTest.kt
index 6c50227..5bec8b6 100644
--- a/app/src/test/java/app/tellyscope/DeviceListsTest.kt
+++ b/app/src/test/java/app/tellyscope/DeviceListsTest.kt
@@ -278,24 +278,32 @@ class DeviceListsTest {
val index = parseIndex(sharedIndex(bad = true).decodeToString())!!
assertEquals(setOf("launchers"), index.lists.keys)
assertEquals(setOf("netflix"), index.logos.keys)
- // An index from before they moved here still reads.
+ // An index without them still reads.
assertTrue(parseIndex(index().decodeToString())!!.lists.isEmpty())
}
+ /** `data/`'s index: no devices, lists at the top of the folder, but never one named like the index itself. */
+ @Test fun theDataIndexHasNoDevicesAndTopLevelLists() {
+ val zero = "0".repeat(64)
+ val index = parseIndex("""{"schema": 1, "lists": {"labels": {"file": "labels.json", "sha256": "$zero"}, "index": {"file": "index.json", "sha256": "$zero"}}}""")!!
+ assertTrue(index.devices.isEmpty())
+ assertEquals(setOf("labels"), index.lists.keys)
+ }
+
@Test fun listsAndLogosAreCheckedCachedAndReadOffline() = runTest {
val lists = DeviceLists(tmp.root, served("index.json" to sharedIndex(), "lists/launchers.json" to launchers, "logos/netflix.png" to logo))
- assertEquals(launchers.decodeToString(), lists.shared().launchers)
- assertNull(lists.shared().streaming) // the index names none
+ assertEquals(launchers.decodeToString(), lists.shared("launchers"))
+ assertNull(lists.shared("streaming")) // the index names none
assertTrue(logo.contentEquals(lists.logo("netflix")))
assertNull(lists.logo("hulu"))
val offline = DeviceLists(tmp.root) { throw IOException("offline") }
- assertEquals(launchers.decodeToString(), offline.cachedShared().launchers)
- assertEquals(launchers.decodeToString(), offline.shared().launchers)
+ assertEquals(launchers.decodeToString(), offline.cachedShared("launchers"))
+ assertEquals(launchers.decodeToString(), offline.shared("launchers"))
assertTrue(logo.contentEquals(offline.logo("netflix")))
val wrong = DeviceLists(tmp.newFolder(), served("index.json" to sharedIndex(launchersSha = "f".repeat(64)), "lists/launchers.json" to launchers))
- assertNull(wrong.shared().launchers)
+ assertNull(wrong.shared("launchers"))
}
private val fork = "https://raw.githubusercontent.com/someone/my-lists/main/"
diff --git a/app/src/test/java/app/tellyscope/HostileSourceTest.kt b/app/src/test/java/app/tellyscope/HostileSourceTest.kt
index ca72ce4..0f5dd98 100644
--- a/app/src/test/java/app/tellyscope/HostileSourceTest.kt
+++ b/app/src/test/java/app/tellyscope/HostileSourceTest.kt
@@ -214,7 +214,7 @@ class HostileSourceTest {
val idx = index(lists = mapOf("launchers" to ("lists/launchers.json" to launchers)), logos = mapOf("acme" to ("logos/acme.png" to logo)))
val swapped = """{"schema": 1, "launchers": [{"package": "com.evil.home", "name": "Evil"}]}""".toByteArray()
val lists = DeviceLists(dir, served(mapOf("index.json" to idx, "lists/launchers.json" to swapped, "logos/acme.png" to png(11, 10))))
- assertNull(lists.shared().launchers)
+ assertNull(lists.shared("launchers"))
assertNull(lists.logo("acme"))
assertFalse(File(dir, "lists/launchers.json").exists())
assertFalse(File(dir, "logos/acme.png").exists())
@@ -224,9 +224,9 @@ class HostileSourceTest {
val dir = tmp.newFolder()
val launchers = """{"schema": 1, "launchers": [{"package": "com.acme.home", "name": "Acme"}]}""".toByteArray()
val lists = DeviceLists(dir, served(mapOf("index.json" to index(lists = mapOf("launchers" to ("lists/launchers.json" to launchers))), "lists/launchers.json" to launchers)))
- assertEquals(launchers.decodeToString(), lists.shared().launchers)
+ assertEquals(launchers.decodeToString(), lists.shared("launchers"))
File(dir, "lists/launchers.json").writeText("""{"schema": 1, "launchers": [{"package": "com.evil.home", "name": "Evil"}]}""")
- assertNull(DeviceLists(dir) { throw IOException("offline") }.cachedShared().launchers)
+ assertNull(DeviceLists(dir) { throw IOException("offline") }.cachedShared("launchers"))
}
// A launcher entry asking for accessibility
diff --git a/app/src/test/java/app/tellyscope/LaunchersTest.kt b/app/src/test/java/app/tellyscope/LaunchersTest.kt
index a8746a2..2956989 100644
--- a/app/src/test/java/app/tellyscope/LaunchersTest.kt
+++ b/app/src/test/java/app/tellyscope/LaunchersTest.kt
@@ -5,6 +5,7 @@ package app.tellyscope
import app.tellyscope.adb.Protected
import app.tellyscope.adb.ProtectedReason
import app.tellyscope.data.ACCESSIBILITY_LAUNCHERS
+import app.tellyscope.data.DATA_BASE
import app.tellyscope.data.DeviceLists
import app.tellyscope.data.LISTS_BASE
import app.tellyscope.data.KnownLauncher
@@ -98,19 +99,40 @@ class LaunchersTest {
assertTrue(parseProtected("{").isEmpty())
}
+ private fun sha(b: ByteArray) = MessageDigest.getInstance("SHA-256").digest(b).joinToString("") { "%02x".format(it) }
+
/** The source's `protected.json` reaches [Protected] on top of the built-in list. */
@Test fun theProtectedListAddsToTheBuiltInOne() = runTest {
val file = """{"schema":1,"groups":[{"name":"Philips","packages":{"org.droidtv.eum":"tv_inputs_remote","com.android.settings":"updates"}}]}""".toByteArray()
- val sha = MessageDigest.getInstance("SHA-256").digest(file).joinToString("") { "%02x".format(it) }
- val index = """{"schema":1,"devices":[],"lists":{"protected":{"file":"lists/protected.json","sha256":"$sha"}}}""".toByteArray()
+ val index = """{"schema":1,"devices":[],"lists":{"protected":{"file":"lists/protected.json","sha256":"${sha(file)}"}}}""".toByteArray()
val served = mapOf("index.json" to index, "lists/protected.json" to file)
try {
- SharedLists.load(DeviceLists(tmp.newFolder()) { url -> served[url.removePrefix(LISTS_BASE)] ?: throw IOException("404 $url") }, fresh = true)
+ SharedLists.load(DeviceLists(tmp.newFolder(), { throw IOException("offline") }, DATA_BASE), DeviceLists(tmp.newFolder()) { url -> served[url.removePrefix(LISTS_BASE)] ?: throw IOException("404 $url") }, fresh = true)
assertEquals(ProtectedReason.TV_INPUTS_REMOTE, Protected.reason("org.droidtv.eum"))
assertEquals(ProtectedReason.SETTINGS, Protected.reason("com.android.settings"))
} finally {
- // Back to the seed lists, for the tests after this one.
- SharedLists.load(DeviceLists(tmp.newFolder()) { throw IOException("offline") }, fresh = true)
+ SharedLists.reseed() // the seed lists, for the tests after this one
+ }
+ }
+
+ /** Launchers come from `data/` only: a list source that names its own, like a fork's, isn't read for them. */
+ @Test fun launchersComeFromDataNotTheListSource() = runTest {
+ val theirs = """{"schema":1,"launchers":[{"package":"com.evil.home","name":"Evil","about":"x"}]}""".toByteArray()
+ val ours = """{"schema":1,"launchers":[{"package":"com.good.home","name":"Good","about":"x"}]}""".toByteArray()
+ fun index(f: ByteArray, file: String) = """{"schema":1,"devices":[],"lists":{"launchers":{"file":"$file","sha256":"${sha(f)}"}}}""".toByteArray()
+ val asked = mutableListOf<String>()
+ val source = mapOf("index.json" to index(theirs, "lists/launchers.json"), "lists/launchers.json" to theirs)
+ val data = mapOf("index.json" to index(ours, "launchers.json"), "launchers.json" to ours)
+ try {
+ SharedLists.load(
+ DeviceLists(tmp.newFolder(), { url -> data[url.removePrefix(DATA_BASE)] ?: throw IOException("404 $url") }, DATA_BASE),
+ DeviceLists(tmp.newFolder()) { url -> asked += url; source[url.removePrefix(LISTS_BASE)] ?: throw IOException("404 $url") },
+ fresh = true,
+ )
+ assertEquals(listOf("com.good.home"), SharedLists.launchers.map { it.pkg })
+ assertEquals(listOf(LISTS_BASE + "index.json"), asked)
+ } finally {
+ SharedLists.reseed() // the seed lists, for the tests after this one
}
}
}
diff --git a/app/src/test/java/app/tellyscope/ScreenshotTest.kt b/app/src/test/java/app/tellyscope/ScreenshotTest.kt
index ae48c3c..72d9d89 100644
--- a/app/src/test/java/app/tellyscope/ScreenshotTest.kt
+++ b/app/src/test/java/app/tellyscope/ScreenshotTest.kt
@@ -51,6 +51,7 @@ import app.tellyscope.data.AppInfo
import app.tellyscope.data.Docked
import app.tellyscope.data.AppNames
import app.tellyscope.data.Device
+import app.tellyscope.data.DATA_BASE
import app.tellyscope.data.DeviceLists
import app.tellyscope.data.DeviceState
import app.tellyscope.data.FakeDeviceSource
@@ -1254,26 +1255,28 @@ class ScreenshotTest {
private fun realIcon(pkg: String): ByteArray? = javaClass.classLoader?.getResourceAsStream("dock-icons/$pkg.png")?.use { it.readBytes() }
/**
- * [body] with the Remote's lists offline but holding these services' logos, fetched from
- * tellyscope-devices into a temp cache as a phone would; without the network the buttons show
- * their names instead. The lists go back to none after.
+ * [body] with the Remote's logos read from the repo's `data/`, as a phone downloads them, and the lists still the fixtures;
+ * without them the buttons show their names instead. The logos go back to none after.
*/
- private fun withLogos(vararg names: String, body: () -> Unit) {
+ private fun withLogos(body: () -> Unit) {
val offline: suspend (String) -> ByteArray = { throw IOException("offline") }
- val dir = Files.createTempDirectory("logos").toFile()
- runBlocking {
- val online = DeviceLists(dir)
- if (online.index() != null) names.forEach { online.logo(it) }
- SharedLists.load(DeviceLists(dir, offline))
+ // The index and logos only, so the lists stay the fixtures the other shots use.
+ val local: suspend (String) -> ByteArray = { url ->
+ val path = url.removePrefix(DATA_BASE)
+ if (path != "index.json" && !path.startsWith("logos/")) throw IOException("not served: $path")
+ File("../data", path).readBytes()
}
+ val none = DeviceLists(Files.createTempDirectory("none").toFile(), offline)
+ val dir = Files.createTempDirectory("data").toFile()
+ runBlocking { SharedLists.load(DeviceLists(dir, local, DATA_BASE), none) }
try { body() } finally {
- runBlocking { SharedLists.load(DeviceLists(Files.createTempDirectory("none").toFile(), offline)) }
+ SharedLists.reseed()
dir.deleteRecursively()
}
}
// The README's Remote: a full row of streaming buttons, with their logos.
- @Test fun remote_dockFull() = withLogos("youtube", "netflix", "jellyfin") {
+ @Test fun remote_dockFull() = withLogos {
val three = docked + Docked("org.jellyfin.androidtv", "Jellyfin")
shot("12_remote_dock_full", screen = true) { RemoteScreen(remoteState(apps = three), RemoteActions()) }
// A full row has no Remote buttons pill.
diff --git a/data/index.json b/data/index.json
new file mode 100644
index 0000000..842e1b4
--- /dev/null
+++ b/data/index.json
@@ -0,0 +1,111 @@
+{
+ "schema": 1,
+ "lists": {
+ "launchers": {
+ "file": "launchers.json",
+ "sha256": "22ccc5eac974ccc7d04d85282da866307abdf46149d91787c8c844f4e7a456cf"
+ },
+ "labels": {
+ "file": "labels.json",
+ "sha256": "3ea559f35c194be63bb60f9d71dfba7ba270f6b40e2380c05f6cdf18cfcfad96"
+ },
+ "streaming": {
+ "file": "streaming.json",
+ "sha256": "907e47666b18673d634bd8a3840a32acbc7d9c083b14ae14bd6359b025db2d4f"
+ }
+ },
+ "logos": {
+ "appletv": {
+ "file": "logos/appletv.png",
+ "sha256": "f04cca04db2b665ee585c0ad18d77e2cdb0a27db3d4af5574732a4f641196aa2"
+ },
+ "crunchyroll": {
+ "file": "logos/crunchyroll.png",
+ "sha256": "46c0875620d12eca3e59afc6579d68631da8efa0b653dfa790e1936b0ddc96d6"
+ },
+ "dazn": {
+ "file": "logos/dazn.png",
+ "sha256": "bb7552215f1e9edd717463979b9caa7c516e5bc19c2bef5150d5e09dca0179d7"
+ },
+ "disney": {
+ "file": "logos/disney.png",
+ "sha256": "555c45701e88e26b90332bea36031db77f0fe62e8abea69ac1f356bdb46d8b80"
+ },
+ "emby": {
+ "file": "logos/emby.png",
+ "sha256": "e80fe3d7ac6c7b78e90f6328b33c7f0325d437f434fc05820ad473692676aa6c"
+ },
+ "hbomax": {
+ "file": "logos/hbomax.png",
+ "sha256": "c8a9e2bcf4f48fa27ee04e408fff6f83b3b4542011085f2e4dabcb09f7056c9e"
+ },
+ "hulu": {
+ "file": "logos/hulu.png",
+ "sha256": "9aae5637c4e6055f42883a035ff8b04431dfa1525f80739acfc94d4ed579ac0a"
+ },
+ "jellyfin": {
+ "file": "logos/jellyfin.png",
+ "sha256": "253c4f382e453288dc54be0a9ea16ee2ae04c7035283c7b6d0fc8b4afc3571a2"
+ },
+ "jiohotstar": {
+ "file": "logos/jiohotstar.png",
+ "sha256": "90043966578a5fffc6aef72f89bb1fe07632bcb06b6e7720f830c5ecae21cb27"
+ },
+ "kodi": {
+ "file": "logos/kodi.png",
+ "sha256": "9056568aa6f3ae41926d7394eb058cdff695af9bad46daef7a6f02635a7ee2c2"
+ },
+ "netflix": {
+ "file": "logos/netflix.png",
+ "sha256": "2cc8714ef83a99d32893ccaac6689cb626bdbc64ee078827368785f58ed463dd"
+ },
+ "paramount": {
+ "file": "logos/paramount.png",
+ "sha256": "ea0ff29e3ffab546158b8ec2aba96f183c2762db2f8cb35b52b39368d0143ef2"
+ },
+ "peacock": {
+ "file": "logos/peacock.png",
+ "sha256": "faab25d8414ae924c36c607024c46be10c5a20f05d67034c4ed51ee062fd393a"
+ },
+ "plex": {
+ "file": "logos/plex.png",
+ "sha256": "def82ebe494e779b6ef4c7ac977740268a2f688f2ee12bd0b40dcccf98a0e752"
+ },
+ "plutotv": {
+ "file": "logos/plutotv.png",
+ "sha256": "1937d8ad54449659ae34846e6333f703c50a824d8f6adb19786651cc87ec2065"
+ },
+ "primevideo": {
+ "file": "logos/primevideo.png",
+ "sha256": "6af77090507ffa5232482114c6d33bafe56e7ea440b42e5897acec4b476c4514"
+ },
+ "sonyliv": {
+ "file": "logos/sonyliv.png",
+ "sha256": "b0a50374edc19f316e0e02627a0d96444294ff97901c73efa783d1ca543dca2a"
+ },
+ "spotify": {
+ "file": "logos/spotify.png",
+ "sha256": "fa5f515bdc8db3cdc37d0260dfbf09fe34252660e2abc650a5755ddb20645c5c"
+ },
+ "tubi": {
+ "file": "logos/tubi.png",
+ "sha256": "83c3961ab8ef8b71abb4c03623556ca0b3c1ea94e2e0622b512f636ade80567d"
+ },
+ "twitch": {
+ "file": "logos/twitch.png",
+ "sha256": "6477d560f7ed2b7b4e2e188974e1c99ce4b9ba67eace6e2356ac9b1707b82e87"
+ },
+ "wholphin": {
+ "file": "logos/wholphin.png",
+ "sha256": "796b70a21f2541d2dba775a9ef979509f669345a43ba9e1d98e9c07371e4b71c"
+ },
+ "youtube": {
+ "file": "logos/youtube.png",
+ "sha256": "2ba970f6100792098174cbcb5b809116f259dd7ee7df1faef99b344200a98b4d"
+ },
+ "zee5": {
+ "file": "logos/zee5.png",
+ "sha256": "da6fa69cf95228dc74e1686c218e3321ee8885c212f2c1377185c0090b9da5ad"
+ }
+ }
+}
diff --git a/data/labels.json b/data/labels.json
new file mode 100644
index 0000000..d593d3b
--- /dev/null
+++ b/data/labels.json
@@ -0,0 +1,55 @@
+{
+ "schema": 1,
+ "groups": [
+ {
+ "name": "Android and Google TV system apps",
+ "labels": {
+ "android": "Android System",
+ "com.android.systemui": "System UI",
+ "com.android.tv.settings": "Settings",
+ "com.android.vending": "Google Play Store",
+ "com.android.chrome": "Chrome",
+ "com.android.bluetooth": "Bluetooth",
+ "com.android.shell": "Shell",
+ "com.android.providers.downloads": "Download Manager",
+ "com.android.packageinstaller": "Package installer",
+ "com.google.android.packageinstaller": "Package installer",
+ "com.google.android.gms": "Google Play services",
+ "com.google.android.gsf": "Google Services Framework",
+ "com.google.android.tvlauncher": "Android TV Home",
+ "com.google.android.apps.tv.launcherx": "Google TV Home",
+ "com.google.android.apps.mediashell": "Chromecast built-in",
+ "com.google.android.tv.remote.service": "Android TV Remote Service",
+ "com.google.android.inputmethod.latin": "Gboard",
+ "com.google.android.tts": "Speech Services by Google",
+ "com.google.android.play.games": "Google Play Games",
+ "com.google.android.youtube.tv": "YouTube",
+ "com.google.android.youtube.tvmusic": "YouTube Music",
+ "com.google.android.youtube.tvkids": "YouTube Kids"
+ }
+ },
+ {
+ "name": "Streaming and media apps",
+ "labels": {
+ "com.netflix.ninja": "Netflix",
+ "com.amazon.amazonvideo.livingroom": "Prime Video",
+ "com.disney.disneyplus": "Disney+",
+ "com.apple.atve.androidtv.appletv": "Apple TV",
+ "com.spotify.tv.android": "Spotify",
+ "com.plexapp.android": "Plex",
+ "org.jellyfin.androidtv": "Jellyfin",
+ "org.xbmc.kodi": "Kodi",
+ "org.videolan.vlc": "VLC",
+ "tv.twitch.android.app": "Twitch",
+ "com.crunchyroll.crunchyroid": "Crunchyroll",
+ "com.teamsmart.videomanager.tv": "SmartTube"
+ }
+ },
+ {
+ "name": "Launchers",
+ "labels": {
+ "com.spocky.projengmenu": "Projectivy Launcher"
+ }
+ }
+ ]
+}
diff --git a/data/launchers.json b/data/launchers.json
new file mode 100644
index 0000000..2530cd1
--- /dev/null
+++ b/data/launchers.json
@@ -0,0 +1,7 @@
+{
+ "schema": 1,
+ "launchers": [
+ { "package": "com.spocky.projengmenu", "name": "Projectivy Launcher", "about": "The most popular. Rows, wallpapers and icons you can change." },
+ { "package": "me.efesser.flauncher", "name": "FLauncher", "about": "Simple: your apps in rows, nothing else." }
+ ]
+}
diff --git a/data/logos/SOURCES.md b/data/logos/SOURCES.md
new file mode 100644
index 0000000..73a1baf
--- /dev/null
+++ b/data/logos/SOURCES.md
@@ -0,0 +1,31 @@
+# Logo sources
+
+Each logo's source and licence. A new logo needs a CC0 or PD-textlogo source and a row here. Logos are trademarks of their owners; the licence below covers the artwork only.
+
+PD-textlogo is Wikimedia Commons' tag for a logo below the US threshold of originality. CC0 for Simple Icons covers the SVG drawing, not the brand.
+
+| Logo | Source | URL | Licence |
+|---|---|---|---|
+| appletv | Simple Icons `appletv` | https://simpleicons.org/?q=appletv | CC0 |
+| crunchyroll | Commons, Crunchyroll logo 2024 (cropped into mark + text) | https://commons.wikimedia.org/wiki/File:Crunchyroll_logo_2024.png | CC0 |
+| dazn | Simple Icons `dazn` | https://simpleicons.org/?q=dazn | CC0 |
+| disney | Commons, Disney+ logo | https://commons.wikimedia.org/wiki/File:Disney%2B_logo.svg | PD-textlogo |
+| emby | Simple Icons `emby` mark + "emby" set in our font | https://simpleicons.org/?q=emby | CC0 |
+| hbomax | Commons, HBO Max (2025) | https://commons.wikimedia.org/wiki/File:HBO_Max_%282025%29.svg | PD-textlogo |
+| hulu | Commons, Hulu logo (2018) | https://commons.wikimedia.org/wiki/File:Hulu_logo_%282018%29.svg | PD-textlogo |
+| jellyfin | Simple Icons `jellyfin` mark + "jellyfin" set in our font | https://simpleicons.org/?q=jellyfin | CC0 |
+| jiohotstar | Commons, JioHotstar 2025 (star cropped) | https://commons.wikimedia.org/wiki/File:JioHotstar_2025.png | PD-textlogo |
+| kodi | Commons, Kodi side-by-side | https://commons.wikimedia.org/wiki/File:Kodi-side-by-side.svg | PD-textlogo |
+| netflix | Commons, Netflix 2015 logo | https://commons.wikimedia.org/wiki/File:Netflix_2015_logo.svg | PD-textlogo |
+| paramount | Commons, Paramount+ logo | https://commons.wikimedia.org/wiki/File:Paramount%2B_logo.svg | PD-textlogo |
+| peacock | Commons, NBCUniversal Peacock Logo (2026) | https://commons.wikimedia.org/wiki/File:NBCUniversal_Peacock_Logo_%282026%29.svg | PD-textlogo |
+| plex | Commons, Plex logo 2022 | https://commons.wikimedia.org/wiki/File:Plex_logo_2022.svg | PD-textlogo |
+| plutotv | Commons, Pluto TV logo 2020 | https://commons.wikimedia.org/wiki/File:Pluto_TV_logo_2020.svg | PD-textlogo |
+| primevideo | Commons, Prime Video logo (2024) | https://commons.wikimedia.org/wiki/File:Prime_Video_logo_%282024%29.svg | PD-textlogo |
+| sonyliv | no artwork: the name set in our font | — | n/a |
+| spotify | Commons, Spotify logo with text | https://commons.wikimedia.org/wiki/File:Spotify_logo_with_text.svg | PD-textlogo |
+| tubi | Commons, Tubi logo 2024 | https://commons.wikimedia.org/wiki/File:Tubi_logo_2024.svg | PD-textlogo |
+| twitch | Simple Icons `twitch` (glitch mark) | https://simpleicons.org/?q=twitch | CC0 (brand guidelines apply) |
+| wholphin | Wholphin repo, `ic_launcher_foreground` + name in our font | https://github.com/damontecres/Wholphin/blob/main/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp | GPL-2.0 (repo licence; credited in NOTICE) |
+| youtube | Commons, YouTube Logo 2017 | https://commons.wikimedia.org/wiki/File:YouTube_Logo_2017.svg | PD-textlogo |
+| zee5 | Commons, ZEE5 2025 | https://commons.wikimedia.org/wiki/File:ZEE5_2025.svg | PD-textlogo |
diff --git a/data/logos/appletv.png b/data/logos/appletv.png
new file mode 100644
index 0000000..508ef1f
Binary files /dev/null and b/data/logos/appletv.png differ
diff --git a/data/logos/crunchyroll.png b/data/logos/crunchyroll.png
new file mode 100644
index 0000000..78629d9
Binary files /dev/null and b/data/logos/crunchyroll.png differ
diff --git a/data/logos/dazn.png b/data/logos/dazn.png
new file mode 100644
index 0000000..af2c80e
Binary files /dev/null and b/data/logos/dazn.png differ
diff --git a/data/logos/disney.png b/data/logos/disney.png
new file mode 100644
index 0000000..5c92b5c
Binary files /dev/null and b/data/logos/disney.png differ
diff --git a/data/logos/emby.png b/data/logos/emby.png
new file mode 100644
index 0000000..8b30cd5
Binary files /dev/null and b/data/logos/emby.png differ
diff --git a/data/logos/hbomax.png b/data/logos/hbomax.png
new file mode 100644
index 0000000..e4b034a
Binary files /dev/null and b/data/logos/hbomax.png differ
diff --git a/data/logos/hulu.png b/data/logos/hulu.png
new file mode 100644
index 0000000..455ab69
Binary files /dev/null and b/data/logos/hulu.png differ
diff --git a/data/logos/jellyfin.png b/data/logos/jellyfin.png
new file mode 100644
index 0000000..6861719
Binary files /dev/null and b/data/logos/jellyfin.png differ
diff --git a/data/logos/jiohotstar.png b/data/logos/jiohotstar.png
new file mode 100644
index 0000000..4da42ac
Binary files /dev/null and b/data/logos/jiohotstar.png differ
diff --git a/data/logos/kodi.png b/data/logos/kodi.png
new file mode 100644
index 0000000..67ee077
Binary files /dev/null and b/data/logos/kodi.png differ
diff --git a/data/logos/netflix.png b/data/logos/netflix.png
new file mode 100644
index 0000000..3f5e710
Binary files /dev/null and b/data/logos/netflix.png differ
diff --git a/data/logos/paramount.png b/data/logos/paramount.png
new file mode 100644
index 0000000..6512788
Binary files /dev/null and b/data/logos/paramount.png differ
diff --git a/data/logos/peacock.png b/data/logos/peacock.png
new file mode 100644
index 0000000..7e67b44
Binary files /dev/null and b/data/logos/peacock.png differ
diff --git a/data/logos/plex.png b/data/logos/plex.png
new file mode 100644
index 0000000..ead390f
Binary files /dev/null and b/data/logos/plex.png differ
diff --git a/data/logos/plutotv.png b/data/logos/plutotv.png
new file mode 100644
index 0000000..ae3fe5d
Binary files /dev/null and b/data/logos/plutotv.png differ
diff --git a/data/logos/primevideo.png b/data/logos/primevideo.png
new file mode 100644
index 0000000..3215865
Binary files /dev/null and b/data/logos/primevideo.png differ
diff --git a/data/logos/sonyliv.png b/data/logos/sonyliv.png
new file mode 100644
index 0000000..0f4d057
Binary files /dev/null and b/data/logos/sonyliv.png differ
diff --git a/data/logos/spotify.png b/data/logos/spotify.png
new file mode 100644
index 0000000..e2ee91f
Binary files /dev/null and b/data/logos/spotify.png differ
diff --git a/data/logos/tubi.png b/data/logos/tubi.png
new file mode 100644
index 0000000..29ec74d
Binary files /dev/null and b/data/logos/tubi.png differ
diff --git a/data/logos/twitch.png b/data/logos/twitch.png
new file mode 100644
index 0000000..91fc5da
Binary files /dev/null and b/data/logos/twitch.png differ
diff --git a/data/logos/wholphin.png b/data/logos/wholphin.png
new file mode 100644
index 0000000..6a016cd
Binary files /dev/null and b/data/logos/wholphin.png differ
diff --git a/data/logos/youtube.png b/data/logos/youtube.png
new file mode 100644
index 0000000..b6f6980
Binary files /dev/null and b/data/logos/youtube.png differ
diff --git a/data/logos/zee5.png b/data/logos/zee5.png
new file mode 100644
index 0000000..d37c330
Binary files /dev/null and b/data/logos/zee5.png differ
diff --git a/data/streaming.json b/data/streaming.json
new file mode 100644
index 0000000..6cba6e6
--- /dev/null
+++ b/data/streaming.json
@@ -0,0 +1,53 @@
+{
+ "schema": 1,
+ "groups": [
+ {
+ "name": "Global",
+ "services": [
+ { "name": "Netflix", "packages": ["com.netflix.ninja"], "color": "#000000", "logo": "netflix", "dark": "#E50914" },
+ { "name": "YouTube", "packages": ["com.google.android.youtube.tv", "com.amazon.firetv.youtube"], "color": "#FFFFFF", "logo": "youtube" },
+ { "name": "Prime Video", "packages": ["com.amazon.amazonvideo.livingroom", "com.amazon.amazonvideo.livingroom.nvidia", "com.amazon.firebat", "com.amazon.avod"], "color": "#0F171E", "logo": "primevideo", "dark": "#00A8E1" },
+ { "name": "Spotify", "packages": ["com.spotify.tv.android"], "color": "#000000", "logo": "spotify", "dark": "#1ED760" },
+ { "name": "Disney+", "packages": ["com.disney.disneyplus"], "color": "#0B1446", "logo": "disney", "dark": "#00B4FF" },
+ { "name": "HBO Max", "packages": ["com.wbd.stream", "com.hbo.hbonow"], "color": "#000000", "logo": "hbomax" },
+ { "name": "Apple TV", "packages": ["com.apple.atve.androidtv.appletv", "com.apple.atve.amazon.appletv"], "color": "#000000", "logo": "appletv" },
+ { "name": "Paramount+", "packages": ["com.cbs.ott"], "color": "#0064FF", "logo": "paramount" },
+ { "name": "Crunchyroll", "packages": ["com.crunchyroll.crunchyroid"], "color": "#F47521", "logo": "crunchyroll" },
+ { "name": "Twitch", "packages": ["tv.twitch.android.app", "tv.twitch.android.viewer"], "color": "#9146FF", "logo": "twitch" }
+ ]
+ },
+ {
+ "name": "US",
+ "services": [
+ { "name": "Hulu", "packages": ["com.hulu.livingroomplus", "com.hulu.plus"], "color": "#1CE783", "logo": "hulu" },
+ { "name": "Peacock", "packages": ["com.peacocktv.peacockandroid", "com.peacock.peacockfiretv"], "color": "#000000", "logo": "peacock", "dark": "#FFDC23" },
+ { "name": "Tubi", "packages": ["com.tubitv", "com.tubitv.ott"], "color": "#5B1EB8", "logo": "tubi", "dark": "#FFFF13" },
+ { "name": "Pluto TV", "packages": ["tv.pluto.android"], "color": "#000000", "logo": "plutotv", "dark": "#FFDE2B" }
+ ]
+ },
+ {
+ "name": "India",
+ "services": [
+ { "name": "JioHotstar", "packages": ["in.startv.hotstar"], "color": "#0F1F7A", "logo": "jiohotstar" },
+ { "name": "Zee5", "packages": ["com.graymatrix.did", "com.zee5.amazon"], "color": "#3B0A5C", "logo": "zee5", "dark": "#EC2B8D" },
+ { "name": "SonyLIV", "packages": ["com.sonyliv", "com.onemainstream.sonyliv.android"], "color": "#000000", "logo": "sonyliv" }
+ ]
+ },
+ {
+ "name": "Sports",
+ "services": [
+ { "name": "DAZN", "packages": ["com.dazn"], "color": "#000000", "logo": "dazn" }
+ ]
+ },
+ {
+ "name": "Self-hosted",
+ "services": [
+ { "name": "Plex", "packages": ["com.plexapp.android"], "color": "#E5A00D", "logo": "plex" },
+ { "name": "Jellyfin", "packages": ["org.jellyfin.androidtv"], "color": "#AA5CC3", "color2": "#00A4DC", "logo": "jellyfin" },
+ { "name": "Wholphin", "packages": ["com.github.damontecres.wholphin"], "color": "#000B25", "logo": "wholphin", "dark": "#3C73AB" },
+ { "name": "Kodi", "packages": ["org.xbmc.kodi"], "color": "#1C2B3A", "logo": "kodi", "dark": "#17B2E7" },
+ { "name": "Emby", "packages": ["tv.emby.embyatv"], "color": "#52B54B", "logo": "emby" }
+ ]
+ }
+ ]
+}
diff --git a/docs/privacy.html b/docs/privacy.html
index aa4a467..488eb6d 100644
--- a/docs/privacy.html
+++ b/docs/privacy.html
@@ -43,7 +43,8 @@ code { font-size: .9em; overflow-wrap: anywhere; }
<h2>What it downloads from GitHub</h2>
<p>Tellyscope reads public files from GitHub. These requests send nothing about you or your TV; like any website, GitHub sees your IP address and which file was asked for, under <a href="https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement">GitHub's privacy statement</a>.</p>
<ul>
- <li><strong>Debloat lists, app names and streaming-app logos</strong>, from the public <code>tellyscope-devices</code> repository. If you set your own list address under Settings &rsaquo; Advanced, it reads from that address instead.</li>
+ <li><strong>Debloat lists and extra protected apps</strong>, from the public <code>tellyscope-devices</code> repository. If you set your own list address under Settings &rsaquo; Advanced, it reads from that address instead.</li>
+ <li><strong>Launchers, app names and streaming-app logos</strong>, from the <code>data/</code> folder of Tellyscope's own public repository.</li>
<li><strong>Update check (GitHub build only).</strong> The build from GitHub asks GitHub every 30 minutes whether a newer Tellyscope is out, and reads its release notes. You can turn this off in Settings. The Google Play build has no update check; Google Play updates it.</li>
<li><strong>Projectivy Launcher download (GitHub build only).</strong> When you choose Download directly, the GitHub build downloads Projectivy from its developer's GitHub releases and installs it on your TV. The Google Play build downloads nothing: it opens the Play Store on the TV, or on a Fire TV, Projectivy's GitHub page in your phone's browser, so you can pick the file you downloaded.</li>
</ul>