diff --git a/app/src/main/assets/privacyPolicy.md b/app/src/main/assets/privacyPolicy.md index 39e82e7d5..6fb42790b 100644 --- a/app/src/main/assets/privacyPolicy.md +++ b/app/src/main/assets/privacyPolicy.md @@ -1,7 +1,7 @@ -## 隐私协议 +**是否同意本协议** * 本应用没有服务端,不收集任何用户信息,只采用了Google Firebase收集崩溃报告和性能报告. * 本应用网络同步和备份采用webDav协议,由用户自己提供同步服务. * 存储权限用来打开本地文件和本地备份恢复. * 其它一些权限是Google Firebase需要. -* 使用本软件发生任何问题由用户自己承担. \ No newline at end of file +* 本应用为开源软件,使用中发生任何问题由用户自己承担. \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/help/config/LocalConfig.kt b/app/src/main/java/io/legado/app/help/config/LocalConfig.kt index 729fff6c1..09da7a194 100644 --- a/app/src/main/java/io/legado/app/help/config/LocalConfig.kt +++ b/app/src/main/java/io/legado/app/help/config/LocalConfig.kt @@ -3,6 +3,8 @@ package io.legado.app.help.config import android.content.Context import android.content.SharedPreferences import androidx.core.content.edit +import io.legado.app.utils.getBoolean +import io.legado.app.utils.putBoolean import io.legado.app.utils.putLong import splitties.init.appCtx @@ -16,6 +18,12 @@ object LocalConfig : putLong("lastBackup", value) } + var privacyPolicyOk: Boolean + get() = getBoolean("privacyPolicyOk") + set(value) { + putBoolean("privacyPolicyOk", value) + } + val readHelpVersionIsLast: Boolean get() = isLastVersion(1, "readHelpVersion", "firstRead") 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 b75046589..d179f5cd1 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 @@ -86,6 +86,7 @@ class MainActivity : VMBaseActivity(), override fun onPostCreate(savedInstanceState: Bundle?) { super.onPostCreate(savedInstanceState) upVersion() + privacyPolicy() //自动更新书籍 if (AppConfig.autoRefreshBook) { binding.viewPagerMain.postDelayed(1000) { @@ -149,8 +150,6 @@ class MainActivity : VMBaseActivity(), if (LocalConfig.isFirstOpenApp) { val help = String(assets.open("help/appHelp.md").readBytes()) showDialogFragment(TextDialog(help, TextDialog.Mode.MD)) - val privacyPolicy = String(assets.open("privacyPolicy.md").readBytes()) - showDialogFragment(TextDialog(privacyPolicy, TextDialog.Mode.MD)) } else if (!BuildConfig.DEBUG) { val log = String(assets.open("updateLog.md").readBytes()) showDialogFragment(TextDialog(log, TextDialog.Mode.MD)) @@ -159,6 +158,19 @@ class MainActivity : VMBaseActivity(), } } + private fun privacyPolicy() { + if (LocalConfig.privacyPolicyOk) return + val privacyPolicy = String(assets.open("privacyPolicy.md").readBytes()) + alert("用户隐私与协议", privacyPolicy) { + noButton { + finish() + } + yesButton { + LocalConfig.privacyPolicyOk = true + } + } + } + override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean { event?.let { when (keyCode) {