mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-07-08 01:30:28 +08:00
fix: save as on android
This commit is contained in:
@@ -77,6 +77,7 @@ object MethodChannelUtils {
|
|||||||
args: List<Any?>?,
|
args: List<Any?>?,
|
||||||
instance: Any?
|
instance: Any?
|
||||||
): Any? {
|
): Any? {
|
||||||
|
Log.i("MethodChannel", "invoke method: ${method}")
|
||||||
method.isAccessible = true
|
method.isAccessible = true
|
||||||
return if (method.isStaticMethod()) { // 静态方法调用
|
return if (method.isStaticMethod()) { // 静态方法调用
|
||||||
if (args == null) {
|
if (args == null) {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class SAFPlugin(private val activity: MainActivity) {
|
|||||||
private var onSAFAuthFailed: (() -> Unit)? = null
|
private var onSAFAuthFailed: (() -> Unit)? = null
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val safAuthorizationCode = 0x10086
|
const val safAuthorizationCode = 0xabcd
|
||||||
}
|
}
|
||||||
|
|
||||||
init {
|
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)
|
@ChannelMethod(responseManually = true)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
private fun openFile(
|
private fun openFile(
|
||||||
@@ -73,6 +84,10 @@ class SAFPlugin(private val activity: MainActivity) {
|
|||||||
filenameWithoutExtension: String,
|
filenameWithoutExtension: String,
|
||||||
dir: String,
|
dir: String,
|
||||||
mimeType: 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()) {
|
if (!checkSafPermission()) {
|
||||||
onSAFAuthSuccess = {
|
onSAFAuthSuccess = {
|
||||||
|
|||||||
Reference in New Issue
Block a user