Fix webview crash caused by 793d7fb (#1819)

This commit is contained in:
AwkwardPeak7 2025-03-04 12:06:21 +05:00 committed by GitHub
parent debca74e0d
commit 9957fff2fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -219,9 +219,9 @@ class App : Application(), DefaultLifecycleObserver, SingletonImageLoader.Factor
try { try {
// Override the value passed as X-Requested-With in WebView requests // Override the value passed as X-Requested-With in WebView requests
val stackTrace = Looper.getMainLooper().thread.stackTrace val stackTrace = Looper.getMainLooper().thread.stackTrace
val isChromiumCall = stackTrace.any { val isChromiumCall = stackTrace.any { trace ->
it.className.startsWith("org.chromium.") && trace.className.equals("org.chromium.base.BuildInfo", ignoreCase = true) &&
it.methodName in setOf("getAll", "getPackageName", "<init>") setOf("getAll", "getPackageName", "<init>").any { trace.methodName.equals(it, ignoreCase = true) }
} }
if (isChromiumCall) return WebViewUtil.spoofedPackageName(applicationContext) if (isChromiumCall) return WebViewUtil.spoofedPackageName(applicationContext)