diff --git a/app/src/main/java/io/legado/app/help/LocalConfig.kt b/app/src/main/java/io/legado/app/help/LocalConfig.kt index 8c90f7498..012651fa1 100644 --- a/app/src/main/java/io/legado/app/help/LocalConfig.kt +++ b/app/src/main/java/io/legado/app/help/LocalConfig.kt @@ -28,13 +28,13 @@ object LocalConfig { val ruleHelpVersionIsLast: Boolean get() = isLastVersion(1, "ruleHelpVersion") - val hasUpHttpTTS: Boolean + val needUpHttpTTS: Boolean get() = !isLastVersion(3, "httpTtsVersion") - val hasUpTxtTocRule: Boolean + val needUpTxtTocRule: Boolean get() = !isLastVersion(1, "txtTocRuleVersion") - val hasUpRssSources: Boolean + val needUpRssSources: Boolean get() = !isLastVersion(4, "rssSourceVersion") var versionCode diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index 96197140c..6ea3825dd 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -21,7 +21,6 @@ import io.legado.app.constant.PreferKey import io.legado.app.databinding.ActivityMainBinding import io.legado.app.help.AppConfig import io.legado.app.help.BookHelp -import io.legado.app.help.DefaultData import io.legado.app.help.LocalConfig import io.legado.app.help.storage.Backup import io.legado.app.lib.theme.ATH @@ -124,7 +123,6 @@ class MainActivity : VMBaseActivity(), } else if (!BuildConfig.DEBUG) { val log = String(assets.open("updateLog.md").readBytes()) TextDialog.show(supportFragmentManager, log, TextDialog.MD, 5000, true) - DefaultData.importDefaultTocRules()//版本更新时更新自带本地txt目录规则 } viewModel.upVersion() } diff --git a/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt b/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt index 692eb90f0..272b1ffc1 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt @@ -154,13 +154,13 @@ class MainViewModel(application: Application) : BaseViewModel(application) { fun upVersion() { execute { - if (LocalConfig.hasUpHttpTTS) { + if (LocalConfig.needUpHttpTTS) { DefaultData.importDefaultHttpTTS() } - if (LocalConfig.hasUpTxtTocRule) { + if (LocalConfig.needUpTxtTocRule) { DefaultData.importDefaultTocRules() } - if (LocalConfig.hasUpRssSources) { + if (LocalConfig.needUpRssSources) { DefaultData.importDefaultRssSources() } } diff --git a/epublib/build.gradle b/epublib/build.gradle index cdded11c1..27330e83e 100644 --- a/epublib/build.gradle +++ b/epublib/build.gradle @@ -9,8 +9,6 @@ android { defaultConfig { minSdkVersion 21 targetSdkVersion 30 - versionCode 1 - versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro"