pull/1185/head
gedoor 3 years ago
parent afdcb6a44f
commit 6012368066
  1. 6
      app/src/main/java/io/legado/app/help/LocalConfig.kt
  2. 2
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt
  3. 6
      app/src/main/java/io/legado/app/ui/main/MainViewModel.kt
  4. 2
      epublib/build.gradle

@ -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

@ -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<ActivityMainBinding, MainViewModel>(),
} 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()
}

@ -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()
}
}

@ -9,8 +9,6 @@ android {
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"

Loading…
Cancel
Save