diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2023-06-13 00:44:50 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2023-06-13 00:44:50 +0530 |
commit | e7982f1f0c5801a42065e803fa36110a9fdf4d62 (patch) | |
tree | 0cb931ef46b349bbefa620b99126be30fb9a8d5a /app/src/main/java | |
parent | 5871a1cb5f55245d3292d799df1b04127a2e1702 (diff) |
fix: allow `gpg-id` to be the first line of a `.gpg-id` file
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/app/passwordstore/ui/crypto/BasePgpActivity.kt | 2 |
1 files changed, 2 insertions, 0 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 fe59b4ff..417565a7 100644 --- a/app/src/main/java/app/passwordstore/ui/crypto/BasePgpActivity.kt +++ b/app/src/main/java/app/passwordstore/ui/crypto/BasePgpActivity.kt @@ -168,6 +168,8 @@ open class BasePgpActivity : AppCompatActivity() { // file we created. Skip the validation so we can make the user add a // real ID. 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()) { snackbar(message = resources.getString(R.string.invalid_gpg_id)) } |