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.

Fire TV Reset TV: put Amazon's launcher back when Projectivy holds Home

jesse-agent-2320b66b7736414
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6e2da57..807ea25 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,8 @@ until this file has a section for its version.
## Unreleased
+- **Fixed:** On Fire TV, Reset TV now puts Amazon's launcher back when Projectivy holds Home, by turning its accessibility service off. Undo turns it back on.
+
## 0.13.0 — 2026-10-29
- **New:** Remote buttons open Netflix, YouTube, Plex and 20 more streaming apps. [#224](../../pull/224)
diff --git a/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt b/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt
index 7a66fd2..63fdc15 100644
--- a/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt
+++ b/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt
@@ -691,10 +691,16 @@ class AdbDeviceSource(context: Context) : DeviceSource {
// Home is a launcher the user added: the TV's own takes it back, the one a switch replaced first.
val added = options?.takeIf { it.default }?.current?.takeIf { it !in system }
val to = added?.let { homeBackTarget(it, book.entries(key(deviceId)), own) }?.pkg?.takeIf { it in system } ?: own.firstOrNull()
+ // Fire OS keeps Amazon's launcher the default; a launcher whose service is on holds Home instead.
+ val held = if (added == null && fireOs(deviceId, FIRE_TV_LAUNCHER in system)) Actions(shell).fireServiceHolder(serviceLaunchers)?.first else null
ResetPlan(
turnOn = scan.turnOn.map { ResetApp(it, labelOf(it)) },
bringBack = scan.bringBack.map { ResetApp(it, labelOf(it)) },
- home = if (added != null && to != null) ResetHome(added, labelOf(added), to, labelOf(to), service = added in serviceLaunchers) else null,
+ home = when {
+ added != null && to != null -> ResetHome(added, labelOf(added), to, labelOf(to), service = added in serviceLaunchers)
+ held != null -> ResetHome(held, labelOf(held), FIRE_TV_LAUNCHER, labelOf(FIRE_TV_LAUNCHER), service = true, serviceOnly = true)
+ else -> null
+ },
shippedOff = scan.shippedOff.size,
ownHome = (options?.current?.takeIf { it in system } ?: to ?: own.firstOrNull())?.let(::labelOf),
)
@@ -755,6 +761,13 @@ class AdbDeviceSource(context: Context) : DeviceSource {
* and the entry already holds the move.
*/
private suspend fun resetHome(actions: Actions, home: ResetHome): Pair<Map<String, String?>, String?> {
+ if (home.serviceOnly) {
+ // On Try again the service may be off already: nothing left to record.
+ val service = actions.homeService(home.from)?.takeIf { actions.serviceOn(it) } ?: return emptyMap<String, String?>() to null
+ if (!actions.setService(service, false)) throw IllegalStateException(fireServiceNotOff(home.fromLabel))
+ val left = actions.currentHome()?.let { actions.handOff(home.from, it) }?.let { notShown(home.toLabel, it.reason) }
+ return mapOf(ResetRecord.SERVICE to service) to left
+ }
val moved: Map<String, String?> = if (actions.currentHome()?.substringBefore('/') == home.to) emptyMap()
else when (val r = actions.homeBack(home.to)) {
is HomeResult.Switched -> listOfNotNull(ResetRecord.FROM to r.from, ResetRecord.TO to r.to).toMap()
@@ -794,6 +807,10 @@ class AdbDeviceSource(context: Context) : DeviceSource {
errors += "the TV kept ${labelOf(to.substringBefore('/'))} as the home screen"
} else p[ResetRecord.SERVICE]?.let { if (!actions.grant(it)) errors += serviceNotOn(name) }
}
+ // Fire OS: Home never moved, only the service went off.
+ if (p[ResetRecord.TO] == null) p[ResetRecord.SERVICE]?.let {
+ if (!actions.grant(it)) errors += serviceNotOn(labelOf(it.substringBefore('/')))
+ }
val ownHome = p[ResetRecord.TO]?.substringBefore('/')?.takeIf { homeLeft }
suspend fun each(pkgs: List<String>, change: suspend (String) -> Unit) = pkgs.filter { pkg ->
if (pkg == ownHome) return@filter true
diff --git a/app/src/main/java/app/tellyscope/data/ResetPlan.kt b/app/src/main/java/app/tellyscope/data/ResetPlan.kt
index 93fab34..6e81b59 100644
--- a/app/src/main/java/app/tellyscope/data/ResetPlan.kt
+++ b/app/src/main/java/app/tellyscope/data/ResetPlan.kt
@@ -8,8 +8,9 @@ data class ResetApp(val packageName: String, val label: String)
/**
* Home's part of a reset: [to], the TV's own launcher, is Home again in place of [from], a launcher
* the user added. [service]: [from] holds Home with an accessibility service, which goes off.
+ * [serviceOnly]: Fire OS, where [to] stays the default and the service alone holds Home for [from].
*/
-data class ResetHome(val from: String, val fromLabel: String, val to: String, val toLabel: String, val service: Boolean = false)
+data class ResetHome(val from: String, val fromLabel: String, val to: String, val toLabel: String, val service: Boolean = false, val serviceOnly: Boolean = false)
/**
* What Reset TV found on the TV before anything changes: preinstalled apps to [turnOn] and to
@@ -47,6 +48,6 @@ internal object ResetRecord {
fun list(previous: Map<String, String?>?, key: String) = previous?.get(key)?.split(',')?.filter { it.isNotEmpty() }.orEmpty()
- /** How many changes [previous] holds: each app, plus Home. */
- fun changes(previous: Map<String, String?>?) = list(previous, ON).size + list(previous, BACK).size + (if (previous?.get(TO) != null) 1 else 0)
+ /** How many changes [previous] holds: each app, plus Home (on Fire OS, only its service). */
+ fun changes(previous: Map<String, String?>?) = list(previous, ON).size + list(previous, BACK).size + (if (previous?.get(TO) != null || previous?.get(SERVICE) != null) 1 else 0)
}
diff --git a/app/src/test/java/app/tellyscope/HistoryBookTest.kt b/app/src/test/java/app/tellyscope/HistoryBookTest.kt
index d748eae..6d2daba 100644
--- a/app/src/test/java/app/tellyscope/HistoryBookTest.kt
+++ b/app/src/test/java/app/tellyscope/HistoryBookTest.kt
@@ -284,4 +284,10 @@ class HistoryBookTest {
assertEquals("Reset TV · 1 change", left.label)
assertEquals(1, ResetRecord.changes(left.previous))
}
+
+ @Test fun fireResetCountsTheServiceAsHome() {
+ // Fire OS: Home stays Amazon's launcher, so only the launcher's service is recorded.
+ val previous = mapOf(ResetRecord.ON to "a.b", ResetRecord.SERVICE to "g.h/.HomeService")
+ assertEquals(2, ResetRecord.changes(previous))
+ }
}