From 01223ea0b1ce00920566dafd6f6da5dab37df7ae Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 17 Sep 2019 11:01:59 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/utils/ZipUtils.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/utils/ZipUtils.kt b/app/src/main/java/io/legado/app/utils/ZipUtils.kt index fc8aa97ed..eab9951c7 100644 --- a/app/src/main/java/io/legado/app/utils/ZipUtils.kt +++ b/app/src/main/java/io/legado/app/utils/ZipUtils.kt @@ -164,24 +164,24 @@ object ZipUtils { zos: ZipOutputStream, comment: String? ): Boolean { - var rootPath = rootPath + var rootPath1 = rootPath if (!srcFile.exists()) return true - rootPath = rootPath + (if (isSpace(rootPath)) "" else File.separator) + srcFile.name + rootPath1 = rootPath1 + (if (isSpace(rootPath1)) "" else File.separator) + srcFile.name if (srcFile.isDirectory) { val fileList = srcFile.listFiles() if (fileList == null || fileList.isEmpty()) { - val entry = ZipEntry("$rootPath/") + val entry = ZipEntry("$rootPath1/") entry.comment = comment zos.putNextEntry(entry) zos.closeEntry() } else { for (file in fileList) { - if (!zipFile(file, rootPath, zos, comment)) return false + if (!zipFile(file, rootPath1, zos, comment)) return false } } } else { BufferedInputStream(FileInputStream(srcFile)).use { `is` -> - val entry = ZipEntry(rootPath) + val entry = ZipEntry(rootPath1) entry.comment = comment zos.putNextEntry(entry) zos.write(`is`.readBytes())