From fa9503c28dc960f3408706f8def2681201abcc62 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 24 Feb 2022 00:05:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=85=A5=E9=98=85?= =?UTF-8?q?=E8=AF=BB=E9=85=8D=E7=BD=AE=E6=B2=A1=E6=9C=89=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/ReadBookConfig.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index bfd935ef0..c0b76fe04 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -366,7 +366,7 @@ object ReadBookConfig { suspend fun import(byteArray: ByteArray): Config { return withContext(IO) { - val configZipPath = FileUtils.getPath(appCtx.externalCache, configFileName) + val configZipPath = FileUtils.getPath(appCtx.externalCache, "readConfig.zip") FileUtils.deleteFile(configZipPath) val zipFile = FileUtils.createFileIfNotExist(configZipPath) zipFile.writeBytes(byteArray) @@ -375,7 +375,7 @@ object ReadBookConfig { @Suppress("BlockingMethodInNonBlockingContext") ZipUtils.unzipFile(zipFile, FileUtils.createFolderIfNotExist(configDirPath)) val configDir = FileUtils.createFolderIfNotExist(configDirPath) - val configFile = configDir.getFile("readConfig.json") + val configFile = configDir.getFile(configFileName) val config: Config = GSON.fromJsonObject(configFile.readText())!! if (config.textFont.isNotEmpty()) { val fontName = FileUtils.getName(config.textFont) @@ -395,6 +395,7 @@ object ReadBookConfig { bgFile.copyTo(File(bgPath)) } } + config.bgStr = bgPath } if (config.bgTypeNight == 2) { val bgName = FileUtils.getName(config.bgStrNight) @@ -405,6 +406,7 @@ object ReadBookConfig { bgFile.copyTo(File(bgPath)) } } + config.bgStrNight = bgPath } if (config.bgTypeEInk == 2) { val bgName = FileUtils.getName(config.bgStrEInk) @@ -415,6 +417,7 @@ object ReadBookConfig { bgFile.copyTo(File(bgPath)) } } + config.bgStrEInk = bgPath } return@withContext config }