mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-06-19 01:14:40 +08:00
fix: save as on android
This commit is contained in:
@@ -77,6 +77,7 @@ object MethodChannelUtils {
|
||||
args: List<Any?>?,
|
||||
instance: Any?
|
||||
): Any? {
|
||||
Log.i("MethodChannel", "invoke method: ${method}")
|
||||
method.isAccessible = true
|
||||
return if (method.isStaticMethod()) { // 静态方法调用
|
||||
if (args == null) {
|
||||
|
||||
@@ -18,7 +18,7 @@ class SAFPlugin(private val activity: MainActivity) {
|
||||
private var onSAFAuthFailed: (() -> Unit)? = null
|
||||
|
||||
companion object {
|
||||
const val safAuthorizationCode = 0x10086
|
||||
const val safAuthorizationCode = 0xabcd
|
||||
}
|
||||
|
||||
init {
|
||||
@@ -66,6 +66,17 @@ class SAFPlugin(private val activity: MainActivity) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开文件
|
||||
* @param channelResult Result
|
||||
* @param filenameWithoutExtension String
|
||||
* @param dir String
|
||||
* @param mimeType String
|
||||
* @param readFlag Boolean ignored
|
||||
* @param writeFlag Boolean ignored
|
||||
* @param appendFlag Boolean ignored
|
||||
* @param saveAsFlag Boolean ignored
|
||||
*/
|
||||
@ChannelMethod(responseManually = true)
|
||||
@Suppress("unused")
|
||||
private fun openFile(
|
||||
@@ -73,6 +84,10 @@ class SAFPlugin(private val activity: MainActivity) {
|
||||
filenameWithoutExtension: String,
|
||||
dir: String,
|
||||
mimeType: String,
|
||||
@Suppress("UNUSED_PARAMETER") readFlag: Boolean,
|
||||
@Suppress("UNUSED_PARAMETER") writeFlag: Boolean,
|
||||
@Suppress("UNUSED_PARAMETER") appendFlag: Boolean,
|
||||
@Suppress("UNUSED_PARAMETER") saveAsFlag: Boolean,
|
||||
) {
|
||||
if (!checkSafPermission()) {
|
||||
onSAFAuthSuccess = {
|
||||
|
||||
Reference in New Issue
Block a user