mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
Some checks failed
Test Build / prepare (push) Has been cancelled
Test Build / build (app, release) (push) Has been cancelled
Test Build / build (app, releaseA) (push) Has been cancelled
Test Build / prerelease (push) Has been cancelled
Test Build / lanzou (push) Has been cancelled
Test Build / test_Branch (push) Has been cancelled
Test Build / telegram (push) Has been cancelled
update fork / build (push) Has been cancelled
Some checks failed
Test Build / prepare (push) Has been cancelled
Test Build / build (app, release) (push) Has been cancelled
Test Build / build (app, releaseA) (push) Has been cancelled
Test Build / prerelease (push) Has been cancelled
Test Build / lanzou (push) Has been cancelled
Test Build / test_Branch (push) Has been cancelled
Test Build / telegram (push) Has been cancelled
update fork / build (push) Has been cancelled
This commit is contained in:
7
app/proguard-rules.pro
vendored
7
app/proguard-rules.pro
vendored
@@ -166,12 +166,7 @@ cn.hutool.core.util.**{*;}
|
||||
*** sTestTrustManager;
|
||||
}
|
||||
|
||||
# Class.forName调用
|
||||
-keep class io.legado.app.lib.cronet.CronetInterceptor{*;}
|
||||
-keep class io.legado.app.lib.cronet.CronetLoader{*;}
|
||||
-keep class io.legado.app.help.update.AppUpdateGitHub{*;}
|
||||
-keep class io.legado.app.help.AppIntentType{*;}
|
||||
# Error Exception
|
||||
# Error Exception
|
||||
-keepnames class * extends java.lang.Exception
|
||||
-keepnames class * extends java.lang.Error
|
||||
-keepnames class **Exception
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package io.legado.app.help.http
|
||||
|
||||
import io.legado.app.lib.cronet.CronetInterceptor
|
||||
import io.legado.app.lib.cronet.CronetLoader
|
||||
import okhttp3.CookieJar
|
||||
import okhttp3.Interceptor
|
||||
|
||||
object Cronet {
|
||||
@@ -15,11 +15,7 @@ object Cronet {
|
||||
}
|
||||
|
||||
val interceptor: Interceptor? by lazy {
|
||||
kotlin.runCatching {
|
||||
val iClass = Class.forName("io.legado.app.lib.cronet.CronetInterceptor")
|
||||
iClass.getDeclaredConstructor(CookieJar::class.java)
|
||||
.newInstance(cookieJar) as Interceptor
|
||||
}.getOrNull()
|
||||
CronetInterceptor(cookieJar)
|
||||
}
|
||||
|
||||
interface LoaderInterface {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package io.legado.app.utils
|
||||
|
||||
import android.net.Uri
|
||||
import androidx.annotation.Keep
|
||||
import java.io.File
|
||||
|
||||
@Keep
|
||||
object IntentType {
|
||||
|
||||
fun from(uri: Uri): String {
|
||||
@@ -26,21 +24,8 @@ object IntentType {
|
||||
"jpg", "gif", "png", "jpeg", "bmp" -> "image/*"
|
||||
"", "txt", "json", "log" -> "text/plain"
|
||||
"apk" -> "application/vnd.android.package-archive"
|
||||
else -> appIntentType?.from(path) ?: "*/*"
|
||||
else -> "*/*"
|
||||
}
|
||||
}
|
||||
|
||||
private val appIntentType: TypeInterface? by lazy {
|
||||
kotlin.runCatching {
|
||||
Class.forName("io.legado.app.help.AppIntentType")
|
||||
.kotlin.objectInstance as? TypeInterface
|
||||
}.getOrNull()
|
||||
}
|
||||
|
||||
interface TypeInterface {
|
||||
|
||||
fun from(path: String?): String?
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user