|
|
|
@ -2,6 +2,7 @@ package io.legado.app.help.storage |
|
|
|
|
|
|
|
|
|
import android.content.Context |
|
|
|
|
import android.net.Uri |
|
|
|
|
import androidx.appcompat.app.AppCompatDelegate |
|
|
|
|
import androidx.documentfile.provider.DocumentFile |
|
|
|
|
import com.jayway.jsonpath.Configuration |
|
|
|
|
import com.jayway.jsonpath.JsonPath |
|
|
|
@ -9,8 +10,10 @@ import com.jayway.jsonpath.Option |
|
|
|
|
import com.jayway.jsonpath.ParseContext |
|
|
|
|
import io.legado.app.App |
|
|
|
|
import io.legado.app.BuildConfig |
|
|
|
|
import io.legado.app.constant.EventBus |
|
|
|
|
import io.legado.app.constant.PreferKey |
|
|
|
|
import io.legado.app.data.entities.* |
|
|
|
|
import io.legado.app.help.AppConfig |
|
|
|
|
import io.legado.app.help.LauncherIconHelp |
|
|
|
|
import io.legado.app.help.ReadBookConfig |
|
|
|
|
import io.legado.app.service.help.ReadBook |
|
|
|
@ -128,11 +131,18 @@ object Restore { |
|
|
|
|
ReadBook.loadContent() |
|
|
|
|
} |
|
|
|
|
withContext(Main) { |
|
|
|
|
if (AppConfig.isNightTheme && AppCompatDelegate.getDefaultNightMode() != AppCompatDelegate.MODE_NIGHT_YES) { |
|
|
|
|
App.INSTANCE.applyDayNight() |
|
|
|
|
if (!BuildConfig.DEBUG) |
|
|
|
|
} else if (!AppConfig.isNightTheme && AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_YES) { |
|
|
|
|
App.INSTANCE.applyDayNight() |
|
|
|
|
} else { |
|
|
|
|
postEvent(EventBus.RECREATE, "true") |
|
|
|
|
} |
|
|
|
|
if (!BuildConfig.DEBUG) { |
|
|
|
|
LauncherIconHelp.changeIcon(App.INSTANCE.getPrefString(PreferKey.launcherIcon)) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private inline fun <reified T> fileToListT(path: String, fileName: String): List<T>? { |
|
|
|
|
try { |
|
|
|
|