From 469700f62703a9e81ea711ebe7af6f9c9a8e21fe Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sun, 4 Jun 2023 02:02:47 +0530 Subject: feat: add custom dialog title for passphrase cache --- .../java/app/passwordstore/ui/autofill/AutofillDecryptActivity.kt | 6 +++++- app/src/main/java/app/passwordstore/ui/crypto/DecryptActivity.kt | 5 ++++- app/src/main/res/values/strings.xml | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/src/main/java/app/passwordstore/ui/autofill/AutofillDecryptActivity.kt b/app/src/main/java/app/passwordstore/ui/autofill/AutofillDecryptActivity.kt index 023822a4..959728cd 100644 --- a/app/src/main/java/app/passwordstore/ui/autofill/AutofillDecryptActivity.kt +++ b/app/src/main/java/app/passwordstore/ui/autofill/AutofillDecryptActivity.kt @@ -12,6 +12,7 @@ import android.os.Build import android.os.Bundle import android.view.autofill.AutofillManager import androidx.lifecycle.lifecycleScope +import app.passwordstore.R import app.passwordstore.data.crypto.GPGPassphraseCache import app.passwordstore.data.passfile.PasswordEntry import app.passwordstore.ui.crypto.BasePgpActivity @@ -73,7 +74,10 @@ class AutofillDecryptActivity : BasePgpActivity() { if ( features.isEnabled(EnableGPGPassphraseCache) && BiometricAuthenticator.canAuthenticate(this) ) { - BiometricAuthenticator.authenticate(this) { authResult -> + BiometricAuthenticator.authenticate( + this, + R.string.biometric_prompt_title_gpg_passphrase_cache, + ) { authResult -> if (authResult is BiometricAuthenticator.Result.Success) { lifecycleScope.launch { val cachedPassphrase = diff --git a/app/src/main/java/app/passwordstore/ui/crypto/DecryptActivity.kt b/app/src/main/java/app/passwordstore/ui/crypto/DecryptActivity.kt index 56ba382c..552332f1 100644 --- a/app/src/main/java/app/passwordstore/ui/crypto/DecryptActivity.kt +++ b/app/src/main/java/app/passwordstore/ui/crypto/DecryptActivity.kt @@ -70,7 +70,10 @@ class DecryptActivity : BasePgpActivity() { features.isEnabled(EnableGPGPassphraseCache) && BiometricAuthenticator.canAuthenticate(this@DecryptActivity) ) { - BiometricAuthenticator.authenticate(this@DecryptActivity) { authResult -> + BiometricAuthenticator.authenticate( + this@DecryptActivity, + R.string.biometric_prompt_title_gpg_passphrase_cache, + ) { authResult -> requireKeysExist { decrypt(isError = false, authResult) } } } else { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9dc739ad..38b7dbc3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -373,4 +373,5 @@ Import a key using the add button below No keys imported There are no PGP keys imported in the app yet, press the button below to pick a key file + Unlock passphrase cache -- cgit v1.2.3