mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
a79c720dcc
commit
f7605b527f
5
app/proguard-rules.pro
vendored
5
app/proguard-rules.pro
vendored
@ -174,8 +174,9 @@
|
||||
-dontwarn com.jeremyliao.liveeventbus.**
|
||||
-dontwarn org.commonmark.ext.gfm.**
|
||||
|
||||
-keep class com.google.gson.** { *; }
|
||||
-keep class com.ke.gson.** { *; }
|
||||
-keep,allowobfuscation,allowshrinking class com.google.gson.** { *; }
|
||||
-keep,allowobfuscation,allowshrinking class com.ke.gson.** { *; }
|
||||
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
|
||||
-keep class com.jeremyliao.liveeventbus.** { *; }
|
||||
-keep class okhttp3.**{*;}
|
||||
-keep class okio.**{*;}
|
||||
|
@ -7,6 +7,7 @@ import com.jayway.jsonpath.JsonPath
|
||||
import io.legado.app.R
|
||||
import io.legado.app.base.BaseViewModel
|
||||
import io.legado.app.constant.AppConst
|
||||
import io.legado.app.constant.AppLog
|
||||
import io.legado.app.constant.AppPattern
|
||||
import io.legado.app.data.appDb
|
||||
import io.legado.app.data.entities.BookSource
|
||||
@ -124,8 +125,8 @@ class ImportBookSourceViewModel(app: Application) : BaseViewModel(app) {
|
||||
else -> throw NoStackTraceException(context.getString(R.string.wrong_format))
|
||||
}
|
||||
}.onError {
|
||||
it.printOnDebug()
|
||||
errorLiveData.postValue(it.localizedMessage ?: "")
|
||||
errorLiveData.postValue("ImportError:${it.localizedMessage}")
|
||||
AppLog.put("ImportError:${it.localizedMessage}", it)
|
||||
}.onSuccess {
|
||||
comparisonSource()
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import androidx.lifecycle.MutableLiveData
|
||||
import io.legado.app.R
|
||||
import io.legado.app.base.BaseViewModel
|
||||
import io.legado.app.constant.AppConst
|
||||
import io.legado.app.constant.AppLog
|
||||
import io.legado.app.data.appDb
|
||||
import io.legado.app.data.entities.DictRule
|
||||
import io.legado.app.exception.NoStackTraceException
|
||||
@ -61,8 +62,8 @@ class ImportDictRuleViewModel(app: Application) : BaseViewModel(app) {
|
||||
execute {
|
||||
importSourceAwait(text.trim())
|
||||
}.onError {
|
||||
it.printOnDebug()
|
||||
errorLiveData.postValue(it.localizedMessage ?: "")
|
||||
errorLiveData.postValue("ImportError:${it.localizedMessage}")
|
||||
AppLog.put("ImportError:${it.localizedMessage}", it)
|
||||
}.onSuccess {
|
||||
comparisonSource()
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import androidx.lifecycle.MutableLiveData
|
||||
import io.legado.app.R
|
||||
import io.legado.app.base.BaseViewModel
|
||||
import io.legado.app.constant.AppConst
|
||||
import io.legado.app.constant.AppLog
|
||||
import io.legado.app.data.appDb
|
||||
import io.legado.app.data.entities.HttpTTS
|
||||
import io.legado.app.exception.NoStackTraceException
|
||||
@ -14,7 +15,6 @@ import io.legado.app.help.http.text
|
||||
import io.legado.app.utils.isAbsUrl
|
||||
import io.legado.app.utils.isJsonArray
|
||||
import io.legado.app.utils.isJsonObject
|
||||
import io.legado.app.utils.printOnDebug
|
||||
|
||||
class ImportHttpTtsViewModel(app: Application) : BaseViewModel(app) {
|
||||
|
||||
@ -64,8 +64,8 @@ class ImportHttpTtsViewModel(app: Application) : BaseViewModel(app) {
|
||||
execute {
|
||||
importSourceAwait(text.trim())
|
||||
}.onError {
|
||||
it.printOnDebug()
|
||||
errorLiveData.postValue(it.localizedMessage ?: "")
|
||||
errorLiveData.postValue("ImportError:${it.localizedMessage}")
|
||||
AppLog.put("ImportError:${it.localizedMessage}", it)
|
||||
}.onSuccess {
|
||||
comparisonSource()
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import android.app.Application
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import io.legado.app.base.BaseViewModel
|
||||
import io.legado.app.constant.AppConst
|
||||
import io.legado.app.constant.AppLog
|
||||
import io.legado.app.constant.AppPattern
|
||||
import io.legado.app.data.appDb
|
||||
import io.legado.app.data.entities.ReplaceRule
|
||||
@ -80,7 +81,8 @@ class ImportReplaceRuleViewModel(app: Application) : BaseViewModel(app) {
|
||||
execute {
|
||||
importAwait(text.trim())
|
||||
}.onError {
|
||||
errorLiveData.postValue(it.localizedMessage ?: "ERROR")
|
||||
errorLiveData.postValue("ImportError:${it.localizedMessage}")
|
||||
AppLog.put("ImportError:${it.localizedMessage}", it)
|
||||
}.onSuccess {
|
||||
comparisonSource()
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.jayway.jsonpath.JsonPath
|
||||
import io.legado.app.R
|
||||
import io.legado.app.base.BaseViewModel
|
||||
import io.legado.app.constant.AppConst
|
||||
import io.legado.app.constant.AppLog
|
||||
import io.legado.app.constant.AppPattern
|
||||
import io.legado.app.data.appDb
|
||||
import io.legado.app.data.entities.RssSource
|
||||
@ -115,6 +116,7 @@ class ImportRssSourceViewModel(app: Application) : BaseViewModel(app) {
|
||||
}
|
||||
}.onError {
|
||||
errorLiveData.postValue("ImportError:${it.localizedMessage}")
|
||||
AppLog.put("ImportError:${it.localizedMessage}", it)
|
||||
}.onSuccess {
|
||||
comparisonSource()
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import androidx.lifecycle.MutableLiveData
|
||||
import io.legado.app.R
|
||||
import io.legado.app.base.BaseViewModel
|
||||
import io.legado.app.constant.AppConst
|
||||
import io.legado.app.constant.AppLog
|
||||
import io.legado.app.exception.NoStackTraceException
|
||||
import io.legado.app.help.config.ThemeConfig
|
||||
import io.legado.app.help.http.newCallResponseBody
|
||||
@ -58,8 +59,8 @@ class ImportThemeViewModel(app: Application) : BaseViewModel(app) {
|
||||
execute {
|
||||
importSourceAwait(text.trim())
|
||||
}.onError {
|
||||
it.printOnDebug()
|
||||
errorLiveData.postValue(it.localizedMessage ?: "")
|
||||
errorLiveData.postValue("ImportError:${it.localizedMessage}")
|
||||
AppLog.put("ImportError:${it.localizedMessage}", it)
|
||||
}.onSuccess {
|
||||
comparisonSource()
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import androidx.lifecycle.MutableLiveData
|
||||
import io.legado.app.R
|
||||
import io.legado.app.base.BaseViewModel
|
||||
import io.legado.app.constant.AppConst
|
||||
import io.legado.app.constant.AppLog
|
||||
import io.legado.app.data.appDb
|
||||
import io.legado.app.data.entities.TxtTocRule
|
||||
import io.legado.app.exception.NoStackTraceException
|
||||
@ -61,8 +62,8 @@ class ImportTxtTocRuleViewModel(app: Application) : BaseViewModel(app) {
|
||||
execute {
|
||||
importSourceAwait(text.trim())
|
||||
}.onError {
|
||||
it.printOnDebug()
|
||||
errorLiveData.postValue(it.localizedMessage ?: "")
|
||||
errorLiveData.postValue("ImportError:${it.localizedMessage}")
|
||||
AppLog.put("ImportError:${it.localizedMessage}", it)
|
||||
}.onSuccess {
|
||||
comparisonSource()
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import java.lang.reflect.ParameterizedType
|
||||
import java.lang.reflect.Type
|
||||
import kotlin.math.ceil
|
||||
|
||||
val INITIAL_GSON by lazy {
|
||||
val INITIAL_GSON: Gson by lazy {
|
||||
GsonBuilder()
|
||||
.registerTypeAdapter(
|
||||
object : TypeToken<Map<String?, Any?>?>() {}.type,
|
||||
|
Loading…
Reference in New Issue
Block a user