From cd4eda3b3bbe75ceeb724a1a4c78003960a5411b Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 9 Feb 2020 11:21:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/help/storage/Restore.kt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/help/storage/Restore.kt b/app/src/main/java/io/legado/app/help/storage/Restore.kt index b7fa2a68a..ed944012a 100644 --- a/app/src/main/java/io/legado/app/help/storage/Restore.kt +++ b/app/src/main/java/io/legado/app/help/storage/Restore.kt @@ -40,7 +40,21 @@ object Restore { } } } else { - + try { + val file = File(path) + for (fileName in Backup.backupFileNames) { + FileUtils.getFile(file, fileName).let { + if (it.exists()) { + it.copyTo( + FileUtils.createFileIfNotExist(Backup.backupPath + File.separator + fileName), + true + ) + } + } + } + } catch (e: Exception) { + e.printStackTrace() + } } } restore(Backup.backupPath)