|
|
@ -7,7 +7,6 @@ import io.legado.app.R |
|
|
|
import io.legado.app.constant.AppLog |
|
|
|
import io.legado.app.constant.AppLog |
|
|
|
import io.legado.app.constant.PreferKey |
|
|
|
import io.legado.app.constant.PreferKey |
|
|
|
import io.legado.app.data.appDb |
|
|
|
import io.legado.app.data.appDb |
|
|
|
import io.legado.app.help.DefaultData |
|
|
|
|
|
|
|
import io.legado.app.help.config.ReadBookConfig |
|
|
|
import io.legado.app.help.config.ReadBookConfig |
|
|
|
import io.legado.app.help.config.ThemeConfig |
|
|
|
import io.legado.app.help.config.ThemeConfig |
|
|
|
import io.legado.app.help.coroutine.Coroutine |
|
|
|
import io.legado.app.help.coroutine.Coroutine |
|
|
@ -38,8 +37,9 @@ object Backup { |
|
|
|
"readRecord.json", |
|
|
|
"readRecord.json", |
|
|
|
"searchHistory.json", |
|
|
|
"searchHistory.json", |
|
|
|
"sourceSub.json", |
|
|
|
"sourceSub.json", |
|
|
|
DefaultData.txtTocRuleFileName, |
|
|
|
"txtTocRule.json", |
|
|
|
DefaultData.httpTtsFileName, |
|
|
|
"httpTTS.json", |
|
|
|
|
|
|
|
"keyboardAssists.json", |
|
|
|
ReadBookConfig.configFileName, |
|
|
|
ReadBookConfig.configFileName, |
|
|
|
ReadBookConfig.shareConfigFileName, |
|
|
|
ReadBookConfig.shareConfigFileName, |
|
|
|
ThemeConfig.configFileName, |
|
|
|
ThemeConfig.configFileName, |
|
|
@ -77,8 +77,9 @@ object Backup { |
|
|
|
writeListToJson(appDb.readRecordDao.all, "readRecord.json", backupPath) |
|
|
|
writeListToJson(appDb.readRecordDao.all, "readRecord.json", backupPath) |
|
|
|
writeListToJson(appDb.searchKeywordDao.all, "searchHistory.json", backupPath) |
|
|
|
writeListToJson(appDb.searchKeywordDao.all, "searchHistory.json", backupPath) |
|
|
|
writeListToJson(appDb.ruleSubDao.all, "sourceSub.json", backupPath) |
|
|
|
writeListToJson(appDb.ruleSubDao.all, "sourceSub.json", backupPath) |
|
|
|
writeListToJson(appDb.txtTocRuleDao.all, DefaultData.txtTocRuleFileName, backupPath) |
|
|
|
writeListToJson(appDb.txtTocRuleDao.all, "txtTocRule.json", backupPath) |
|
|
|
writeListToJson(appDb.httpTTSDao.all, DefaultData.httpTtsFileName, backupPath) |
|
|
|
writeListToJson(appDb.httpTTSDao.all, "httpTTS.json", backupPath) |
|
|
|
|
|
|
|
writeListToJson(appDb.keyboardAssistsDao.all, "keyboardAssists.json", backupPath) |
|
|
|
GSON.toJson(ReadBookConfig.configList).let { |
|
|
|
GSON.toJson(ReadBookConfig.configList).let { |
|
|
|
FileUtils.createFileIfNotExist(backupPath + File.separator + ReadBookConfig.configFileName) |
|
|
|
FileUtils.createFileIfNotExist(backupPath + File.separator + ReadBookConfig.configFileName) |
|
|
|
.writeText(it) |
|
|
|
.writeText(it) |
|
|
|