Repository navigation
fix(pairing): let a phone set up an Android TV on a plain-HTTP server - #666
Conversation
Every credential-bearing request from the TV to a plain-HTTP origin needs that origin's cleartext approval on the TV. Manual server entry asks for it, but phone setup never did, so device sign-in against a pushed HTTP server was refused before it started and the TV and phone both reported "can't reach" the server. Home servers on a LAN address usually serve plain HTTP. The TV's "Allow this setup?" step now says when the pushed address is unencrypted, with the same warning as manual entry, and allowing it approves exactly that origin. A later plain-HTTP server in the same session asks again rather than riding on the first consent.
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The plain-HTTP warning and repeat consent during pairing ( Suggested fix: Add before-and-after captures of the same TV consent screen and a recording of the multi-step phone-to-TV pairing flow, naming the TV device and build or commit. Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
|
Evidence is now published: https://evidence.siloserver.org/r/silo-android/pr-666/ (the Evidence check passes). It has before and after captures of the same TV consent screen, of the TV after Allow, and of the tablet's result, with the TV built from A recording isn't included: the change adds one warning line to the consent step and lets the flow finish. It doesn't change motion, timing or focus, and the evidence has a still of each step that differs. |
Problem
Related issue: Silo-Server/silo-server#1192
Validation tasks: unblocks #337 C2 and #336 C1; Silo-Server/silo-apple#326 C1; Silo-Server/silo-server#1193 C2
A phone or tablet can't set up an Android TV when its server uses plain HTTP, which is how most home servers on a LAN address run. The TV user taps Allow, then after about 40 seconds both the TV and the phone say the TV "can't reach" the server. No sign-in request ever reaches the server.
The TV needs its own cleartext approval for every credential-bearing request to a plain-HTTP origin. Manual server entry asks for it ("Connect without encryption?"); phone setup never did. So the TV's
POST /api/v2/auth/device/startto the pushed server was refused locally, and the failure surfaced as unreachable.Approach
When the pushed address is plain HTTP and this TV hasn't approved it, the TV's existing "Allow this setup?" step adds the manual-entry warning: "Your password and what you watch will be sent unencrypted to . Only do this on a network you trust." Allowing approves exactly that origin, then sign-in starts. The TV owner still decides; nothing is approved without that prompt.
A later plain-HTTP server in the same handover asks again instead of riding on the first consent. The phone waits 30 seconds for each later server, so that second ask has to be answered within 30 seconds. Declining it ends the handover, as declining always has; servers already signed in stay signed in. A verified alternate address that is also plain HTTP is not approved by this change.
Validation
PairingReceiverTest: allowing a plain-HTTP server approves its origin before sign-in starts, and a later plain-HTTP server in a consented session asks again. Both failed before the change../gradlew testDebugUnitTest: 6140 tests, one failure,ReflowStyleTest > line height flows from settings, which fails the same way onmain.Evidence
Evidence: https://evidence.siloserver.org/r/silo-android/pr-666/
Surface and build: Android TV emulator (Android 14) set up from a Pixel Tablet emulator (Android 16), TV debug builds from
mainand this branch, server at the emulator host aliashttp://10.0.2.2:18241. The change is in the TV app; the phone app is unchanged and shows the same card on phone, tablet and foldable, so the tablet capture stands for all three.Risks
The TV now accepts a plain-HTTP server through phone setup, after its user reads the same warning manual entry shows. HTTPS servers are unaffected.
Checklist
AI Disclosure
Note
Require TV consent for pairing with plain-HTTP servers
PairingReceivernow takes aCleartextConsentStoreand pauses with aConsentRequestedstate (unencrypted flag set) when a pushed server URL uses an unencrypted origin.strings.xml.PairingReceivergains a requiredCleartextConsentStoreconstructor parameter — all callers, including theandroidTvModuleprovider and tests in TvLoginScreenNetworkSignInTest.kt, are updated.Macroscope summarized 9c85c17.