mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
8279a4cf3d
commit
7df93982ee
4
app/proguard-rules.pro
vendored
4
app/proguard-rules.pro
vendored
@ -360,6 +360,7 @@
|
|||||||
# Proguard config for apps that depend on cronet_impl_native_java.jar.
|
# Proguard config for apps that depend on cronet_impl_native_java.jar.
|
||||||
|
|
||||||
# This constructor is called using the reflection from Cronet API (cronet_api.jar).
|
# This constructor is called using the reflection from Cronet API (cronet_api.jar).
|
||||||
|
-keep class org.chromium.** { *; }
|
||||||
-keep class * extends org.chromium.net.CronetProvider{
|
-keep class * extends org.chromium.net.CronetProvider{
|
||||||
public <init>(android.content.Context);
|
public <init>(android.content.Context);
|
||||||
}
|
}
|
||||||
@ -385,9 +386,6 @@
|
|||||||
# https://android.googlesource.com/platform/sdk/+/marshmallow-mr1-release/files/proguard-android.txt#54
|
# https://android.googlesource.com/platform/sdk/+/marshmallow-mr1-release/files/proguard-android.txt#54
|
||||||
-dontwarn android.support.**
|
-dontwarn android.support.**
|
||||||
|
|
||||||
# This class should be explicitly kept to avoid failure if
|
|
||||||
# class/merging/horizontal proguard optimization is enabled.
|
|
||||||
-keep class org.chromium.base.CollectionUtil
|
|
||||||
#-------------------Cronet------------------------------------
|
#-------------------Cronet------------------------------------
|
||||||
|
|
||||||
# Class.forName调用
|
# Class.forName调用
|
||||||
|
@ -9,6 +9,7 @@ import io.legado.app.help.LifecycleHelp
|
|||||||
import io.legado.app.help.coroutine.Coroutine
|
import io.legado.app.help.coroutine.Coroutine
|
||||||
import io.legado.app.lib.permission.Permissions
|
import io.legado.app.lib.permission.Permissions
|
||||||
import io.legado.app.lib.permission.PermissionsCompat
|
import io.legado.app.lib.permission.PermissionsCompat
|
||||||
|
import io.legado.app.utils.printOnDebug
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import kotlin.coroutines.CoroutineContext
|
import kotlin.coroutines.CoroutineContext
|
||||||
|
|
||||||
@ -62,7 +63,11 @@ abstract class BaseService : LifecycleService(), CoroutineScope by MainScope() {
|
|||||||
.addPermissions(Permissions.POST_NOTIFICATIONS)
|
.addPermissions(Permissions.POST_NOTIFICATIONS)
|
||||||
.rationale(R.string.notification_permission_rationale)
|
.rationale(R.string.notification_permission_rationale)
|
||||||
.onGranted {
|
.onGranted {
|
||||||
|
kotlin.runCatching {
|
||||||
upNotification()
|
upNotification()
|
||||||
|
}.onFailure {
|
||||||
|
it.printOnDebug()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.request()
|
.request()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user