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.
Uninstall on the Home launcher's row, with a confirm that lists the steps
jesse-agent-23236d6769b9bcb
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0157a73..e8df933 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -12,6 +12,8 @@ until this file has a section for its version.## Unreleased+- **Fixed:** A launcher you installed shows as protected only while it is Home. [#158](../../pull/158)+- **New:** Uninstall the launcher on Home: Home switches back first, then it goes. [#158](../../pull/158)- **Fixed:** The Remote's clear button empties the TV's text box in apps that ignored it. [#157](../../pull/157)- **Improved:** A USB camera shows a camera icon and its name once, under Input. [#154](../../pull/154)- **Improved:** On Fire TV, the Remote's Home opens your default launcher. [#153](../../pull/153)diff --git a/README.md b/README.mdindex 8228585..14d1723 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 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.+- **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. The added launcher on Home also offers **Uninstall**: its confirm lists the steps, then Tellyscope switches Home back (turning the service off) and uninstalls it only if that worked. Only the launcher on Home is protected; another one you installed, such as FLauncher while Projectivy is Home, can be disabled or uninstalled. 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%">@@ -111,7 +111,7 @@ Debloating a TV can break it if done carelessly. Tellyscope is built around thes1. **Disable what came with the TV, never uninstall it.** Tellyscope uses `pm disable-user`, which is reversible from the app or with `pm enable`. Uninstall is offered only for apps `pm list packages -3` lists as installed by the user, and runs plain `pm uninstall` after a confirm that says it can't be undone. Tellyscope never runs `pm uninstall --user 0`, the form that removes a TV's own apps.2. **Record before changing.** Before the first change on a TV, Tellyscope notes which apps were already off, so **Restore everything** turns back on only what Tellyscope turned off. Every change goes into the TV's history with an Undo. The history lives on the phone and is deleted if you uninstall Tellyscope; a disabled app still shows in the Apps list with **Turn on**.-3. **Protected list.** Packages the TV needs to boot, install its updates, stay on Wi-Fi, show web pages, show the home screen or accept input are on a protected list. Tellyscope refuses to stop or disable them, and there is no override in the app. A TV's list can add keeps: those only warn in the confirm, and can be overridden. If the TV doesn't say which app is its home screen, Tellyscope refuses to stop or disable anything. The one exception is switching home screens: the old launcher is disabled only after another launcher has become Home and Home has been checked to open it; a stock launcher that outranks the rest, such as Android TV Home, is turned off first and turned back on if Home still doesn't open the new one. The current home screen itself never can be. A TV's suggested list never protects fewer apps; its keeps add a warning, not a lock.+3. **Protected list.** Packages the TV needs to boot, install its updates, stay on Wi-Fi, show web pages, show the home screen or accept input are on a protected list. Tellyscope refuses to stop or disable them, and there is no override in the app. A TV's list can add keeps: those only warn in the confirm, and can be overridden. If the TV doesn't say which app is its home screen, Tellyscope refuses to stop or disable anything. The one exception is switching home screens: the old launcher is disabled only after another launcher has become Home and Home has been checked to open it; a stock launcher that outranks the rest, such as Android TV Home, is turned off first and turned back on if Home still doesn't open the new one. The current home screen itself never can be stopped or disabled; one you installed can be uninstalled, after Home has gone back to the TV's own. A TV's suggested list never protects fewer apps; its keeps add a warning, not a lock.4. **No root, no exploits.** Only what ADB allows on a stock TV.5. **Nothing left on the TV.** Tellyscope copies two small helpers to `/data/local/tmp`. To show real app names and icons, the label helper runs once and is deleted; it only reads through PackageManager: no writes, no permissions, no network. While the Remote is open, the key helper keeps running to send keys and text, empty the TV's text box, and turn the screen off and on; it is deleted when the Remote closes.diff --git a/app/src/main/java/app/tellyscope/ui/Copy.kt b/app/src/main/java/app/tellyscope/ui/Copy.ktindex 343d59b..e91f64f 100644--- a/app/src/main/java/app/tellyscope/ui/Copy.kt+++ b/app/src/main/java/app/tellyscope/ui/Copy.kt@@ -239,6 +239,15 @@ object Copy {fun uninstallTitle(app: String) = "Uninstall $app?"+ /** The confirm for the launcher on Home: Home goes back first, and a failed step stops it. */+ fun uninstallHome(app: String, back: String, service: Boolean) = listOfNotNull(+ "$app is your home screen. Before removing it, Tellyscope:",+ "1. Makes $back the home screen again, turning it back on if it's off.",+ "2. Turns off $app's accessibility service.".takeIf { service },+ "${if (service) 3 else 2}. Uninstalls it, with everything saved in it. This can't be undone.",+ "If a step fails, Tellyscope stops there, says which one, and doesn't uninstall.",+ ).joinToString("\n\n")+/** The Apps tabs' header over the apps the TV needs, and why they're apart. */const val SYSTEM = "System"const val SYSTEM_WHY = "Needed by the TV · can't be changed"diff --git a/app/src/main/java/app/tellyscope/ui/DeviceScreen.kt b/app/src/main/java/app/tellyscope/ui/DeviceScreen.ktindex 16f41a6..168969a 100644--- a/app/src/main/java/app/tellyscope/ui/DeviceScreen.kt+++ b/app/src/main/java/app/tellyscope/ui/DeviceScreen.kt@@ -372,7 +372,11 @@ fun UninstallDialog(app: AppInfo, onUninstall: () -> Unit, onDismiss: () -> UnitAlertDialog(onDismissRequest = onDismiss,title = { Text(Copy.uninstallTitle(app.label)) },- text = { Text(Copy.explain(Action.Uninstall, app.label, app.packageName) + if (app.listKeep) "\n\n${Copy.KEEP_WARNING}" else "") },+ text = {+ // The launcher on Home: what happens before it goes, in order.+ val what = app.homeBack?.let { Copy.uninstallHome(app.label, it, app.homeService) } ?: Copy.explain(Action.Uninstall, app.label, app.packageName)+ Text(what + if (app.listKeep) "\n\n${Copy.KEEP_WARNING}" else "")+ },confirmButton = {Button(onClick = onUninstall,@@ -459,6 +463,7 @@ internal fun AppRow(if (home != null) OutlinedButton(onClick = { actions.propose(app.packageName, Action.Home) }, enabled = !locked) { Text(Copy.MAKE_HOME) }if (back != null && app.homeServiceOff) FilledTonalButton(onClick = { turningOn = true }, enabled = !locked) { Text(Copy.TURN_ON) }if (back != null) OutlinedButton(onClick = { actions.propose(app.packageName, Action.HomeBack) }, enabled = !locked) { Text(Copy.homeBack(back)) }+ if (back != null && app.removable) OutlinedButton(onClick = { actions.propose(app.packageName, Action.Uninstall) }, enabled = !locked) { Text(Copy.button(Action.Uninstall)) }} else if (proposed == Action.Uninstall) {UninstallDialog(app, onUninstall = actions.confirm, onDismiss = actions.cancel, enabled = !locked)} else {diff --git a/app/src/test/java/app/tellyscope/HomeServiceTest.kt b/app/src/test/java/app/tellyscope/HomeServiceTest.ktindex 09490ac..d2909aa 100644--- a/app/src/test/java/app/tellyscope/HomeServiceTest.kt+++ b/app/src/test/java/app/tellyscope/HomeServiceTest.kt@@ -11,6 +11,7 @@ import app.tellyscope.ui.AppRowimport app.tellyscope.ui.Copyimport app.tellyscope.ui.DeviceActionsimport app.tellyscope.ui.ServiceOffCard+import app.tellyscope.ui.UninstallDialogimport org.junit.Assert.assertEqualsimport org.junit.Assert.assertFalseimport org.junit.Assert.assertTrue@@ -62,6 +63,27 @@ class HomeServiceTest {private val onHome = projectivy.copy(homeInstead = null, homeBack = "Google TV Home", homeServiceOff = true, homeServiceNote = true, protectedReason = "this is your home screen")+ @Test fun theLauncherOnHomeOffersUninstallAndItsConfirmListsTheSteps() {+ var proposed: Pair<String, Action>? = null+ compose.setContent { AppRow(onHome.copy(removable = true), emptyList(), null, busy = false, actions = DeviceActions(propose = { p, a -> proposed = p to a })) }+ compose.onNodeWithText("Projectivy Launcher").performClick()+ compose.onNodeWithText(Copy.button(Action.Uninstall)).performClick()+ assertEquals(pkg to Action.Uninstall, proposed)+ }++ @Test fun theHomeUninstallConfirmSaysWhatHappensFirst() {+ compose.setContent { UninstallDialog(onHome.copy(removable = true), onUninstall = {}, onDismiss = {}) }+ compose.onNodeWithText(Copy.uninstallHome("Projectivy Launcher", "Google TV Home", service = true)).assertExists()+ assertTrue("Turns off Projectivy Launcher's accessibility service" in Copy.uninstallHome("Projectivy Launcher", "Google TV Home", service = true))+ assertFalse("accessibility" in Copy.uninstallHome("FLauncher", "Google TV Home", service = false))+ }++ @Test fun aLauncherOnHomeTheTvCameWithOffersNoUninstall() {+ compose.setContent { AppRow(onHome, emptyList(), null, busy = false, actions = DeviceActions()) }+ compose.onNodeWithText("Projectivy Launcher").performClick()+ compose.onNodeWithText(Copy.button(Action.Uninstall)).assertDoesNotExist()+ }+@Test fun theRowSaysTheServiceIsOffAndOffersTurnOn() {var on: String? = nullcompose.setContent { AppRow(onHome, emptyList(), null, busy = false, actions = DeviceActions(homeServiceOn = { on = it })) }