[skip ci] fix

This commit is contained in:
Xwite
2023-03-14 13:30:21 +08:00
parent d3010211fb
commit 0227b9454e
3 changed files with 6 additions and 4 deletions

View File

@@ -523,8 +523,9 @@ interface JsExtensions : JsEncodeUtils {
fun unArchiveFile(zipPath: String): String {
if (zipPath.isEmpty()) return ""
val zipFile = getFile(zipPath)
return ArchiveUtils.deCompress(zipFile.absolutePath).toString()
.substring(FileUtils.getCachePath().length)
return ArchiveUtils.deCompress(zipFile.absolutePath).let {
ArchiveUtils.TEMP_FOLDER_NAME + File.separator + MD5Utils.md5Encode16(zipFile.name)
}
}
/**

View File

@@ -540,7 +540,7 @@ class BookInfoActivity :
onClick?.invoke(it)
}
} else {
showDecompressFileImportAlert(files)
showDecompressFileImportAlert(files, onClick)
}
}
}

View File

@@ -12,9 +12,10 @@ import java.io.File
@Suppress("unused", "MemberVisibilityCanBePrivate")
object ArchiveUtils {
const val TEMP_FOLDER_NAME = "ArchiveTemp"
// 临时目录 下次启动自动删除
val TEMP_PATH: String by lazy {
appCtx.externalCache.getFile("ArchiveTemp").createFolderReplace().absolutePath
appCtx.externalCache.getFile(TEMP_FOLDER_NAME).createFolderReplace().absolutePath
}
fun deCompress(