android: the server address needs no scheme; the app tries https, then http (#8316)

The sign-in screen took only a full http:// or https:// URL and saved it
unchecked. It now accepts host, host:port or host/path. With no scheme typed
it asks https first and falls back to http only when https could not connect.
A certificate that fails to verify stops the probe instead, so nothing on the
path can force a quiet downgrade. Either way the address must answer
GET /api/auth/setup-status as Minstrel before it is saved, with its scheme.

Plain http still passes the cleartext guard, so the fallback only succeeds on
a home-network address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 11:11:01 -05:00
co-authored by Claude Opus 5.5
parent 2ce4fd3edb
commit 107832b640
5 changed files with 373 additions and 23 deletions
+2
View File
@@ -232,6 +232,8 @@ dependencies {
testImplementation(libs.mockk)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.okhttp.mockwebserver)
// HeldCertificate: a test-only CA, so the server probe can be driven over real TLS.
testImplementation(libs.okhttp.tls)
// kxml2 — provides an org.xmlpull.v1 impl on the JVM unit-test
// classpath. Android's stock XmlPullParserFactory resolves to the
// android.jar Stub on JVM tests; kxml2 is picked up via service-