mirror of
https://github.com/Corewala/Buran
synced 2024-12-22 07:42:43 +00:00
Make biometric unlock only required once per session
This commit is contained in:
parent
e46ea379c3
commit
a519a522cf
1 changed files with 7 additions and 4 deletions
|
@ -80,6 +80,8 @@ class GemActivity : AppCompatActivity() {
|
|||
override fun openExternal(address: String) = openExternalLink(address)
|
||||
})
|
||||
|
||||
private var decryptedCertPassword: String? = null
|
||||
|
||||
private var internetStatus: Boolean = false
|
||||
|
||||
private var initialised: Boolean = false
|
||||
|
@ -418,14 +420,14 @@ class GemActivity : AppCompatActivity() {
|
|||
if(prefs.getBoolean(Buran.PREF_KEY_CLIENT_CERT_ACTIVE, false)){
|
||||
builder
|
||||
.setPositiveButton(getString(R.string.use_client_certificate).toUpperCase()) { _, _ ->
|
||||
if(prefs.getBoolean("use_biometrics", false)){
|
||||
if(prefs.getBoolean("use_biometrics", false) and !decryptedCertPassword.isNullOrEmpty()){
|
||||
biometricSecureRequest(state.uri.toString())
|
||||
}else{
|
||||
model.request(
|
||||
state.uri.toString(),
|
||||
prefs.getString(
|
||||
Buran.PREF_KEY_CLIENT_CERT_PASSWORD,
|
||||
null
|
||||
decryptedCertPassword
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -546,8 +548,9 @@ class GemActivity : AppCompatActivity() {
|
|||
)!!
|
||||
)
|
||||
|
||||
val certPassword = biometricManager.decryptData(ciphertext, result.cryptoObject?.cipher!!)
|
||||
model.request(address, certPassword)
|
||||
decryptedCertPassword = biometricManager.decryptData(ciphertext, result.cryptoObject?.cipher!!)
|
||||
|
||||
model.request(address, decryptedCertPassword)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue