pull/68/head^2
kunfei 5 years ago
parent 70a3f8fc1f
commit a6e3489e25
  1. 3
      app/src/main/java/io/legado/app/help/storage/Backup.kt

@ -107,7 +107,8 @@ object Backup {
private fun copyBackup(context: Context, uri: Uri) { private fun copyBackup(context: Context, uri: Uri) {
DocumentFile.fromTreeUri(context, uri)?.let { treeDoc -> DocumentFile.fromTreeUri(context, uri)?.let { treeDoc ->
for (fileName in backupFileNames) { for (fileName in backupFileNames) {
treeDoc.createFile("text/plain", fileName)?.let { doc -> val doc = treeDoc.findFile(fileName) ?: treeDoc.createFile("text/plain", fileName)
doc?.let {
DocumentUtils.writeText( DocumentUtils.writeText(
context, context,
FileHelp.getFile(backupPath + File.separator + fileName).readText(), FileHelp.getFile(backupPath + File.separator + fileName).readText(),

Loading…
Cancel
Save