mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
[skip ci] fix
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -540,7 +540,7 @@ class BookInfoActivity :
|
||||
onClick?.invoke(it)
|
||||
}
|
||||
} else {
|
||||
showDecompressFileImportAlert(files)
|
||||
showDecompressFileImportAlert(files, onClick)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user