mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
542a116afd
commit
08634398e3
@ -6,8 +6,10 @@ import kotlinx.coroutines.CoroutineScope
|
|||||||
object AppUpdate {
|
object AppUpdate {
|
||||||
|
|
||||||
val gitHubUpdate by lazy {
|
val gitHubUpdate by lazy {
|
||||||
Class.forName("io.legado.app.help.AppUpdateGitHub").kotlin.objectInstance
|
kotlin.runCatching {
|
||||||
as? AppUpdateInterface
|
Class.forName("io.legado.app.help.AppUpdateGitHub")
|
||||||
|
.kotlin.objectInstance as AppUpdateInterface
|
||||||
|
}.getOrNull()
|
||||||
}
|
}
|
||||||
|
|
||||||
data class UpdateInfo(
|
data class UpdateInfo(
|
||||||
|
@ -5,9 +5,10 @@ import okhttp3.Interceptor
|
|||||||
object Cronet {
|
object Cronet {
|
||||||
|
|
||||||
val loader: CronetLoaderInterface? by lazy {
|
val loader: CronetLoaderInterface? by lazy {
|
||||||
val cl = Class.forName("io.legado.app.lib.cronet.CronetLoader")
|
kotlin.runCatching {
|
||||||
?.kotlin?.objectInstance
|
Class.forName("io.legado.app.lib.cronet.CronetLoader")
|
||||||
cl as? CronetLoaderInterface
|
.kotlin.objectInstance as CronetLoaderInterface
|
||||||
|
}.getOrNull()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun preDownload() {
|
fun preDownload() {
|
||||||
@ -15,8 +16,10 @@ object Cronet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val interceptor: Interceptor? by lazy {
|
val interceptor: Interceptor? by lazy {
|
||||||
val cl = Class.forName("io.legado.app.lib.cronet.CronetInterceptor")?.newInstance()
|
kotlin.runCatching {
|
||||||
cl as? Interceptor
|
Class.forName("io.legado.app.lib.cronet.CronetInterceptor")
|
||||||
|
.newInstance() as Interceptor
|
||||||
|
}.getOrNull()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user