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.
No better-home-screen card or Tweaks row once Home is an added launcher
jesse-agent-2325b4e3476dfe7
diff --git a/README.md b/README.mdindex 8a99e55..8228585 100644--- a/README.md+++ b/README.md@@ -80,7 +80,7 @@ Tellyscope is a phone app that talks to your Android TV, Google TV or Fire TV ov- **The main jobs up front.** Big **Install app**, **Debloat** and **Send file** tiles sit right under the vitals. Debloat shows a count while the TV's list still has apps on, or while apps Tellyscope turned off are back on, often after a TV update. When there's nothing left, it opens Apps instead. Below the tiles, one line says how many apps on the TV's list are off. If any came back on, a red line says so. Below that are the TV's Android version, when it last updated, and **Check for updates**, which opens the TV's own update screen. The Apps tab has an **Install app** button, and Files has **Upload files**.- **Advanced.** Every number in one place: memory, storage, CPU, temperature, uptime and screen state, CPU and RAM by app, processes, network and data used, and the TV's address.- **Apps.** Every app on the TV with its real name and icon, under three buttons: **Running** (what's using memory now), **Installed** (only the apps you put on the TV) and **Built-in** (what came with it). The buttons stay pinned under the bar as you scroll. Stop, disable or turn back on any app that isn't protected; each button says what it will do and asks first. Apps you installed yourself also offer **Uninstall**, which asks in a dialog that names the app and says it can't be undone. On Running and Built-in, the protected apps sit last under **System**, which folds away with a tap and stays folded until you open it again. **Search apps** sits under the buttons and pins with them. Tap it and the field moves to the top, the TV and the buttons step aside, and every matching app shows in one list. ← or Back brings them back.-- **Another home screen.** On a TV with the Play Store, Apps shows a card that offers a better home screen, and Tweaks keeps **Choose one** after **Not now** puts the card away for that TV. Pick one of four recommended launchers (Projectivy, AT4K, Dispatch or the open-source FLauncher), and Tellyscope opens its Play Store page on the TV, waits for the install and then offers to make it Home. If the Store doesn't open, it says so and offers another launcher or a retry. With a second launcher such as Projectivy installed, its row in Apps offers **Set as default launcher**. Tellyscope makes it Home, checks that Home really opens it, and only then disables the old launcher, so the TV can't switch back by itself. The one exception: a stock launcher that outranks the rest, e.g. Android TV Home, is turned off first and turned back on if Home still doesn't open the new one. One Undo in History turns the old launcher back on and makes it Home again. Later, the new launcher's row offers **Switch home back to** the one it replaced, or the TV's own if there was no switch: it's turned back on if it's off and made Home, and the added launcher stays, free to uninstall. For a launcher that keeps Home with its own accessibility service, such as Projectivy (the ones marked in [`launchers.json`](app/src/main/assets/launchers.json)), Set as default then asks separately whether to turn that service on, for TVs whose Home button opens their own launcher whatever the default is: **Turn it on** or **Switch without it**. Without it, the TV's page says Home may still open the TV's own launcher, with **Got it** and **Turn on**, and the launcher's row keeps **Turn on**. Undo and Switch home back turn it off again, and any other accessibility services stay as they were. Settings and other apps that only answer Home as a fallback are never offered as launchers. On Google TV, the Apps row and the Live tab are part of the old launcher and go with it.+- **Another home screen.** On a TV with the Play Store whose Home is still its own launcher, Apps shows a card that offers a better home screen, and Tweaks keeps **Choose one** after **Not now** puts the card away for that TV. Neither shows once Home opens a launcher you added. Tellyscope isn't affiliated with any of the launchers it recommends. Pick one of four recommended launchers (Projectivy, AT4K, Dispatch or the open-source FLauncher), and Tellyscope opens its Play Store page on the TV, waits for the install and then offers to make it Home. If the Store doesn't open, it says so and offers another launcher or a retry. With a second launcher such as Projectivy installed, its row in Apps offers **Set as default launcher**. Tellyscope makes it Home, checks that Home really opens it, and only then disables the old launcher, so the TV can't switch back by itself. The one exception: a stock launcher that outranks the rest, e.g. Android TV Home, is turned off first and turned back on if Home still doesn't open the new one. One Undo in History turns the old launcher back on and makes it Home again. Later, the new launcher's row offers **Switch home back to** the one it replaced, or the TV's own if there was no switch: it's turned back on if it's off and made Home, and the added launcher stays, free to uninstall. For a launcher that keeps Home with its own accessibility service, such as Projectivy (the ones marked in [`launchers.json`](app/src/main/assets/launchers.json)), Set as default then asks separately whether to turn that service on, for TVs whose Home button opens their own launcher whatever the default is: **Turn it on** or **Switch without it**. Without it, the TV's page says Home may still open the TV's own launcher, with **Got it** and **Turn on**, and the launcher's row keeps **Turn on**. Undo and Switch home back turn it off again, and any other accessibility services stay as they were. Settings and other apps that only answer Home as a fallback are never offered as launchers. On Google TV, the Apps row and the Live tab are part of the old launcher and go with it.- **Debloat.** It finds your TV among 300+ tested clean-up lists (adapted from [cleanyourtv](https://github.com/Gathin23/cleanyourtv)) and opens on every app it will turn off, with the model on top. With no list for the model, it shows apps from the maker's other lists, none ticked. With none for the maker either, you tick the TV's own apps by hand; the ones it needs aren't shown. **Not this TV?** searches every list. Your pick is remembered, and the TV's page then says how many of the list's apps are still on. Apps are pre-ticked only when the TV runs the Android version the list was tested on; untick anything you use, and you confirm before anything is disabled. If you'd rather not trust our lists, point the app at your own fork of them under **Advanced** in Settings (see [CONTRIBUTING](CONTRIBUTING.md#using-your-own-lists)).<img src="docs/screenshots/clean-home.jpg" alt="A TV home screen after debloating: the inputs and the user's own apps, with no ads or suggestions" width="100%">diff --git a/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt b/app/src/main/java/app/tellyscope/data/AdbDeviceSource.ktindex 4580304..d7cf622 100644--- a/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt+++ b/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt@@ -404,6 +404,7 @@ class AdbDeviceSource(context: Context) : DeviceSource {icon = name.icon,removable = p.name in userInstalled,home = p.name == homeOptions?.current,+ listedLauncher = launchers.any { it.pkg == p.name },homeInstead = homeOptions?.takeIf { p.name in it.others }?.current,homeBack = back?.takeIf { p.name == homeOptions?.current }?.let { names[it.pkg]?.label ?: AppNames.fallback(it.pkg) },homeService = p.name in serviceLaunchers,diff --git a/app/src/main/java/app/tellyscope/data/Model.kt b/app/src/main/java/app/tellyscope/data/Model.ktindex b9f02ec..a380186 100644--- a/app/src/main/java/app/tellyscope/data/Model.kt+++ b/app/src/main/java/app/tellyscope/data/Model.kt@@ -126,6 +126,8 @@ data class AppInfo(val removable: Boolean = false,/** The launcher Home opens now. */val home: Boolean = false,+ /** On the bundled `launchers.json`: a launcher people add, never a TV's own. */+ val listedLauncher: Boolean = false,/** Another launcher that can replace the current home screen, [homeInstead]: "Set as default launcher" is offered. */val homeInstead: String? = null,/** On the home screen the user added: the name of the launcher "Switch home back" returns to. */diff --git a/app/src/main/java/app/tellyscope/ui/LauncherFlowUi.kt b/app/src/main/java/app/tellyscope/ui/LauncherFlowUi.ktindex 4f76da3..2ffa8f4 100644--- a/app/src/main/java/app/tellyscope/ui/LauncherFlowUi.kt+++ b/app/src/main/java/app/tellyscope/ui/LauncherFlowUi.kt@@ -66,13 +66,19 @@ import app.tellyscope.data.Deviceconst val PLAY_STORE = "com.android.vending"/**- * Install a home screen is offered on the Apps tab while the TV has the Play Store and no second- * launcher, until Not now; Tweaks offers it whenever the Store is there.+ * Install a home screen is offered on the Apps tab while the TV has the Play Store, Home is still+ * a stock launcher and there's no second launcher, until Not now; Tweaks offers it whenever the+ * Store is there and Home is stock.*/internal fun hasPlayStore(apps: List<AppInfo>) = apps.any { it.packageName == PLAY_STORE && it.enabled }+/** Home opens a launcher someone added: one they installed, or one on `launchers.json`. With the stock one off, there's no [AppInfo.homeBack] to tell. */+internal fun homeIsAdded(apps: List<AppInfo>) = apps.any { it.home && (it.removable || it.listedLauncher) }++internal fun offerChoose(apps: List<AppInfo>) = hasPlayStore(apps) && !homeIsAdded(apps)+internal fun offerLauncher(apps: List<AppInfo>, hidden: Boolean) =- !hidden && hasPlayStore(apps) && apps.none { it.homeInstead != null || it.homeBack != null }+ !hidden && offerChoose(apps) && apps.none { it.homeInstead != null || it.homeBack != null }data class LauncherActions(val close: () -> Unit = {},diff --git a/app/src/main/java/app/tellyscope/ui/TweaksBlock.kt b/app/src/main/java/app/tellyscope/ui/TweaksBlock.ktindex 09b81d4..149cada 100644--- a/app/src/main/java/app/tellyscope/ui/TweaksBlock.kt+++ b/app/src/main/java/app/tellyscope/ui/TweaksBlock.kt@@ -56,7 +56,7 @@ fun TweaksBlock(ui: DeviceUi, actions: DeviceActions) {}ButtonRow(Copy.CACHES_TITLE, Copy.CACHES_TEXT, Copy.CACHES_BUTTON, enabled = ui.busy == null, actions.clearCaches)ButtonRow(Copy.SCREENSHOT_TITLE, Copy.SCREENSHOT_TEXT, Copy.SCREENSHOT_BUTTON, enabled = ui.busy == null, actions.screenshot)- if (hasPlayStore(ui.apps)) ButtonRow(Copy.ANOTHER_HOME, Copy.ANOTHER_HOME_TEXT, Copy.CHOOSE_ONE, enabled = ui.busy == null, actions.installLauncher)+ if (offerChoose(ui.apps)) ButtonRow(Copy.ANOTHER_HOME, Copy.ANOTHER_HOME_TEXT, Copy.CHOOSE_ONE, enabled = ui.busy == null, actions.installLauncher)if (askDns) DnsDialog(onDismiss = { askDns = false }) { host -> askDns = false; actions.setDns(host) }}diff --git a/app/src/test/java/app/tellyscope/LauncherFlowTest.kt b/app/src/test/java/app/tellyscope/LauncherFlowTest.ktindex 6caf853..3055079 100644--- a/app/src/test/java/app/tellyscope/LauncherFlowTest.kt+++ b/app/src/test/java/app/tellyscope/LauncherFlowTest.kt@@ -27,6 +27,7 @@ import app.tellyscope.ui.PLAY_STOREimport app.tellyscope.ui.STORE_POLL_MSimport app.tellyscope.ui.STORE_WAIT_MSimport app.tellyscope.ui.TellyscopeViewModel+import app.tellyscope.ui.offerChooseimport app.tellyscope.ui.offerLauncherimport kotlinx.coroutines.Dispatchersimport kotlinx.coroutines.ExperimentalCoroutinesApi@@ -221,6 +222,18 @@ class LauncherScreenTest {assertFalse(offerLauncher(listOf(store, stock, other), hidden = false))}+ @Test fun anAddedLauncherOnHomeWithTheStockOneOffGetsNoCardAndNoTweaksRow() {+ // Stock launcher disabled by hand or by Debloat: Projectivy is Home with no homeBack.+ val off = stock.copy(enabled = false, home = false)+ val projectivy = AppInfo(PROJECTIVY, "Projectivy Launcher", null, false, true, "this is your home screen", "1.0", home = true, listedLauncher = true)+ assertFalse(offerLauncher(listOf(store, off, projectivy), hidden = false))+ assertFalse(offerChoose(listOf(store, off, projectivy)))+ // Any user-installed launcher counts, listed or not.+ val other = AppInfo("com.example.home", "Home", null, false, true, null, "1.0", removable = true, home = true)+ assertFalse(offerChoose(listOf(store, off, other)))+ assertTrue(offerChoose(listOf(store, stock)))+ }+@Test fun theCardsTwoButtons() {var notNow = falsevar chose = false