mirror of
https://github.com/gedoor/legado.git
synced 2024-07-17 00:58:29 +08:00
优化
This commit is contained in:
parent
54171e5a4c
commit
96ef9571e1
@ -1,17 +0,0 @@
|
||||
package io.legado.app.help
|
||||
|
||||
import androidx.annotation.Keep
|
||||
import io.legado.app.utils.IntentType
|
||||
|
||||
@Keep
|
||||
@Suppress("unused")
|
||||
object AppIntentType : IntentType.TypeInterface {
|
||||
|
||||
override fun from(path: String?): String? {
|
||||
return when (path?.substringAfterLast(".")?.lowercase()) {
|
||||
"apk" -> "application/vnd.android.package-archive"
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -4,7 +4,6 @@ import android.os.Build
|
||||
import androidx.annotation.Keep
|
||||
import io.legado.app.utils.printOnDebug
|
||||
import okhttp3.*
|
||||
import okhttp3.internal.http.receiveHeaders
|
||||
import java.io.IOException
|
||||
|
||||
@Keep
|
@ -25,6 +25,7 @@ object IntentType {
|
||||
"3gp", "mp4" -> "audio/*"
|
||||
"jpg", "gif", "png", "jpeg", "bmp" -> "image/*"
|
||||
"", "txt", "json", "log" -> "text/plain"
|
||||
"apk" -> "application/vnd.android.package-archive"
|
||||
else -> appIntentType?.from(path) ?: "*/*"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user