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 val ruleHelpVersionIsLast: Boolean
get() = isLastVersion(1, "ruleHelpVersion") get() = isLastVersion(1, "ruleHelpVersion")
val hasUpHttpTTS: Boolean val needUpHttpTTS: Boolean
get() = !isLastVersion(3, "httpTtsVersion") get() = !isLastVersion(3, "httpTtsVersion")
val hasUpTxtTocRule: Boolean val needUpTxtTocRule: Boolean
get() = !isLastVersion(1, "txtTocRuleVersion") get() = !isLastVersion(1, "txtTocRuleVersion")
val hasUpRssSources: Boolean val needUpRssSources: Boolean
get() = !isLastVersion(4, "rssSourceVersion") get() = !isLastVersion(4, "rssSourceVersion")
var versionCode var versionCode

@ -21,7 +21,6 @@ import io.legado.app.constant.PreferKey
import io.legado.app.databinding.ActivityMainBinding import io.legado.app.databinding.ActivityMainBinding
import io.legado.app.help.AppConfig import io.legado.app.help.AppConfig
import io.legado.app.help.BookHelp import io.legado.app.help.BookHelp
import io.legado.app.help.DefaultData
import io.legado.app.help.LocalConfig import io.legado.app.help.LocalConfig
import io.legado.app.help.storage.Backup import io.legado.app.help.storage.Backup
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
@ -124,7 +123,6 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
} else if (!BuildConfig.DEBUG) { } else if (!BuildConfig.DEBUG) {
val log = String(assets.open("updateLog.md").readBytes()) val log = String(assets.open("updateLog.md").readBytes())
TextDialog.show(supportFragmentManager, log, TextDialog.MD, 5000, true) TextDialog.show(supportFragmentManager, log, TextDialog.MD, 5000, true)
DefaultData.importDefaultTocRules()//版本更新时更新自带本地txt目录规则
} }
viewModel.upVersion() viewModel.upVersion()
} }

@ -154,13 +154,13 @@ class MainViewModel(application: Application) : BaseViewModel(application) {
fun upVersion() { fun upVersion() {
execute { execute {
if (LocalConfig.hasUpHttpTTS) { if (LocalConfig.needUpHttpTTS) {
DefaultData.importDefaultHttpTTS() DefaultData.importDefaultHttpTTS()
} }
if (LocalConfig.hasUpTxtTocRule) { if (LocalConfig.needUpTxtTocRule) {
DefaultData.importDefaultTocRules() DefaultData.importDefaultTocRules()
} }
if (LocalConfig.hasUpRssSources) { if (LocalConfig.needUpRssSources) {
DefaultData.importDefaultRssSources() DefaultData.importDefaultRssSources()
} }
} }

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

Loading…
Cancel
Save