Files
orca/mobile/patches/@expo__log-box@55.0.13.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/expo/modules/logbox/ExpoLogBoxWebViewWrapper.kt b/android/src/main/expo/modules/logbox/ExpoLogBoxWebViewWrapper.kt
index 556724a6f48706fe64d7872a58a63a7a53e01f9d..5286ea546d42e2f9afa63916b2fce02b6ff2ebdf 100644
--- a/android/src/main/expo/modules/logbox/ExpoLogBoxWebViewWrapper.kt
+++ b/android/src/main/expo/modules/logbox/ExpoLogBoxWebViewWrapper.kt
@@ -3,6 +3,7 @@
package expo.modules.logbox
import android.app.Activity
+import android.content.pm.ApplicationInfo
import android.graphics.Bitmap
import android.graphics.Color
import android.webkit.JavascriptInterface
@@ -24,7 +25,9 @@ class ExpoLogBoxWebViewWrapper(
val webView: WebView = WebView(context).apply {
setBackgroundColor(Color.BLACK)
settings.javaScriptEnabled = true
- setWebContentsDebuggingEnabled(true)
+ val isDebuggable =
+ context.applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE != 0
+ setWebContentsDebuggingEnabled(isDebuggable)
// This interface is defined by the Expo DOM Components WebView Wrapper
// and must always be the same as [add link]
addJavascriptInterface(