diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt index 8b642fb3..17e39c48 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt @@ -263,12 +263,20 @@ class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList Unit) { + if (activity.needsStupidWritePermissions(file.absolutePath)) { + activity.handleSAFDialog(file) { + val documentFile = activity.getFileDocument(file.absolutePath) + if (documentFile == null) { + callback(false) + return@handleSAFDialog + } + val newDir = documentFile.createDirectory(file.name) + callback(newDir != null) + } + } else { + callback(file.mkdirs()) + } + } + fun zipPaths(sourcePaths: List, targetPath: String): Boolean { val queue = LinkedList() - val out = getFileOutputStream(targetPath) + val out = getFileOutputStream(targetPath, "application/zip") val zout = ZipOutputStream(out) var res: Closeable = out @@ -330,7 +354,7 @@ class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList