Fix webview crash caused by 793d7fb (#1819)
(cherry picked from commit 9957fff2fbb6dad6f9df89bb2c16db34d9e4da96) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/App.kt
This commit is contained in:
parent
a64fe8121b
commit
9ff048e683
@ -277,9 +277,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…
x
Reference in New Issue
Block a user