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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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<String, String> = 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. */
|
||||
|
||||
@@ -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 ->
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user