Conversation
There was a problem hiding this comment.
2 issues found across 18 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="lib/src/main/kotlin/dev/wvb/WebViewBundleBridge.kt">
<violation number="1" location="lib/src/main/kotlin/dev/wvb/WebViewBundleBridge.kt:105">
P1: Privileged bundle-management handlers are exposed without caller authorization. Any untrusted page loaded as main frame can trigger local bundle mutation/download/install operations.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| p.requireString("bundleName"), p.optionalString("version") | ||
| ).toJson() | ||
| } | ||
| bridge.handler("updaterInstall") { params -> |
There was a problem hiding this comment.
P1: Privileged bundle-management handlers are exposed without caller authorization. Any untrusted page loaded as main frame can trigger local bundle mutation/download/install operations.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At lib/src/main/kotlin/dev/wvb/WebViewBundleBridge.kt, line 105:
<comment>Privileged bundle-management handlers are exposed without caller authorization. Any untrusted page loaded as main frame can trigger local bundle mutation/download/install operations.</comment>
<file context>
@@ -0,0 +1,119 @@
+ p.requireString("bundleName"), p.optionalString("version")
+ ).toJson()
+ }
+ bridge.handler("updaterInstall") { params ->
+ val p = BridgeCodec.params(params)
+ requireUpdater().install(p.requireString("bundleName"), p.requireString("version"))
</file context>
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.
Summary
window.wvbAndroidso webinvoke(name, params)calls reach native handlers, with built-in source/remote/updater commands (Bridge,BridgeCodec,BridgeError,WebViewBundleBridge,Log).install()only adds bundle behavior —InstallOptionsno longer mutates the host's WebView settings; the host owns them.WebViewSetup.ktfolded intoWebViewBundle.kt.consumer-rules.proso@JavascriptInterfacebridge methods aren't stripped/renamed in minified consumer apps.🤖 Generated with Claude Code
Summary by cubic
Adds a native web-to-Android invoke bridge and makes
install()only wire bundle behavior. Web apps can callinvoke(name, params)viawindow.wvbAndroid, and hosts now own all WebView settings.New Features
window.wvbAndroidbridge forinvoke()with JSON encode/decode, background handlers, and main-thread replies; attaches viaWebMessageListenerwhen supported (logs and skips if not).source,remote, andupdaterviaWebViewBundleBridge.install()now only sets the client and optional bridge; returns a closeable handle. NewInstallOptions:delegate,disableBridge, andbridge { ... }.@JavascriptInterfacemethods.WebViewBundle.getInstance(...)(andwvb(...)/webViewBundle(...)) provides a process-wide singleton.Migration
WebViewsettings and debugging (removed:applyRecommendedSettings,webContentsDebuggingEnabled,installServiceWorker, andconfigureWebView). If you need Service Worker interception, set it up withServiceWorkerControllerCompat.install(webView) { delegate = ...; bridge { /* handlers */ } }or setdisableBridge = trueif not using the native bridge.WebViewBundle.getInstance(context, config)to reuse the shared instance; callclose()only when you need to drop it.Written for commit 9f78ea8. Summary will update on new commits.