优化
This commit is contained in:
@@ -158,7 +158,7 @@ object Restore {
|
|||||||
}
|
}
|
||||||
File(path, "servers.json").takeIf {
|
File(path, "servers.json").takeIf {
|
||||||
it.exists()
|
it.exists()
|
||||||
}?.run {
|
}?.runCatching {
|
||||||
var json = readText()
|
var json = readText()
|
||||||
if (!json.isJsonArray()) {
|
if (!json.isJsonArray()) {
|
||||||
json = aes.decryptStr(json)
|
json = aes.decryptStr(json)
|
||||||
@@ -166,6 +166,8 @@ object Restore {
|
|||||||
GSON.fromJsonArray<Server>(json).getOrNull()?.let {
|
GSON.fromJsonArray<Server>(json).getOrNull()?.let {
|
||||||
appDb.serverDao.insert(*it.toTypedArray())
|
appDb.serverDao.insert(*it.toTypedArray())
|
||||||
}
|
}
|
||||||
|
}?.onFailure {
|
||||||
|
AppLog.put("恢复服务器配置出错\n${it.localizedMessage}", it)
|
||||||
}
|
}
|
||||||
File(path, DirectLinkUpload.ruleFileName).takeIf {
|
File(path, DirectLinkUpload.ruleFileName).takeIf {
|
||||||
it.exists()
|
it.exists()
|
||||||
@@ -173,7 +175,7 @@ object Restore {
|
|||||||
val json = readText()
|
val json = readText()
|
||||||
ACache.get(cacheDir = false).put(DirectLinkUpload.ruleFileName, json)
|
ACache.get(cacheDir = false).put(DirectLinkUpload.ruleFileName, json)
|
||||||
}?.onFailure {
|
}?.onFailure {
|
||||||
AppLog.put("直链上传恢复出错\n${it.localizedMessage}", it)
|
AppLog.put("恢复直链上传出错\n${it.localizedMessage}", it)
|
||||||
}
|
}
|
||||||
//恢复主题配置
|
//恢复主题配置
|
||||||
File(path, ThemeConfig.configFileName).takeIf {
|
File(path, ThemeConfig.configFileName).takeIf {
|
||||||
|
|||||||
Reference in New Issue
Block a user