Skip to content

Commit e161042

Browse files
committed
extract zip to correct path
1 parent 253db88 commit e161042

File tree

1 file changed

+3
-1
lines changed
  • app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters

1 file changed

+3
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,12 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
426426
try {
427427
val zipFile = ZipFile(it)
428428
val entries = zipFile.entries()
429+
val zipFileName = it.getFilenameFromPath()
430+
val newFolderName = zipFileName.subSequence(0, zipFileName.length-4)
429431
while (entries.hasMoreElements()) {
430432
val entry = entries.nextElement()
431433
val parentPath = it.getParentPath()
432-
val newPath = "$parentPath${entry.name.trimEnd('/')}"
434+
val newPath = "$parentPath/$newFolderName/${entry.name.trimEnd('/')}"
433435

434436
val resolution = getConflictResolution(conflictResolutions, newPath)
435437
val doesPathExist = File(newPath).exists()

0 commit comments

Comments
 (0)