You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit aeb7bae
Browse filesBrowse the repository at this point in the historyBrowse files
Prove the self-hosted lock screen with the server really stopped, check the self-hosted path on the release build, and even out the two shards
Mock stack C's front end runs under ci/stack_control.py, which a test asks to stop and start. The
release-like build gets its own self-hosted test (no http exception at all), and check_apk fails a
release APK without the control's text or with a cleartext exception. The hardening tests move to
the lighter shard.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012xYtaUjbkB1hwLtK4TEzhq
Copy file name to clipboardExpand all lines: android-shell/PRODUCTION-PARITY.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ https://my.open.bot.
17
17
| App Links (the https callback) | Not tested here | Coded (`autoVerify` filter for `https://my.open.bot/api/auth/shell/callback`; used only when `DomainVerificationManager` reports the domain verified, API 31+). Needs a release signed with the real key and `/.well-known/assetlinks.json` on my.open.bot naming its SHA-256 fingerprint (TODO). Test: an internal-testing Play build once the server ships the hand-off. |
18
18
| WebView version | Real backend (two versions) | The default emulator (API 35) has Android System WebView 124.0.6367.219, frozen in the image; the `api_level: 36` run (Android 16, run 46126178447, all green) has WebView and Chrome 133.0.6943.137. Phones update it through Play (current is far newer); old or unupdated devices (no Play services, some markets) can be much older. The bridge needs `WEB_MESSAGE_LISTENER` and `DOCUMENT_START_SCRIPT` (WebView 86+, feature-checked; without them the user agent still marks the shell). |
19
19
| GPU drawing (the Bots "ghosting") | Emulator only | In recordings the Bots screen sometimes showed a faint second copy of its heading and rows. The page is clean: one `h1`, `scrollHeight` 628 equal to `innerHeight`, nothing duplicated in the DOM. Drawn in software (a canvas capture, and the WebView on a software layer) it is clean; drawn by the GPU compositor it ghosts, the same on API 35 (WebView 124.0.6367.219) and API 36 (WebView 133.0.6943.137). So it is the emulator's guest GPU renderer (`-gpu guest`), not the app or the page. The demo tour draws the Bots scene on a software layer for the recording only (debug hook `openbot.software_layer`); the app itself never does. Check on a real phone. |
20
-
| A self-hosted OpenBot | Simulated | Mock stack C on another origin (`http://127.0.0.1:3013`, a development host the debug build may reach over http) stands in for it: the field, each refusal, the hand-off with the custom scheme, relaunch, sign-out, back to Cloud with no session left, a page of the other origin getting no bridge, the lock screen (`SelfHostedTest`). Not tested: a real https self-hosted OpenBot, a private certificate authority (refused, see the README's follow-ups), a server behind a VPN or a captive portal. |
20
+
| A self-hosted OpenBot | Simulated | Mock stack C on another origin (`http://127.0.0.1:3013`, a development host the debug build may reach over http) stands in for it: the field, each refusal, the hand-off with the custom scheme, relaunch, sign-out, back to Cloud with no session left, a page of the other origin getting no bridge, the lock screen (`SelfHostedTest`). On the release-like build (no hooks, release's network rules) `RealBackendReleaseTest#testSelfHostedOnTheReleaseBuild` finds the quiet control and the field, sees `http://` refused even for a development host, and an https address checked and refused; `ci/check_apk.sh` fails a release APK without the control's text, with a cleartext exception, or with any hook name in its dex. The lock screen is proved with stack C's front end really stopped and started again (`ci/stack_control.py`). Not tested: a real https self-hosted OpenBot (so the saved address on the release build is the same code, not a separate run), a private certificate authority (refused, see the README's follow-ups), a server behind a VPN or a captive portal. |
21
21
| Cloudflare's bot check on my.open.bot | Real backend: seen, often | 403 `cf-mitigated: challenge` in the WebView, never in the Custom Tab. See the section below. |
22
22
| OEM differences | Not tested here | One Google emulator image. Samsung, Xiaomi and others ship their own launchers, keyboards, battery killers and sometimes their own WebView provider settings. Test on a Samsung and a Xiaomi device. |
23
23
| Edge to edge, insets, keyboard | Simulated | Target 36 forces edge to edge; the shell applies the insets itself, measured in CI on a 720×1600 screen at 320 dpi with gesture navigation (`testTabsRouteTheWebView`, `testKeyboardHidesTabBar`, the skeleton test). Three-button navigation, display cutouts of other shapes and foldables are not tested; a tablet size and rotation are (`HardeningTest`). On the emulator's guest GPU renderer, the resize when the keyboard closes on send leaves the web area blank (the page's background, no skeleton: it is not a new document) for about 0.5 s while the WebView redraws its tiles, and the bar comes back a moment later (demo run 46132747876, 47.6 to 48.2 s). Check on a phone. |
Copy file name to clipboardExpand all lines: android-shell/app/src/androidTest/java/ai/openbot/shell/test/SelfHostedTest.kt
+50-19Lines changed: 50 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -215,32 +215,63 @@ class SelfHostedTest : ShellTestBase() {
215
215
}
216
216
}
217
217
218
-
// 7. The lock screen names the server; Change address opens the field with the address in it.
218
+
/** Stops or starts mock stack C's front end through the CI's control server (ci/stack_control.py). */
219
+
privatefunstackC(action:String): Boolean=try {
220
+
val connection = java.net.URL("http://127.0.0.1:8790/stack-c/$action").openConnection() as java.net.HttpURLConnection
221
+
connection.requestMethod ="POST"
222
+
connection.connectTimeout =5_000
223
+
connection.readTimeout =40_000
224
+
val ok = connection.responseCode ==200
225
+
connection.disconnect()
226
+
note("stack C $action: $ok")
227
+
ok
228
+
} catch (error: java.io.IOException) {
229
+
note("stack C $action failed: ${error.javaClass.simpleName}")
230
+
false
231
+
}
232
+
233
+
// 7. With the self-hosted OpenBot really stopped: the lock screen names its host, Change address
234
+
// opens the field with the address in it, and once it is back Try again returns to the app.
219
235
@Test
220
236
funtestLockNamesTheServer() {
221
237
launch(MOCK_A, "lock-choose")
222
238
check(waitFor("sign_in_button", 20_000) !=null, "no Sign in button")
223
239
if (!chooseSelfHosted("lock")) return
224
-
launch(MOCK_A, "lock", reset =false, extras =mapOf("openbot.force_offline" to "1"))
225
-
check(waitFor("offline_lock", 15_000) !=null, "no lock screen")
226
-
checkEquals(string(ai.openbot.shell.R.string.lock_reaching, "127.0.0.1:3013"), find("offline_lock_host")?.text, "the host on the lock screen")
227
-
val change = find("lock_change_address")
228
-
if (!check(change !=null, "no Change address on the lock screen")) return
229
-
screenshot("1-lock-self-hosted")
230
-
change!!.click()
231
-
val field = waitFor("self_hosted_address", 5_000)
232
-
checkEquals(MOCK_C, field?.text, "the address field after Change address")
233
-
dismissKeyboardIfUp()
234
-
sleep(600)
235
-
screenshot("2-change-address")
236
-
find("self_hosted_cancel")?.click()
237
-
check(waitFor("offline_lock", 5_000) !=null, "Cancel did not return to the lock screen")
240
+
if (!check(signInThroughCustomTab("lock", shots =false), "signing in to the self-hosted server did not reach the tabs")) return
241
+
check(waitPageText("Start a conversation", 30_000), "no Home on the self-hosted server")
242
+
try {
243
+
if (!check(stackC("stop"), "could not stop the self-hosted OpenBot")) return
244
+
launch(MOCK_A, "lock", reset =false)
245
+
if (!check(waitFor("offline_lock", 40_000) !=null, "no lock screen with the self-hosted OpenBot stopped: ${debugState()}")) return
246
+
checkEquals(string(ai.openbot.shell.R.string.lock_reaching, "127.0.0.1:3013"), find("offline_lock_host")?.text, "the host on the lock screen")
247
+
val change = find("lock_change_address")
248
+
if (!check(change !=null, "no Change address on the lock screen")) return
249
+
screenshot("1-lock-self-hosted")
250
+
change!!.click()
251
+
val field = waitFor("self_hosted_address", 5_000)
252
+
checkEquals(MOCK_C, field?.text, "the address field after Change address")
253
+
dismissKeyboardIfUp()
254
+
sleep(600)
255
+
screenshot("2-change-address")
256
+
find("self_hosted_cancel")?.click()
257
+
check(waitFor("offline_lock", 5_000) !=null, "Cancel did not return to the lock screen")
258
+
if (!check(stackC("start"), "could not start the self-hosted OpenBot again")) return
259
+
find("retry_button")?.click()
260
+
check(waitGone("offline_lock", 30_000), "Try again did not lift the lock once the self-hosted OpenBot was back")
261
+
check(waitPageText("Start a conversation", 30_000), "no Home after the self-hosted OpenBot came back")
262
+
checkEquals(MOCK_C, pageString("location.origin"), "the page's origin after the lock")
263
+
screenshot("3-back-after-lock")
264
+
} finally {
265
+
stackC("start")
266
+
}
238
267
239
-
launch(MOCK_A, "lock-cloud", extras =mapOf("openbot.force_offline" to "1"))
240
-
check(waitFor("offline_lock", 15_000) !=null, "no lock screen on OpenBot Cloud")
241
-
checkEquals(string(ai.openbot.shell.R.string.lock_reaching, "localhost:3010"), find("offline_lock_host")?.text, "the host on OpenBot Cloud's lock screen")
268
+
// OpenBot Cloud that does not answer (a closed port as this build's Cloud): no Change address.
269
+
launch("http://127.0.0.1:8799", "lock-cloud")
270
+
waitFor("sign_in_button", 20_000)?.click()
271
+
check(waitFor("offline_lock", 30_000) !=null, "no lock screen when OpenBot Cloud does not answer")
272
+
checkEquals(string(ai.openbot.shell.R.string.lock_reaching, "127.0.0.1:8799"), find("offline_lock_host")?.text, "the host on OpenBot Cloud's lock screen")
242
273
check(find("lock_change_address") ==null, "Change address shows on OpenBot Cloud")
if!echo"$toggle"| grep -q 'Or sign in to a self-hosted OpenBot';thenecho"::error::the release APK lacks the self-hosted control's text (got '$toggle')";exit 1;fi
44
+
nsc="$("$analyzer" resources xml --file res/xml/network_security_config.xml "$release"2>/dev/null || true)"
0 commit comments