From a14919d6d92ecee1acb959df92d1e45d4582ee59 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 28 May 2020 12:06:47 +0200 Subject: [PATCH] create a new folder at decompressing --- .../filemanager/pro/activities/DecompressActivity.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt index f95794a1..c3d4d1d8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt @@ -99,9 +99,10 @@ class DecompressActivity : SimpleActivity() { zipInputStream.use { while (true) { val entry = zipInputStream.nextEntry ?: break - val newPath = "$destination/${entry.name}" - val fos = getFileOutputStreamSync(newPath, newPath.getMimeType()) + val filename = title.toString().substringBeforeLast(".") + val newPath = "$destination/$filename/${entry.name.trimEnd('/')}" + val fos = getFileOutputStreamSync(newPath, newPath.getMimeType()) var count: Int while (true) { count = zipInputStream.read(buffer)