Files
orca/mobile/patches/@expo__dom-webview@55.0.6.patch
T
Jinwoo-H 41a79c5a78 fix(mobile): wire the Android WebView debugging patches so they apply
Under pnpm 12 the patch authority for the mobile workspace is
pnpm-workspace.yaml, not package.json, so the patchedDependencies block
added to mobile/package.json was inert: the three new patches never
applied and the lock carried no hash for them. The versions they named
were stale too, since pnpm resolves @expo/dom-webview to 55.0.6,
@expo/log-box to 55.0.13, and react-native-webview to 13.16.2.

Drop the dead pnpm block, declare the patches in pnpm-workspace.yaml
against the installed versions, and re-resolve each patch against the
real sources. The react-native-webview Android hunks fold into the
existing 13.16.2 patch, since pnpm allows one patch per package version.
Every hunk keeps its original intent: setWebContentsDebuggingEnabled is
gated on ApplicationInfo.FLAG_DEBUGGABLE.

The CDP session test read these patches by version-stamped filename,
which would break again on the next bump. Resolve them through
pnpm-workspace.yaml instead, so the test also fails when a patch is
declared nowhere.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
2026-09-01 16:38:21 -04:00

24 lines
1.1 KiB
Diff

diff --git a/android/src/main/java/expo/modules/webview/DomWebView.kt b/android/src/main/java/expo/modules/webview/DomWebView.kt
index 6e504788e2b585f7fb26fe73ae5c88e25e634b8a..4e14d518d22f84dbf7202b5f2e85a169543236df 100644
--- a/android/src/main/java/expo/modules/webview/DomWebView.kt
+++ b/android/src/main/java/expo/modules/webview/DomWebView.kt
@@ -5,6 +5,7 @@ package expo.modules.webview
import android.animation.ObjectAnimator
import android.annotation.SuppressLint
import android.content.Context
+import android.content.pm.ApplicationInfo
import android.graphics.Bitmap
import android.graphics.Color
import android.view.MotionEvent
@@ -47,7 +48,9 @@ internal class DomWebView(context: Context, appContext: AppContext) : ExpoView(c
// region Public methods
fun reload() {
- WebView.setWebContentsDebuggingEnabled(webviewDebuggingEnabled)
+ val isDebuggable =
+ context.applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE != 0
+ WebView.setWebContentsDebuggingEnabled(webviewDebuggingEnabled && isDebuggable)
source?.uri?.let {
if (it != webView.url) {