From b42dbda7acc27672be5fb3fce89b52517ca5bdcd Mon Sep 17 00:00:00 2001 From: Pauljd Date: Tue, 10 Nov 2026 12:41:59 +0000 Subject: [PATCH] Editions on the emulator: Play isolation, 400 to 402 to 410 migration, Play recovery options Adds PlayEditionTest: the Play edition never answers the room update routes. Co-Authored-By: Claude Opus 5.5 --- .../java/tv/orbit/classic/PlayEditionTest.kt | 27 ++++++ docs/EDITIONS-EMULATOR-2026-11-10.md | 85 +++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 android/app/src/testPlay/java/tv/orbit/classic/PlayEditionTest.kt create mode 100644 docs/EDITIONS-EMULATOR-2026-11-10.md diff --git a/android/app/src/testPlay/java/tv/orbit/classic/PlayEditionTest.kt b/android/app/src/testPlay/java/tv/orbit/classic/PlayEditionTest.kt new file mode 100644 index 00000000..a862648c --- /dev/null +++ b/android/app/src/testPlay/java/tv/orbit/classic/PlayEditionTest.kt @@ -0,0 +1,27 @@ +package tv.orbit.classic + +import org.junit.Assert.* +import org.junit.Rule +import org.junit.Test +import org.junit.rules.TemporaryFolder +import java.net.InetAddress + +/** The Play edition (Paul, 10 November 2026): it never shares itself with another room, even if a copy were handed to it. */ +class PlayEditionTest { + @get:Rule val folder = TemporaryFolder() + + @Test fun anotherRoomAskingForAnUpdateGetsNothing() { + assertEquals("play", Edition.NAME) + PhoneLink.initForTest(object : PhoneStore { + override fun all() = emptyMap(); override fun get(id: String): String? = null + override fun put(id: String, value: String) {}; override fun remove(id: String) {} }) + PhoneLink.bindTo = InetAddress.getLoopbackAddress(); PhoneLink.port = 18_098; PhoneLink.allowed = { it.isLoopbackAddress } + val apk = folder.newFile("orbit.apk").apply { writeBytes(ByteArray(1_000) { 7 }) } + fun status(path: String) = (java.net.URL("http://127.0.0.1:18098$path").openConnection() as java.net.HttpURLConnection).responseCode + try { + PhoneLink.shared = SharedBuild(402, "0.127.0-play", apk); PhoneLink.listening = true + assertEquals(404, status("/room/version")); assertEquals(404, status("/room/orbit.apk")) + assertFalse(Edition.serveUpdate("/room/version", "GET", java.io.ByteArrayOutputStream(), PhoneLink.shared) { _, _ -> fail("answered") }) + } finally { PhoneLink.listening = false; PhoneLink.stop(); PhoneLink.allowed = EmbyServer::isHomeAddress; PhoneLink.bindTo = null; PhoneLink.port = PhoneLink.PORT; PhoneLink.shared = null } + } +} diff --git a/docs/EDITIONS-EMULATOR-2026-11-10.md b/docs/EDITIONS-EMULATOR-2026-11-10.md new file mode 100644 index 00000000..c6947624 --- /dev/null +++ b/docs/EDITIONS-EMULATOR-2026-11-10.md @@ -0,0 +1,85 @@ +# Both editions on the Android TV 14 emulator, Play recovery, and checking the key backups (10 November 2026) + +Throwaway signing key only (`CN=Orbit emulator test key (throwaway)`, shredded afterwards). The real debug key, any +future key, Google Play and both TVs were untouched. The release outputs in the build folder stay unsigned: signed +copies were made in a scratch folder only. + +## 1. What was run + +| Build | Code | Source | +| --- | --- | --- | +| Household | 400 | the gate's unsigned APK, signed on a copy (SHA-256 of the unsigned file `c996a12e…`) | +| Play | 402 | the gate's unsigned APK, signed on a copy (`2e84e0c5…`) | +| Household | 410 | the same code built as build 41, to stand in for the next release (`0.128.0-test`) | + +Test data: a copy of downstairs' household data from the 0.125.0 install backup (277 schedule files, settings and +profiles), plus downstairs' BumbleHive Arcade save, loaded through household's own install-check tools. + +## 2. The Play edition on the emulator + +**Updater and test hooks are gone from the running app.** I checked each one directly: + +| Check | Household 400 | Play 402 | +| --- | --- | --- | +| `REQUEST_INSTALL_PACKAGES` granted to the package | yes | **no** (dumpsys: 0 mentions) | +| adb install check (snapshot broadcast) | answers `copied 277` | **no receiver**: the broadcast completes with nothing | +| Hand-run playback test activity | opens | **doesn't exist** (Error type 3) | +| adb shadow comparison and switches (`orbit_shadow_catalogue`, `orbit_provider_catalogue on`, `orbit_avi on`) | act | **ignored**: no report folder, no switch log | +| Room update routes (`/room/version`, `/room/orbit.apk`) | answer (unit test) | **"not found" even when handed a copy** (new PlayEditionTest) | + +**Shared features work in Play.** Signed in to the local Silo test server (test account from silo-test's own settings) +and walked the first-launch steps by remote: + +- Server sign-in. The address field started empty (0.126 change), and the Play build shows `Orbit TV 0.127.0-play` under Account. +- Onboarding with "Join another room". +- Settings > Rooms and phones: this room's name, Bring in from another room, Add a room, Connect a phone. +- Family: added an Adult profile, "Tester", which got its own Personalise switch and "What Orbit has learnt" (Taste) page. + +**Not exercised on Play:** + +- **Watching.** Silo's six made-up titles don't match any channel, so no programme played on Play. Taste events and Continue Watching weren't created there. +- **The Arcade screen.** With no channel on, Orbit opens on Settings, and the main menu wasn't reachable in the time I gave it. + +All of these are the same code in both editions. Play's 1,145 unit tests run them, and their data carried through +unchanged (below). + +## 3. Version-code migration: household 400 → Play 402 → household 410 + +| Step | Result | +| --- | --- | +| Household 400, test data loaded, snapshot | 277 schedule files, settings, profiles, Arcade save | +| Update to Play 402 | Installed as an update; Orbit opened normally; no crashes | +| Update to household 410 | Installed as an update | +| Snapshot after 410, compared with before 402 | **280 of 280 files byte for byte the same.** 2,400 bookings, 13,070 planned programmes, Taste, Continue Watching, profiles, choices, Drive-In tickets and the Arcade save all unchanged. | +| Play 402 over 410, and household 400 over 410 | Both refused as downgrades, as expected | + +## 4. Recovering a Play installation (no adb install check) + +What still works, in order of preference: + +1. **Fix forward through Play.** Release a higher build: the next build's Play code, or the next release. Play can stop a staged rollout part-way, but it can't hand an older version to a phone or TV that already updated. This is the normal route. +2. **The recovery slot.** Every build has a slot at build × 10 + 9: 409 for build 40. That's above both 400 and 402, so a household recovery build signed with the same key installs over a Play install by adb. It brings back the adb install check, so restore-tv.sh works again. Only possible once the TVs and Play share the same key (after the rotation). +3. **Rooms.** On a Play TV, Settings > Rooms and phones > Bring in from another room merges everyone's profiles, what Orbit has learnt (Taste) and Continue Watching from another TV. Add a room copies channels, profiles and the look to a fresh install. Schedules rebuild from the channels. +4. **Server-side.** Watched status and resume points also live on Emby or Jellyfin when progress reporting is on. +5. **Not available on Play:** Android's own backup is off for Orbit (`allowBackup=false`, so tokens never leave the TV), and there's no adb snapshot. + +**Gap worth closing before launch:** a user-run "Back up Orbit to my phone" in the Companion. It would export the +schedules, profiles, Taste and Continue Watching, but no sign-in or PIN, and restore them on a Play install without adb. +It isn't built. It needs your OK. + +## 5. Checking the existing key backups, done by you + +Script: `/home/pauljd/Documents/OrbitTV/recovery/verify-signing-backups.sh`. Read it first; it's 50 lines. + +- **Run it yourself** in your own terminal. It refuses to run inside Claude (it checks for Claude's environment) and without a keyboard. I confirmed the refusal; nothing was created. +- **`… usb`**: mount the stick. gpg asks for the Fourth Built passphrase. +- **`… bitwarden`**: copy the Orbit secure note's text in Bitwarden first. gpg asks for the paper recovery passphrase. +- **It compares against recorded values,** not the PC's copy of the key. The decrypted file's SHA-256 must be `e7267d42…be98`, and the certificate inside must be `04:2F:96:…:58:E1`, the one in every Orbit APK. So it also proves the backup works if this PC is gone. +- **Nothing leaks.** gpg and keytool ask for passphrases themselves, so they're not echoed and not on a command line. The decrypted copy exists only in memory (`/dev/shm`) and is shredded on exit. A fresh, empty gpg home is used, and the clipboard is cleared afterwards. It prints only MATCH or NO MATCH. +- keytool asks for the keystore password. For this debug keystore it's the public `android`. + +## Blockers and things to decide + +- **Nothing blocks the next step on my side.** The remaining Play checks (playing a programme, the Arcade screen) need either a channel that matches Silo's titles, or a signed Play build on a real TV, which needs your signing approval. +- **One thing to look at:** the emulator's accessibility dump showed the typed password in plain text. Orbit's password field is a `BasicSecureTextField` set to Hidden, and on screen it shows dots. Compose marks the field as a password for accessibility services. I'd like to confirm what a screen reader actually receives before calling it a problem. +- **Decision for you:** whether to build the phone backup in section 4 before launch.