summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2023-06-04 02:02:47 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2023-06-04 02:02:47 +0530
commit469700f62703a9e81ea711ebe7af6f9c9a8e21fe (patch)
tree74f076f36993d384c01c80d57bd0ee5be920e463 /app
parentf6e1830647d9fbf91fca603a51566d66069e9def (diff)
feat: add custom dialog title for passphrase cache
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/app/passwordstore/ui/autofill/AutofillDecryptActivity.kt6
-rw-r--r--app/src/main/java/app/passwordstore/ui/crypto/DecryptActivity.kt5
-rw-r--r--app/src/main/res/values/strings.xml1
3 files changed, 10 insertions, 2 deletions
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 @@
<string name="pgp_key_manager_no_keys_guidance">Import a key using the add button below</string>
<string name="no_keys_imported_dialog_title">No keys imported</string>
<string name="no_keys_imported_dialog_message">There are no PGP keys imported in the app yet, press the button below to pick a key file</string>
+ <string name="biometric_prompt_title_gpg_passphrase_cache">Unlock passphrase cache</string>
</resources>