Minor cleanup

(cherry picked from commit f16fb4e1e4e7ce0ed2eb3d8b89ca3aa61d751383)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/App.kt
This commit is contained in:
arkon 2022-04-14 18:15:47 -04:00 committed by Jobobby04
parent 7cf5208000
commit af25e0e770
2 changed files with 5 additions and 13 deletions

View File

@ -10,6 +10,7 @@ import android.content.IntentFilter
import android.graphics.Color
import android.os.Build
import android.os.Environment
import android.os.Looper
import android.webkit.WebView
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.app.NotificationManagerCompat
@ -187,14 +188,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) {
}

View File

@ -291,11 +291,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)
}