Repository navigation
Keep the Android bridge out of third-party frames (E8); pin abaplint 2.120.75 - #11
Merged
Merged
Conversation
The abap workflow ran @abaplint/cli@latest, so a new abaplint release could turn the weekly run red without any change here. CONVENTIONS §4 pins one version everywhere; AGENTS.md no longer lists this as a known gap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Te3BRpRpxNhZAYnrQL6Gdt
addJavascriptInterface hands __a2u5Android to every frame, so a frame of another origin inside an app page (an embedded site) reached the bridge transport; the shell could only check the main frame's URL. The transport is now the message channel of androidx.webkit (WebViewCompat.addWebMessageListener) with the endpoint's origin as the only allowed-origin rule: the WebView injects __a2u5AndroidChannel into frames of that origin only, and the listener answers the main frame only, like iOS. A new endpoint origin re-registers the channel. A WebView without WEB_MESSAGE_LISTENER keeps the @JavascriptInterface transport with the main-frame check as before, and logs that it does. The shim speaks both Android transports (contract tests for the channel), BridgeMessage is the channel's JSON wire format (JVM-tested), and the bridge contract, AGENTS.md, PLAN.md, DISTRIBUTION.md, TESTING.md and NEXT_STEPS.md describe the new transport. Not yet tested on a device. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Te3BRpRpxNhZAYnrQL6Gdt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two commits:
Pin abaplint to 2.120.75 -
abap.yml(and the commands in AGENTS.md / CONTRIBUTING.md) ran@abaplint/cli@latest; CONVENTIONS §4 pins one version ecosystem-wide, so the known gap in AGENTS.md is closed. abaplint 2.120.75 against abap2UI5 main: 0 issues.E8: Android bridge only for frames of the endpoint's origin (maintainer decision from round 5).
addJavascriptInterfacehands__a2u5Androidto every frame; the shell could only check the main frame's URL, so a third-party frame inside an app page (an embedded site) reached scan, push token and biometric confirm.WebViewCompat.addWebMessageListener(new dependencyandroidx.webkit:webkit:1.12.1, fromgoogle(), no account needed; minSdk 26 / targetSdk 35 unchanged). The allowed-origin rule is the configured endpoint's origin (BridgeOrigin.allowedOriginRule, default port dropped as the rule syntax wants), so the WebView injects__a2u5AndroidChannelinto frames of that origin only. The listener additionally answers the main frame only (like iOS) and re-checks the origin against the endpoint configured now; anything else rejects withforbidden.WebViewFeature.WEB_MESSAGE_LISTENER. Without it the shell keeps the old@JavascriptInterfacetransport with the main-frame check and logs that it does. The WebView floor (MINIMUM_MAJOR100) is far above the feature's minimum, so a managed fleet pinned to the floor (E4a) never runs the fallback.bridge/native-bridge.js+ both byte-identical copies): a third transport path. Calls go out as a JSON string{id, method, text?, reason?}, answers come back through the calling frame's reply proxy as{id, result, error}. The contract (window.abap2ui5Native, v1) is unchanged; the channel wins should a page see both Android objects. The shim settles via a closure now instead of looking__a2u5BridgeResolveup onwindowagain.android-channeltransport too, plus channel-specific ones (answers viaonmessage,forbidden, foreign messages ignored, throwing channel rejects, channel preferred) - 38/38 locally. New JVM tests:BridgeMessageTest(wire format) and the origin-rule case inBridgeOriginTest(run on CI; no Android SDK in this sandbox).Not tested on a device - CI proves the APK builds and the contract holds; TESTING.md §1 has the frame check for the next device run.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Te3BRpRpxNhZAYnrQL6Gdt
Generated by Claude Code