Files
orca/mobile/patches/@expo__log-box@55.0.12.patch
T

23 lines
1.0 KiB
Diff

diff --git a/android/src/main/expo/modules/logbox/ExpoLogBoxWebViewWrapper.kt b/android/src/main/expo/modules/logbox/ExpoLogBoxWebViewWrapper.kt
--- a/android/src/main/expo/modules/logbox/ExpoLogBoxWebViewWrapper.kt
+++ b/android/src/main/expo/modules/logbox/ExpoLogBoxWebViewWrapper.kt
@@ -4,6 +4,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(