mirror of
https://github.com/gedoor/legado.git
synced 2025-01-09 04:17:45 +08:00
优化
This commit is contained in:
parent
636c369351
commit
c2b0c200fb
@ -36,7 +36,9 @@ import io.legado.app.utils.ChineseUtils
|
||||
import io.legado.app.utils.LogUtils
|
||||
import io.legado.app.utils.defaultSharedPreferences
|
||||
import io.legado.app.utils.getPrefBoolean
|
||||
import io.legado.app.utils.isDebuggable
|
||||
import kotlinx.coroutines.launch
|
||||
import org.chromium.base.ThreadUtils
|
||||
import splitties.init.appCtx
|
||||
import splitties.systemservices.notificationManager
|
||||
import java.net.URL
|
||||
@ -51,6 +53,9 @@ class App : Application() {
|
||||
super.onCreate()
|
||||
LogUtils.d("App", "onCreate")
|
||||
LogUtils.logDeviceInfo()
|
||||
if (isDebuggable) {
|
||||
ThreadUtils.setThreadAssertsDisabledForTesting(true)
|
||||
}
|
||||
oldConfig = Configuration(resources.configuration)
|
||||
CrashHandler(this)
|
||||
//预下载Cronet so
|
||||
|
@ -17,6 +17,7 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.content.SharedPreferences
|
||||
import android.content.pm.ApplicationInfo
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.res.ColorStateList
|
||||
import android.content.res.Configuration
|
||||
@ -384,3 +385,6 @@ val Context.channel: String
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
val Context.isDebuggable: Boolean
|
||||
get() = applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE != 0
|
||||
|
Loading…
Reference in New Issue
Block a user