Fix webview crash caused by 6bfb80fe (mihonapp/mihon#1819)
(cherry picked from commit 9957fff2fbb6dad6f9df89bb2c16db34d9e4da96)
This commit is contained in:
parent
f0fcdbe816
commit
4892e858f9
1 changed files with 3 additions and 3 deletions
|
|
@ -286,9 +286,9 @@ class App : Application(), DefaultLifecycleObserver, SingletonImageLoader.Factor
|
|||
try {
|
||||
// Override the value passed as X-Requested-With in WebView requests
|
||||
val stackTrace = Looper.getMainLooper().thread.stackTrace
|
||||
val isChromiumCall = stackTrace.any {
|
||||
it.className.startsWith("org.chromium.") &&
|
||||
it.methodName in setOf("getAll", "getPackageName", "<init>")
|
||||
val isChromiumCall = stackTrace.any { trace ->
|
||||
trace.className.equals("org.chromium.base.BuildInfo", ignoreCase = true) &&
|
||||
setOf("getAll", "getPackageName", "<init>").any { trace.methodName.equals(it, ignoreCase = true) }
|
||||
}
|
||||
|
||||
if (isChromiumCall) return WebViewUtil.spoofedPackageName(applicationContext)
|
||||
|
|
|
|||
Loading…
Reference in a new issue