diff options
author | Mathias Rav <m@git.strova.dk> | 2023-12-16 17:11:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-16 21:41:26 +0530 |
commit | 97bc1e0ce52fc8411b252ae912bac40d29feee64 (patch) | |
tree | 372328d9a5682aedf38dd3992abd46585f86bc0f /app/src/main/java | |
parent | ab87e9c4ac5a97fee24f74ebfd4e727e63001da9 (diff) |
Add snackbar error message when .gpg-id contains a short hex id (#2819)
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/app/passwordstore/ui/crypto/BasePGPActivity.kt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/src/main/java/app/passwordstore/ui/crypto/BasePGPActivity.kt b/app/src/main/java/app/passwordstore/ui/crypto/BasePGPActivity.kt index d0039d52..7fa56333 100644 --- a/app/src/main/java/app/passwordstore/ui/crypto/BasePGPActivity.kt +++ b/app/src/main/java/app/passwordstore/ui/crypto/BasePGPActivity.kt @@ -170,7 +170,9 @@ open class BasePGPActivity : AppCompatActivity() { if (line.isEmpty()) return@run // Apparently `gpg-id` being the first line is also acceptable? if (line == "gpg-id") return@run - if (line.removePrefix("0x").matches("[a-fA-F0-9]{8}".toRegex()).not()) { + if (line.removePrefix("0x").matches("[a-fA-F0-9]{8}".toRegex())) { + snackbar(message = resources.getString(R.string.short_gpg_id)) + } else { snackbar(message = resources.getString(R.string.invalid_gpg_id)) } return null |