pull/1903/head
kunfei 3 years ago
parent 60d21d2e6c
commit 499f35f086
  1. 4
      app/src/main/assets/privacyPolicy.md
  2. 8
      app/src/main/java/io/legado/app/help/config/LocalConfig.kt
  3. 16
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt

@ -1,7 +1,7 @@
## 隐私协议
**是否同意本协议**
* 本应用没有服务端,不收集任何用户信息,只采用了Google Firebase收集崩溃报告和性能报告.
* 本应用网络同步和备份采用webDav协议,由用户自己提供同步服务.
* 存储权限用来打开本地文件和本地备份恢复.
* 其它一些权限是Google Firebase需要.
* 使用本软件发生任何问题由用户自己承担.
* 本应用为开源软件,使用中发生任何问题由用户自己承担.

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

@ -86,6 +86,7 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
override fun onPostCreate(savedInstanceState: Bundle?) {
super.onPostCreate(savedInstanceState)
upVersion()
privacyPolicy()
//自动更新书籍
if (AppConfig.autoRefreshBook) {
binding.viewPagerMain.postDelayed(1000) {
@ -149,8 +150,6 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
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<ActivityMainBinding, MainViewModel>(),
}
}
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) {

Loading…
Cancel
Save