优化
This commit is contained in:
@@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-1
@@ -4,7 +4,6 @@ import android.os.Build
|
|||||||
import androidx.annotation.Keep
|
import androidx.annotation.Keep
|
||||||
import io.legado.app.utils.printOnDebug
|
import io.legado.app.utils.printOnDebug
|
||||||
import okhttp3.*
|
import okhttp3.*
|
||||||
import okhttp3.internal.http.receiveHeaders
|
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
|
||||||
@Keep
|
@Keep
|
||||||
@@ -25,6 +25,7 @@ object IntentType {
|
|||||||
"3gp", "mp4" -> "audio/*"
|
"3gp", "mp4" -> "audio/*"
|
||||||
"jpg", "gif", "png", "jpeg", "bmp" -> "image/*"
|
"jpg", "gif", "png", "jpeg", "bmp" -> "image/*"
|
||||||
"", "txt", "json", "log" -> "text/plain"
|
"", "txt", "json", "log" -> "text/plain"
|
||||||
|
"apk" -> "application/vnd.android.package-archive"
|
||||||
else -> appIntentType?.from(path) ?: "*/*"
|
else -> appIntentType?.from(path) ?: "*/*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user