Prompt for password if fingerprint authentification fails

This commit is contained in:
Matéo Duparc 2022-04-02 11:58:25 +02:00
parent 2697eaf11b
commit 91de54018d
Signed by untrusted user: hardcoresushi
GPG Key ID: AFE384344A45E13A

View File

@ -426,7 +426,11 @@ class MainActivity : BaseActivity() {
} }
} }
override fun onPasswordHashSaved() {} override fun onPasswordHashSaved() {}
override fun onFailed(pending: Boolean) {} override fun onFailed(pending: Boolean) {
if (!pending) {
askForPassword(volume, position)
}
}
} }
fingerprintProtector.loadPasswordHash(volume.shortName, encryptedHash, iv) fingerprintProtector.loadPasswordHash(volume.shortName, encryptedHash, iv)
} }
@ -450,7 +454,7 @@ class MainActivity : BaseActivity() {
private fun askForPassword(volume: Volume, position: Int) { private fun askForPassword(volume: Volume, position: Int) {
val dialogBinding = DialogOpenVolumeBinding.inflate(layoutInflater) val dialogBinding = DialogOpenVolumeBinding.inflate(layoutInflater)
if (!usfFingerprint || fingerprintProtector == null) { if (!usfFingerprint || fingerprintProtector == null || volume.encryptedHash != null) {
dialogBinding.checkboxSavePassword.visibility = View.GONE dialogBinding.checkboxSavePassword.visibility = View.GONE
} }
val dialog = CustomAlertDialogBuilder(this, themeValue) val dialog = CustomAlertDialogBuilder(this, themeValue)