From 4d6ea7008de4b3213c3caa2e2b38944e406511dc Mon Sep 17 00:00:00 2001 From: Pauljd Date: Sun, 8 Nov 2026 11:04:08 +0000 Subject: [PATCH] Kids gate on the phone's Create: no browsing or searching the library while Kids watches (0.108.106) Audit S8. Past the remote routes, every phone API is Create's, so one check refuses all of it while a Kids profile is watching: search, suggestions, shows, facets, collections, browse, channel lists, brands, unplayable, arrivals, Taste and watch. The remote (now, guide, Catch Up, tune) is unchanged; /api/watch already refused hidden channels. Co-Authored-By: Claude Opus 5.5 --- android/app/build.gradle.kts | 4 ++-- android/app/src/main/java/tv/orbit/classic/EmbyClient.kt | 4 ++-- android/app/src/main/java/tv/orbit/classic/PhoneLink.kt | 3 +++ .../main/java/tv/orbit/classic/SecureMediaDataSource.kt | 2 +- .../app/src/test/java/tv/orbit/classic/PhoneLinkTest.kt | 7 +++++++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index f6e6b818..151728be 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -9,8 +9,8 @@ android { applicationId = "tv.orbit.classic" minSdk = 26 targetSdk = 36 - versionCode = 265 - versionName = "0.108.105-pin-limit" + versionCode = 266 + versionName = "0.108.106-kids-phone" } buildFeatures { compose = true } // The finished build for the TVs (Paul, 6 November 2026: the test build stuttered on the box). Not debuggable, so diff --git a/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt b/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt index 71da6bfa..f9e3b227 100644 --- a/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt +++ b/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt @@ -62,9 +62,9 @@ internal class HttpsEmbyTransport(internal val deviceId: String = UUID.randomUUI } /** The sign-in headers for this kind of server. */ internal fun authHeaders(token: String?): Map = when (kind) { - ServerKind.Emby -> mapOf("X-Emby-Authorization" to "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.105\"") + + ServerKind.Emby -> mapOf("X-Emby-Authorization" to "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.106\"") + (token?.let { mapOf("X-Emby-Token" to it) } ?: emptyMap()) - ServerKind.Jellyfin -> mapOf("Authorization" to "MediaBrowser Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.105\"" + + ServerKind.Jellyfin -> mapOf("Authorization" to "MediaBrowser Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.106\"" + (token?.let { ", Token=\"$it\"" } ?: "")) } /** One picture from the provider, or nothing. Same fixed origin and no redirects, and failures are never shown or logged. */ diff --git a/android/app/src/main/java/tv/orbit/classic/PhoneLink.kt b/android/app/src/main/java/tv/orbit/classic/PhoneLink.kt index 35fa5844..b3a1a5a5 100644 --- a/android/app/src/main/java/tv/orbit/classic/PhoneLink.kt +++ b/android/app/src/main/java/tv/orbit/classic/PhoneLink.kt @@ -299,6 +299,9 @@ internal object PhoneLink { private fun api(r: Request, out: OutputStream, phone: String) { active = prefs().get(phone)?.substringBefore('|') if (companion(r, out)) return + // Kids on the phone (8 November 2026, audit S8): everything past the remote is Create's (browsing, searching and + // making channels), so while Kids is watching none of it answers, not just the routes that change things. + if (!OrbitCompanion.grownUp) return json(out, 403, JSONObject().put("error", "Kids is watching. Switch to Adult to use Create.")) val h = standIn ?: handler ?: return json(out, 403, JSONObject().put("error", "The TV isn't signed in to a library right now.")) when ("${r.method} ${r.path}") { "GET /api/channels" -> json(out, 200, JSONObject().put("next", CustomChannels.nextNumber() ?: JSONObject.NULL).put("channels", JSONArray(CustomChannels.list.map { c -> diff --git a/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt b/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt index 61e2ffcf..af2dec95 100644 --- a/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt +++ b/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt @@ -39,7 +39,7 @@ internal class SecureMediaDataSource(private val session: EmbySampleSession) : B next.instanceFollowRedirects = false next.connectTimeout = 10_000 next.readTimeout = 20_000 - next.setRequestProperty("User-Agent", "OrbitTV/0.108.105") + next.setRequestProperty("User-Agent", "OrbitTV/0.108.106") next.setRequestProperty("Accept-Encoding", "identity") session.mediaHeaders(address).forEach { (key, value) -> next.setRequestProperty(key, value) } if (dataSpec.position != 0L || dataSpec.length != C.LENGTH_UNSET.toLong()) { diff --git a/android/app/src/test/java/tv/orbit/classic/PhoneLinkTest.kt b/android/app/src/test/java/tv/orbit/classic/PhoneLinkTest.kt index 587c55fd..276d9a46 100644 --- a/android/app/src/test/java/tv/orbit/classic/PhoneLinkTest.kt +++ b/android/app/src/test/java/tv/orbit/classic/PhoneLinkTest.kt @@ -248,8 +248,15 @@ class PhoneLinkTest { assertEquals(200, call("/api/profile", "POST", """{"id":"$kidsId"}""", cookie = cookie).status); assertTrue(Profiles.kids) assertEquals(403, call("/api/director", cookie = cookie).status) assertEquals(403, call("/api/channels", "POST", """{"name":"X","shows":[]}""", cookie = cookie).status) + // Nor browsing or searching the library (8 November 2026, audit S8), while the remote itself still works. + for (path in listOf("/api/search?q=xf", "/api/suggest?d=sci-fi", "/api/shows?number=701", "/api/facets", "/api/collections", "/api/browse?genre=Drama", + "/api/channels", "/api/brands", "/api/unplayable", "/api/arrivals", "/api/taste")) + assertEquals(path, 403, call(path, cookie = cookie).status) + assertEquals(403, call("/api/watch", "POST", """{"number":701}""", cookie = cookie).status) + assertEquals(200, call("/api/now", cookie = cookie).status) // Back to Adult (no PIN set here, so it goes straight in, as on the TV). assertEquals(200, call("/api/profile", "POST", """{"id":"$adultId"}""", cookie = cookie).status); assertFalse(Profiles.kids) + assertEquals(200, call("/api/search?q=xf", cookie = cookie).status) assertEquals(403, call("/api/profile", "POST", """{"id":"nobody"}""", cookie = cookie).status) } finally { PhoneLink.screen = null; Profiles.current = before } }