mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 13:31:51 +01:00
Minor cleanup
This commit is contained in:
parent
5da2c82f47
commit
f16fb4e1e4
@ -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) {
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user