pull/78/head
kunfei 5 years ago
parent 57aafe2965
commit 0ca0ffb79c
  1. 4
      app/build.gradle
  2. 13
      app/src/main/java/io/legado/app/help/storage/WebDavHelp.kt

@ -96,7 +96,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
//fireBase
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-core:17.2.2'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
//androidX
@ -107,7 +107,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
implementation 'com.google.android.material:material:1.2.0-alpha03'
implementation 'com.google.android.material:material:1.2.0-alpha04'
implementation 'com.google.android:flexbox:1.1.0'
//lifecycle

@ -3,7 +3,6 @@ package io.legado.app.help.storage
import android.content.Context
import io.legado.app.App
import io.legado.app.help.FileHelp
import io.legado.app.help.ReadBookConfig
import io.legado.app.help.coroutine.Coroutine
import io.legado.app.lib.webdav.WebDav
import io.legado.app.lib.webdav.http.HttpAuth
@ -83,14 +82,10 @@ object WebDavHelp {
fun backUpWebDav(path: String) {
if (initWebDav()) {
val paths = arrayListOf(
path + File.separator + "bookshelf.json",
path + File.separator + "bookSource.json",
path + File.separator + "rssSource.json",
path + File.separator + "replaceRule.json",
path + File.separator + "config.xml",
path + File.separator + ReadBookConfig.readConfigFileName
)
val paths = arrayListOf(*Backup.backupFileNames)
for (i in 0 until paths.size) {
paths[i] = path + File.separator + paths[i]
}
FileHelp.deleteFile(zipFilePath)
if (ZipUtils.zipFiles(paths, zipFilePath)) {
WebDav(getWebDavUrl() + "legado").makeAsDir()

Loading…
Cancel
Save