From f16fb4e1e4e7ce0ed2eb3d8b89ca3aa61d751383 Mon Sep 17 00:00:00 2001 From: arkon Date: Thu, 14 Apr 2022 18:15:47 -0400 Subject: [PATCH] Minor cleanup --- app/src/main/java/eu/kanade/tachiyomi/App.kt | 13 +++++-------- .../kanade/tachiyomi/extension/ExtensionManager.kt | 5 ----- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/App.kt b/app/src/main/java/eu/kanade/tachiyomi/App.kt index ea0e76bfe..805caba70 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/App.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/App.kt @@ -8,6 +8,7 @@ import android.content.Context import android.content.Intent import android.content.IntentFilter import android.os.Build +import android.os.Looper import android.webkit.WebView import androidx.appcompat.app.AppCompatDelegate import androidx.core.app.NotificationManagerCompat @@ -152,14 +153,10 @@ open class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory { override fun getPackageName(): String { try { // Override the value passed as X-Requested-With in WebView requests - val stackTrace = Thread.currentThread().stackTrace - for (element in stackTrace) { - if ("org.chromium.base.BuildInfo".equals(element.className, ignoreCase = true)) { - if ("getAll".equals(element.methodName, ignoreCase = true)) { - return WebViewUtil.SPOOF_PACKAGE_NAME - } - break - } + val stackTrace = Looper.getMainLooper().thread.stackTrace + val chromiumElement = stackTrace.find { it.className.equals("org.chromium.base.BuildInfo", ignoreCase = true) } + if (chromiumElement?.methodName.equals("getAll", ignoreCase = true)) { + return WebViewUtil.SPOOF_PACKAGE_NAME } } catch (e: Exception) { } diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt index ec7633104..61444da11 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt @@ -244,11 +244,6 @@ class ExtensionManager( installer.updateInstallStep(downloadId, InstallStep.Installing) } - fun setInstallationResult(downloadId: Long, result: Boolean) { - val step = if (result) InstallStep.Installed else InstallStep.Error - installer.updateInstallStep(downloadId, step) - } - fun updateInstallStep(downloadId: Long, step: InstallStep) { installer.updateInstallStep(downloadId, step) }