From 20e15defc2b90aa5e79bad41c097bd0db8d5e12a Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Tue, 28 Jun 2022 00:11:51 +0200 Subject: [PATCH] fix: wrong separator when using `ZipFileSystemUtils` --- src/main/kotlin/app/revanced/cli/patcher/Patcher.kt | 2 +- .../kotlin/app/revanced/utils/filesystem/ZipFileSystemUtils.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/cli/patcher/Patcher.kt b/src/main/kotlin/app/revanced/cli/patcher/Patcher.kt index de156add..32501661 100644 --- a/src/main/kotlin/app/revanced/cli/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/cli/patcher/Patcher.kt @@ -36,7 +36,7 @@ internal object Patcher { logger.info("Writing resources...") ZipFileSystemUtils(result.resourceFile!!).use { resourceFileSystem -> - val resourceFiles = resourceFileSystem.getFile(File.pathSeparator) + val resourceFiles = resourceFileSystem.getFile(File.separator) outputFileSystem.writePathRecursively(resourceFiles) } } diff --git a/src/main/kotlin/app/revanced/utils/filesystem/ZipFileSystemUtils.kt b/src/main/kotlin/app/revanced/utils/filesystem/ZipFileSystemUtils.kt index 5f123055..cfe0c305 100644 --- a/src/main/kotlin/app/revanced/utils/filesystem/ZipFileSystemUtils.kt +++ b/src/main/kotlin/app/revanced/utils/filesystem/ZipFileSystemUtils.kt @@ -56,6 +56,7 @@ internal class ZipFileSystemUtils( private fun Path.getRelativePath(path: Path): Path = zipFileSystem.getPath(path.relativize(this).toString()) + // TODO: figure out why the file system is uncompressed by default and how to fix it internal fun uncompress(vararg paths: String) = paths.forEach { Files.setAttribute(zipFileSystem.getPath(it), "zip:method", ZipEntry.STORED) }