Skip to content

Commit 4324c7e

Browse files
authored
Merge pull request #317 from tufteddeer/iss_308
extract zip to correct path
2 parents e7839bc + e161042 commit 4324c7e

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
@@ -461,10 +461,12 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
461461
try {
462462
val zipFile = ZipFile(it)
463463
val entries = zipFile.entries()
464+
val zipFileName = it.getFilenameFromPath()
465+
val newFolderName = zipFileName.subSequence(0, zipFileName.length-4)
464466
while (entries.hasMoreElements()) {
465467
val entry = entries.nextElement()
466468
val parentPath = it.getParentPath()
467-
val newPath = "$parentPath${entry.name.trimEnd('/')}"
469+
val newPath = "$parentPath/$newFolderName/${entry.name.trimEnd('/')}"
468470

469471
val resolution = getConflictResolution(conflictResolutions, newPath)
470472
val doesPathExist = File(newPath).exists()

0 commit comments

Comments
 (0)