mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-25 18:17:26 +00:00
suBiometric: fix open app on second user will auto disable biometric
second user does not support biometric, but the config of app ignores user
This commit is contained in:
parent
9571b6f9be
commit
ab9ee449e4
@ -18,14 +18,7 @@ class BiometricHelper(context: Context) {
|
|||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
|
|
||||||
val isEnabled: Boolean get() {
|
val isEnabled get() = isSupported && Config.suBiometric
|
||||||
val enabled = Config.suBiometric
|
|
||||||
if (enabled && !isSupported) {
|
|
||||||
Config.suBiometric = false
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return enabled
|
|
||||||
}
|
|
||||||
|
|
||||||
fun authenticate(
|
fun authenticate(
|
||||||
activity: FragmentActivity,
|
activity: FragmentActivity,
|
||||||
|
@ -286,14 +286,16 @@ object Tapjack : BaseSettingsItem.Toggle() {
|
|||||||
object Biometrics : BaseSettingsItem.Toggle() {
|
object Biometrics : BaseSettingsItem.Toggle() {
|
||||||
override val title = R.string.settings_su_biometric_title.asText()
|
override val title = R.string.settings_su_biometric_title.asText()
|
||||||
override var description = R.string.settings_su_biometric_summary.asText()
|
override var description = R.string.settings_su_biometric_summary.asText()
|
||||||
override var value by Config::suBiometric
|
override var value
|
||||||
|
get() = ServiceLocator.biometrics.isEnabled
|
||||||
|
set(value) {
|
||||||
|
Config.suBiometric = value
|
||||||
|
}
|
||||||
|
|
||||||
override fun refresh() {
|
override fun refresh() {
|
||||||
isEnabled = ServiceLocator.biometrics.isSupported
|
isEnabled = ServiceLocator.biometrics.isSupported
|
||||||
if (!isEnabled) {
|
if (!isEnabled) {
|
||||||
value = false
|
|
||||||
description = R.string.no_biometric.asText()
|
description = R.string.no_biometric.asText()
|
||||||
notifyPropertyChanged(BR.checked)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user