Minor cleanup

(cherry picked from commit 056dbaefda791b53240265c8e9562a01f17118c4)
This commit is contained in:
arkon 2023-11-04 23:21:24 -04:00 committed by Jobobby04
parent bd165456ae
commit ad1afdc529
2 changed files with 5 additions and 4 deletions

View File

@ -12,6 +12,7 @@ import android.os.Build
import android.os.Environment import android.os.Environment
import android.os.Looper import android.os.Looper
import android.webkit.WebView import android.webkit.WebView
import androidx.core.content.ContextCompat
import androidx.core.content.getSystemService import androidx.core.content.getSystemService
import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.LifecycleOwner
@ -211,7 +212,7 @@ class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory {
if (chromiumElement?.methodName.equals("getAll", ignoreCase = true)) { if (chromiumElement?.methodName.equals("getAll", ignoreCase = true)) {
return WebViewUtil.SPOOF_PACKAGE_NAME return WebViewUtil.SPOOF_PACKAGE_NAME
} }
} catch (e: Exception) { } catch (_: Exception) {
} }
} }
return super.getPackageName() return super.getPackageName()
@ -303,7 +304,7 @@ class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory {
fun register() { fun register() {
if (!registered) { if (!registered) {
registerReceiver(this, IntentFilter(ACTION_DISABLE_INCOGNITO_MODE)) ContextCompat.registerReceiver(this@App, this, IntentFilter(ACTION_DISABLE_INCOGNITO_MODE), ContextCompat.RECEIVER_NOT_EXPORTED)
registered = true registered = true
} }
} }
@ -322,7 +323,7 @@ private const val ACTION_DISABLE_INCOGNITO_MODE = "tachi.action.DISABLE_INCOGNIT
/** /**
* Direct copy of Coil's internal SingletonDiskCache so that [MangaCoverFetcher] can access it. * Direct copy of Coil's internal SingletonDiskCache so that [MangaCoverFetcher] can access it.
*/ */
internal object CoilDiskCache { private object CoilDiskCache {
private const val FOLDER_NAME = "image_cache" private const val FOLDER_NAME = "image_cache"
private var instance: DiskCache? = null private var instance: DiskCache? = null

View File

@ -15,10 +15,10 @@ class AppUpdateChecker {
private val getApplicationRelease: GetApplicationRelease by injectLazy() private val getApplicationRelease: GetApplicationRelease by injectLazy()
suspend fun checkForUpdate(context: Context, forceCheck: Boolean = false): GetApplicationRelease.Result { suspend fun checkForUpdate(context: Context, forceCheck: Boolean = false): GetApplicationRelease.Result {
// Disabling app update checks for older Android versions that we're going to drop support for
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
return GetApplicationRelease.Result.OsTooOld return GetApplicationRelease.Result.OsTooOld
} }
// Disable app update checks for older Android versions that we're going to drop support for
return withIOContext { return withIOContext {
val result = getApplicationRelease.await( val result = getApplicationRelease.await(