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.

Play build: a play flavor with no updater and no GitHub download

jesse-agent-2326baf50ef988d
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 36f9ec9..fe34854 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -32,7 +32,7 @@ You don't have to trust ours. Fork tellyscope-devices, edit the lists in your fo
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 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.
-- `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. The app names no launcher itself: what it needs to install one from an APK comes from its entry (`signers`, `max_mb`, `releases`, `fire_os`; `DataListsTest` checks their formats). On Fire OS, which has no Play Store, only the `fire_os` launcher is offered, while it's on the list with `signers`: Tellyscope downloads it from its `releases` page and installs only an APK signed with one of its `signers` ([`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, for any launcher with both `signers` and `releases` (`downloadable` in [`LauncherFlowUi.kt`](app/src/main/java/app/tellyscope/ui/LauncherFlowUi.kt)). When `data/` fails its signature check ([below](#signing-data)), every one of those installs first shows the list's address and the signer, and waits for a tick saying you trust them: Tellyscope can then only check the APK matches the list.
+- `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. The app names no launcher itself: what it needs to install one from an APK comes from its entry (`signers`, `max_mb`, `releases`, `fire_os`; `DataListsTest` checks their formats). On Fire OS, which has no Play Store, only the `fire_os` launcher is offered, while it's on the list with `signers`: Tellyscope downloads it from its `releases` page and installs only an APK signed with one of its `signers` ([`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, for any launcher with both `signers` and `releases` (`downloadable` in [`LauncherFlowUi.kt`](app/src/main/java/app/tellyscope/ui/LauncherFlowUi.kt)). The Play build downloads neither: on Fire OS it asks you to download the launcher in your browser and pick the file, which it checks the same way. When `data/` fails its signature check ([below](#signing-data)), every one of those installs first shows the list's address and the signer, and waits for a tick saying you trust them: Tellyscope can then only check the APK matches the list.
- `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`.
@@ -111,7 +111,7 @@ Changing a public key needs an app release. To rotate, the `sign` job signs with
They come from the screenshot tests, so they always show the current UI with sample data. To refresh them, render the tests, then put them in phone frames (needs Python 3 with Pillow):
```sh
-./gradlew :app:testDebugUnitTest --tests '*ScreenshotTest' -Proborazzi.test.record=true
+./gradlew :app:testGithubDebugUnitTest --tests '*ScreenshotTest' -Proborazzi.test.record=true
python3 docs/screenshots/frame.py
```
diff --git a/README.md b/README.md
index 447be35..d69a8c5 100644
--- a/README.md
+++ b/README.md
@@ -118,9 +118,11 @@ Modules: `:app` (the phone app, Kotlin and Jetpack Compose), `:adb` (pure Kotlin
```sh
./gradlew build # assemble, unit tests and lint
-./gradlew :app:installDebug
+./gradlew :app:installGithubDebug
```
+There are two builds of the same app, as Gradle flavors: `github`, the APK on GitHub releases, and `play`, the Play Store's. The Play build has no update check (Play updates it) and downloads nothing from GitHub: on Fire OS you download Projectivy in your browser and pick the file. The code checks `BuildConfig.PLAY`.
+
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md). If you have an Android TV, a [device report](../../issues/new?template=device_report.yml) helps even if nothing worked.
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 8eb049b..4e2b801 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -40,6 +40,21 @@ android {
buildConfigField("String", "DATA_BASE", "\"$data\"")
}
+ // Two builds of one app: the same app ID and release key. github is the APK on GitHub releases;
+ // play is the Play Store's AAB, with no in-app update and nothing downloaded from GitHub
+ // (BuildConfig.PLAY, a constant, so R8 drops that code from it).
+ flavorDimensions += "store"
+ productFlavors {
+ create("github") {
+ dimension = "store"
+ buildConfigField("boolean", "PLAY", "false")
+ }
+ create("play") {
+ dimension = "store"
+ buildConfigField("boolean", "PLAY", "true")
+ }
+ }
+
// Only the languages Tellyscope is translated into: drops the ~80 other locales AndroidX and
// Material ship (about 440 KB). A new values-xx/strings.xml adds its code here too.
androidResources {
diff --git a/app/src/main/java/app/tellyscope/MainActivity.kt b/app/src/main/java/app/tellyscope/MainActivity.kt
index df2eb83..3c92daf 100644
--- a/app/src/main/java/app/tellyscope/MainActivity.kt
+++ b/app/src/main/java/app/tellyscope/MainActivity.kt
@@ -126,13 +126,15 @@ class MainActivity : ComponentActivity() {
TellyscopeViewModel(
scenario?.let(::FakeDeviceSource) ?: AdbDeviceSource(applicationContext),
AndroidPhoneStorage(applicationContext),
- updates = if (scenario != null) null else updateCheck(),
+ // Play updates the Play build itself, so it has no update check of its own.
+ updates = if (scenario != null || BuildConfig.PLAY) null else updateCheck(),
folds = FoldBook(File(filesDir, "folds.properties")),
keyHaptics = KeyHaptics(File(filesDir, "remote.properties")),
gates = FoldBook(File(filesDir, "gates.properties")),
historySeen = SeenBook(File(filesDir, "history-seen.properties")),
appFacts = AppFacts(installedVersion(), "${Build.MANUFACTURER} ${Build.MODEL}, Android ${Build.VERSION.RELEASE}"),
launcherDownload = if (scenario != null) null else AndroidLauncherDownload(applicationContext),
+ play = BuildConfig.PLAY,
)
}
},
@@ -222,7 +224,8 @@ fun TellyscopeApp(vm: TellyscopeViewModel) {
val saveFile = rememberLauncherForActivityResult(ActivityResultContracts.CreateDocument("application/octet-stream"), vm::saveTo)
val saveScreenshot = rememberLauncherForActivityResult(ActivityResultContracts.CreateDocument("image/png"), vm::screenshotTo)
- state.update?.let { u ->
+ // Never in the Play build: the constant lets R8 drop the dialog from it.
+ if (!BuildConfig.PLAY) state.update?.let { u ->
UpdateDialog(
u,
onDownload = { vm.updateLater(); u.apk?.let { runCatching { browser.openUri(it) } } },
@@ -368,6 +371,7 @@ fun TellyscopeApp(vm: TellyscopeViewModel) {
),
snackbar = snackbar,
direct = vm.directDownload,
+ play = BuildConfig.PLAY,
)
} else if (debloat && state.device.debloat != null) {
// Leaving mid-run only closes the screen; the run goes on, and History has each app.
diff --git a/app/src/main/java/app/tellyscope/data/LauncherDownload.kt b/app/src/main/java/app/tellyscope/data/LauncherDownload.kt
index d2c629e..06e8f1e 100644
--- a/app/src/main/java/app/tellyscope/data/LauncherDownload.kt
+++ b/app/src/main/java/app/tellyscope/data/LauncherDownload.kt
@@ -7,6 +7,7 @@ import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import androidx.core.content.pm.PackageInfoCompat
+import app.tellyscope.BuildConfig
import app.tellyscope.adb.ApkInfo
import app.tellyscope.adb.Progress
import kotlinx.coroutines.Dispatchers
@@ -100,6 +101,8 @@ class AndroidLauncherDownload(context: Context) : LauncherDownload {
* Throws [RateLimited] only when the page didn't answer either.
*/
override suspend fun latest(launcher: KnownLauncher): LauncherRelease = withContext(Dispatchers.IO) {
+ // The Play build downloads no code from outside Play; R8 drops the rest.
+ if (BuildConfig.PLAY) throw IOException("not in the Play build")
val releases = launcher.releases ?: throw IOException("no releases page for ${launcher.pkg}")
val limited = try {
return@withContext parseRelease(api(releases), launcher) ?: throw IOException("no release of ${launcher.pkg}")
@@ -150,6 +153,7 @@ class AndroidLauncherDownload(context: Context) : LauncherDownload {
}
override suspend fun fetch(launcher: KnownLauncher, release: LauncherRelease, onProgress: (Progress) -> Unit): PickedApp = withContext(Dispatchers.IO) {
+ if (BuildConfig.PLAY) throw IOException("not in the Play build")
dir.deleteRecursively()
dir.mkdirs()
val file = File(dir, apkName(launcher))
diff --git a/app/src/main/java/app/tellyscope/ui/Copy.kt b/app/src/main/java/app/tellyscope/ui/Copy.kt
index 1d9a769..f44e176 100644
--- a/app/src/main/java/app/tellyscope/ui/Copy.kt
+++ b/app/src/main/java/app/tellyscope/ui/Copy.kt
@@ -247,6 +247,7 @@ object Copy {
/** Install a launcher on Fire OS: Tellyscope downloads it from its developer's GitHub and installs it over adb. */
fun installLauncher(name: String) = UiText(R.string.copy_install_launcher, name)
val FIRE_INSTALL_TEXT = UiText(R.string.copy_fire_install_text)
+ val FIRE_PICK_TEXT = UiText(R.string.copy_fire_pick_text)
fun downloadsFrom(name: String) = UiText(R.string.copy_downloads_from, name)
diff --git a/app/src/main/java/app/tellyscope/ui/LauncherFlowUi.kt b/app/src/main/java/app/tellyscope/ui/LauncherFlowUi.kt
index 92b3cab..5dca02f 100644
--- a/app/src/main/java/app/tellyscope/ui/LauncherFlowUi.kt
+++ b/app/src/main/java/app/tellyscope/ui/LauncherFlowUi.kt
@@ -177,6 +177,7 @@ fun LauncherCard(current: String?, onNotNow: () -> Unit, onChoose: () -> Unit, f
* A TV that didn't open the Store says so; a Store closed without installing goes back to the picker.
* On Fire OS ([LauncherFlow.fireOs]) the picker is the list's Fire OS launcher alone, which Tellyscope downloads and installs.
* [direct]: a launcher that is [downloadable] also offers Download directly, under the Store and after a warning.
+ * [play]: the Play build, where Fire OS's launcher is a file the user downloads in the browser and picks.
*/
@OptIn(ExperimentalMaterial3Api::class)
@Composable
@@ -187,6 +188,7 @@ fun LauncherScreen(
actions: LauncherActions,
snackbar: SnackbarHostState = remember { SnackbarHostState() },
direct: Boolean = false,
+ play: Boolean = false,
) {
var chosen by rememberSaveable(flow.step, flow.pkg) { mutableStateOf(flow.pkg) }
var askService by rememberSaveable(flow.step) { mutableStateOf(false) }
@@ -246,7 +248,7 @@ fun LauncherScreen(
) {
when (flow.step) {
LauncherFlow.Step.Pick -> if (fire != null) {
- FireButtons(fire, flow.pkg, actions, Modifier.weight(1f))
+ FireButtons(fire, flow.pkg, actions, play, Modifier.weight(1f))
} else {
val have = installedLauncher(apps, chosen)
when {
@@ -301,7 +303,7 @@ fun LauncherScreen(
}
val c = MaterialTheme.colorScheme
when (flow.step) {
- LauncherFlow.Step.Pick -> if (fire != null) FireBody(fire, flow.pkg, device, actions) else Picker(chosen, apps, direct) { chosen = it }
+ LauncherFlow.Step.Pick -> if (fire != null) FireBody(fire, flow.pkg, device, play, actions) else Picker(chosen, apps, direct) { chosen = it }
LauncherFlow.Step.Waiting -> {
Hero(LauncherIcons.Download, c.secondaryContainer, c.onSecondaryContainer)
Headed(Copy.INSTALL_IT.resolve(), bold(Copy.installItText(label).resolve(), label, stringResource(R.string.launcher_install_word)))
@@ -392,11 +394,11 @@ private fun Picker(chosen: String, apps: List<AppInfo>, direct: Boolean, onChoos
}
}
-/** Fire OS's picker: [l] alone, about it as the picker says it, and nothing to do on the TV. */
+/** Fire OS's picker: [l] alone, about it as the picker says it, and nothing to do on the TV ([play]: pick the file here). */
@Composable
-private fun FirePick(l: Recommended?) {
+private fun FirePick(l: Recommended?, play: Boolean = false) {
val c = MaterialTheme.colorScheme
- Text(Copy.FIRE_INSTALL_TEXT.resolve(), style = MaterialTheme.typography.bodyLarge, color = c.onSurfaceVariant)
+ Text((if (play) Copy.FIRE_PICK_TEXT else Copy.FIRE_INSTALL_TEXT).resolve(), style = MaterialTheme.typography.bodyLarge, color = c.onSurfaceVariant)
l ?: return
Surface(shape = MaterialTheme.shapes.large, color = c.surfaceContainer, modifier = Modifier.fillMaxWidth()) {
Column(Modifier.padding(16.dp)) {
@@ -416,12 +418,12 @@ private fun FirePick(l: Recommended?) {
* source row opening that release page on the phone), the download, the check and the install, then what
* went wrong. Couldn't download offers the release page and Pick the downloaded file, checked the same way.
* After Download directly ([FireInstall.store]) the confirm is a warning, and it and a wrong signature offer
- * the Play Store instead.
+ * the Play Store instead. In the Play build ([play]) nothing downloads: the start is the picker with those two steps.
* While the launcher list fails its check ([FireInstall.list]) each step that can install it opens on [UnverifiedCard].
*/
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
@Composable
-private fun FireBody(f: FireInstall, pkg: String, device: Device, actions: LauncherActions) {
+private fun FireBody(f: FireInstall, pkg: String, device: Device, play: Boolean, actions: LauncherActions) {
val c = MaterialTheme.colorScheme
val uri = LocalUriHandler.current
val l = RECOMMENDED.firstOrNull { it.pkg == pkg }
@@ -440,6 +442,9 @@ private fun FireBody(f: FireInstall, pkg: String, device: Device, actions: Launc
release?.let { SourceRow(source, it, openPage) }
Text(Copy.DIRECT_CHECK.resolve(), style = MaterialTheme.typography.bodyMedium, color = c.onSurfaceVariant)
Text(Copy.STORE_SAFER.resolve(), style = MaterialTheme.typography.bodyMedium, color = c.onSurfaceVariant)
+ } else if (play) {
+ FirePick(l, play = true)
+ Yourself(f, label, source, openPage, actions)
} else {
FirePick(l)
if (release != null) {
@@ -481,8 +486,8 @@ private fun FireBody(f: FireInstall, pkg: String, device: Device, actions: Launc
}
/**
- * Download it in the browser, then pick it: after Couldn't download. While the list fails its check, picking waits
- * for the tick ([TrustRow]).
+ * Download it in the browser, then pick it: after Couldn't download, and the Play build's only way. While the list
+ * fails its check, picking waits for the tick ([TrustRow]).
*/
@Composable
private fun Yourself(f: FireInstall, label: String, source: String?, openPage: () -> Unit, actions: LauncherActions) {
@@ -504,16 +509,16 @@ private fun Yourself(f: FireInstall, label: String, source: String?, openPage: (
/**
* The bottom of each Fire OS step, for [pkg]: full width, so the confirm reads the same as Download directly's.
- * While the list fails its check, the download waits for the tick ([TrustRow]).
+ * While the list fails its check, the download waits for the tick ([TrustRow]). [play]: nothing to download.
*/
@Composable
-private fun FireButtons(f: FireInstall, pkg: String, actions: LauncherActions, modifier: Modifier) {
+private fun FireButtons(f: FireInstall, pkg: String, actions: LauncherActions, play: Boolean, modifier: Modifier) {
val store = { actions.install(pkg) }
val check = { actions.fireCheck(pkg) }
Column(modifier, verticalArrangement = Arrangement.spacedBy(8.dp)) {
val wide = Modifier.fillMaxWidth()
when (f.step) {
- null, FireInstall.Step.Checking -> IconButtonText(LauncherIcons.Download, Copy.installLauncher(launcherName(pkg)).resolve(), wide, enabled = f.step == null, onClick = check)
+ null, FireInstall.Step.Checking -> if (!play) IconButtonText(LauncherIcons.Download, Copy.installLauncher(launcherName(pkg)).resolve(), wide, enabled = f.step == null, onClick = check)
// The safe way first and filled; the download only as the outlined second.
FireInstall.Step.Confirm -> if (f.store) {
IconButtonText(OpenInNew, Copy.GET_FROM_STORE.resolve(), wide, onClick = store)
@@ -525,6 +530,9 @@ private fun FireButtons(f: FireInstall, pkg: String, actions: LauncherActions, m
}
FireInstall.Step.Downloading, FireInstall.Step.Reading, FireInstall.Step.Installing -> Unit
FireInstall.Step.WrongApk -> when {
+ f.picked && play -> Row(wide, horizontalArrangement = Arrangement.End) {
+ Button(onClick = actions.firePick) { Text(Copy.PICK_ANOTHER.resolve()) }
+ }
f.picked -> Row(wide, horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.End)) {
TextButton(onClick = actions.firePick) { Text(Copy.PICK_ANOTHER.resolve()) }
Button(onClick = check) { Text(Copy.TRY_DOWNLOAD_AGAIN.resolve()) }
diff --git a/app/src/main/java/app/tellyscope/ui/TellyscopeViewModel.kt b/app/src/main/java/app/tellyscope/ui/TellyscopeViewModel.kt
index 12cbcab..b50886d 100644
--- a/app/src/main/java/app/tellyscope/ui/TellyscopeViewModel.kt
+++ b/app/src/main/java/app/tellyscope/ui/TellyscopeViewModel.kt
@@ -431,6 +431,8 @@ class TellyscopeViewModel(
private val launcherDownload: LauncherDownload? = null,
/** `data/`'s address while the launcher list fails its check, or null once it passes. */
private val unverified: () -> String? = { SharedLists.unverified },
+ /** The Play build: nothing comes from GitHub, so on Fire OS the launcher is only ever a file the user picks. */
+ private val play: Boolean = false,
) : ViewModel() {
private val _state = MutableStateFlow(UiState(now = clock()))
@@ -971,8 +973,8 @@ class TellyscopeViewModel(
private fun setFire(id: String, f: (FireInstall) -> FireInstall) =
updateDevice(id) { d -> d.copy(launcher = d.launcher?.let { l -> l.fire?.let { l.copy(fire = f(it)) } }) }
- /** Download directly is offered beside the Play Store: there's a way to download, as on Fire OS. */
- val directDownload get() = launcherDownload != null
+ /** Download directly is offered beside the Play Store: there's a way to download, as on Fire OS. Never in the Play build. */
+ val directDownload get() = launcherDownload != null && !play
/** [pkg]'s entry on the launcher list, when it says how to check its APK: the only launchers installed from one. */
private fun apkLauncher(pkg: String?): KnownLauncher? =
@@ -1006,13 +1008,13 @@ class TellyscopeViewModel(
/**
* The list's check changed since the flow read it ([FireInstall.list]), so the signers may not be what the user
- * saw or ticked: back to Checking against the list as it is now, and nothing installs.
+ * saw or ticked: back to Checking against the list as it is now (in the Play build, to the pick), and nothing installs.
*/
private fun listChanged(id: String, flow: LauncherFlow): Boolean {
val fire = flow.fire ?: return false
val list = unverified()
if (list == fire.list) return false
- checkLauncherApk(flow.pkg)
+ if (play) setFire(id) { FireInstall(list = list) } else checkLauncherApk(flow.pkg)
return true
}
@@ -1061,7 +1063,9 @@ class TellyscopeViewModel(
// The picker answers on its own timing: only from a step that offers it, never over a running install.
val fire = flow.fire ?: return
val step = fire.step
- if (step != FireInstall.Step.NoDownload && step != FireInstall.Step.WrongApk && step != FireInstall.Step.Refused) return
+ // The Play build offers it from the start.
+ val start = play && step == null
+ if (!start && step != FireInstall.Step.NoDownload && step != FireInstall.Step.WrongApk && step != FireInstall.Step.Refused) return
if (fire.gated || listChanged(id, flow)) return
launcherJob?.cancel()
setFire(id) { it.copy(step = FireInstall.Step.Reading, picked = true, progress = null, size = null) }
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 9e89d6d..0db7dab 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -108,6 +108,7 @@
<string name="copy_not_installed_text">Play Store se cerró en la TV antes de terminar la instalación. Si la tienda dijo que no está disponible para esta TV, elige otro launcher.</string>
<string name="copy_install_launcher">Instalar %1$s</string>
<string name="copy_fire_install_text">Una pantalla de inicio sin anuncios. Tellyscope la instala en la TV por ti; no tienes que hacer nada en la TV.</string>
+ <string name="copy_fire_pick_text">Una pantalla de inicio sin anuncios. Descárgala en tu navegador y luego elige el archivo aquí. Tellyscope la instala en la TV.</string>
<string name="copy_downloads_from">Tellyscope descarga %1$s de la página de versiones del propio desarrollador:</string>
<string name="copy_release">Versión %1$s · %2$s</string>
<string name="copy_where_from">De dónde viene</string>
diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml
index a69f1d6..fc5420a 100644
--- a/app/src/main/res/values-hi/strings.xml
+++ b/app/src/main/res/values-hi/strings.xml
@@ -108,6 +108,7 @@
<string name="copy_not_installed_text">इंस्टॉल होने से पहले ही TV पर Play Store बंद हो गया। अगर Store ने बताया कि यह इस TV के लिए उपलब्ध नहीं है, तो कोई दूसरा लॉन्चर चुनें।</string>
<string name="copy_install_launcher">%1$s इंस्टॉल करें</string>
<string name="copy_fire_install_text">बिना विज्ञापन वाली होम स्क्रीन। Tellyscope इसे आपके लिए TV पर इंस्टॉल कर देता है; TV पर आपको कुछ नहीं करना है।</string>
+ <string name="copy_fire_pick_text">बिना विज्ञापन वाली होम स्क्रीन। इसे अपने ब्राउज़र में डाउनलोड करें, फिर यहाँ फ़ाइल चुनें। Tellyscope इसे TV पर इंस्टॉल कर देता है।</string>
<string name="copy_downloads_from">Tellyscope %1$s को डेवलपर के अपने रिलीज़ पेज से डाउनलोड करता है:</string>
<string name="copy_release">रिलीज़ %1$s · %2$s</string>
<string name="copy_where_from">यह कहां से आता है</string>
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index 8b94166..60b8b78 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -108,6 +108,7 @@
<string name="copy_not_installed_text">インストールが終わる前に、テレビの Play ストアが閉じられました。このテレビでは利用できないと表示された場合は、別のランチャーを選んでください。</string>
<string name="copy_install_launcher">%1$s をインストール</string>
<string name="copy_fire_install_text">広告のないホーム画面です。Tellyscope がテレビにインストールするので、テレビ側での操作は不要です。</string>
+ <string name="copy_fire_pick_text">広告のないホーム画面です。ブラウザでダウンロードしてから、ここでファイルを選んでください。Tellyscope がテレビにインストールします。</string>
<string name="copy_downloads_from">Tellyscope は %1$s を開発元の公式リリースページからダウンロードします:</string>
<string name="copy_release">リリース %1$s・%2$s</string>
<string name="copy_where_from">入手元</string>
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 9b65e84..43ec069 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -108,6 +108,7 @@
<string name="copy_not_installed_text">Play Маркет на телевизоре закрылся до завершения установки. Если там было написано, что приложение недоступно для этого телевизора, выберите другой лаунчер.</string>
<string name="copy_install_launcher">Установить %1$s</string>
<string name="copy_fire_install_text">Главный экран без рекламы. Tellyscope сам установит его на телевизор, на телевизоре ничего делать не нужно.</string>
+ <string name="copy_fire_pick_text">Главный экран без рекламы. Скачайте его в браузере, затем выберите файл здесь. Tellyscope установит его на телевизор.</string>
<string name="copy_downloads_from">Tellyscope скачивает %1$s со страницы релизов самого разработчика:</string>
<string name="copy_release">Релиз %1$s · %2$s</string>
<string name="copy_where_from">Откуда он берется</string>
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 9486847..3abf19e 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -108,6 +108,7 @@
<string name="copy_not_installed_text">安装完成前,电视上的 Play 商店已关闭。如果商店提示此电视无法使用该应用,请选择其他启动器。</string>
<string name="copy_install_launcher">安装 %1$s</string>
<string name="copy_fire_install_text">没有广告的主屏幕。Tellyscope 会为你在电视上安装,无需在电视上进行任何操作。</string>
+ <string name="copy_fire_pick_text">没有广告的主屏幕。先在浏览器中下载,然后在这里选择该文件。Tellyscope 会将其安装到电视上。</string>
<string name="copy_downloads_from">Tellyscope 从开发者自己的发布页面下载 %1$s:</string>
<string name="copy_release">版本 %1$s · %2$s</string>
<string name="copy_where_from">来源</string>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index b1c93fe..83ed14b 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -142,6 +142,7 @@
<!-- Installing a launcher's APK (Fire OS, or Download directly): from its developer's GitHub, installed over adb. %1$s the launcher's name -->
<string name="copy_install_launcher">Install %1$s</string>
<string name="copy_fire_install_text">A home screen without ads. Tellyscope installs it on the TV for you; there\'s nothing to do on the TV.</string>
+ <string name="copy_fire_pick_text">A home screen without ads. Download it in your browser, then pick the file here. Tellyscope installs it on the TV.</string>
<!-- %1$s the app's name -->
<string name="copy_downloads_from">Tellyscope downloads %1$s from the developer\'s own release page:</string>
<!-- %1$s the version, %2$s its size (copy_size_*) -->
diff --git a/app/src/test/java/app/tellyscope/FireOsTest.kt b/app/src/test/java/app/tellyscope/FireOsTest.kt
index 99ce443..da813ec 100644
--- a/app/src/test/java/app/tellyscope/FireOsTest.kt
+++ b/app/src/test/java/app/tellyscope/FireOsTest.kt
@@ -239,10 +239,10 @@ class FireOsTest {
assertFalse(projectivy.copy(signers = emptySet()).accepts(PROJECTIVY, setOf(SIGNER)))
}
- /** [list]: the launcher list's address, as one that failed its check. */
- private fun TestScope.opened(list: String? = null): TellyscopeViewModel {
+ /** [list]: the launcher list's address, as one that failed its check. [play]: the Play build. */
+ private fun TestScope.opened(list: String? = null, play: Boolean = false): TellyscopeViewModel {
unverified = list
- val v = TellyscopeViewModel(source, clock = { 0L }, launcherDownload = download, unverified = { unverified })
+ val v = TellyscopeViewModel(source, clock = { 0L }, launcherDownload = download, unverified = { unverified }, play = play)
vm = v
runCurrent()
v.openLauncherFlow()
@@ -420,6 +420,35 @@ class FireOsTest {
assertEquals(true, fire?.gated)
}
+ @Test fun thePlayBuildPicksAFileFromTheStartAndDownloadsNothing() = with(test) {
+ val v = opened(play = true)
+ assertNull(v.state.value.device.launcher?.fire?.step)
+ v.pickedLauncherApk(Uri.parse("content://downloads/1"))
+ runCurrent()
+ assertEquals(0, download.fetched)
+ assertEquals(listOf(PROJECTIVY), source.installs.map { it.packageName })
+ assertEquals(LauncherFlow.Step.Installed, v.state.value.device.launcher?.step)
+ }
+
+ @Test fun thePlayBuildOffersNoDownloadDirectly() = with(test) {
+ source = FireTv(androidTv, listOf(store, tvHome))
+ assertFalse(opened(play = true).directDownload)
+ }
+
+ @Test fun inThePlayBuildFromAnUnverifiedListThePickWaitsForTheTick() = with(test) {
+ val v = opened(list = UNVERIFIED, play = true)
+ assertEquals(true, v.state.value.device.launcher?.fire?.gated)
+ v.pickedLauncherApk(Uri.parse("content://downloads/1"))
+ runCurrent()
+ assertTrue(source.installs.isEmpty())
+
+ v.trustLauncherList(true)
+ v.pickedLauncherApk(Uri.parse("content://downloads/1"))
+ runCurrent()
+ assertEquals(0, download.fetched)
+ assertEquals(listOf(PROJECTIVY), source.installs.map { it.packageName })
+ }
+
@Test fun failingTheCheckUnderConfirmChecksAgainFirst() = with(test) {
val v = opened()
v.checkLauncherApk(PROJECTIVY)
diff --git a/docs/screenshots/frame.py b/docs/screenshots/frame.py
index 124987f..df2fd07 100644
--- a/docs/screenshots/frame.py
+++ b/docs/screenshots/frame.py
@@ -4,7 +4,7 @@
Render the screenshot tests first, then run this from the repository root:
- ./gradlew :app:testDebugUnitTest --tests '*ScreenshotTest' -Proborazzi.test.record=true
+ ./gradlew :app:testGithubDebugUnitTest --tests '*ScreenshotTest' -Proborazzi.test.record=true
python3 docs/screenshots/frame.py
Needs Pillow (pip install pillow).