mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-30 22:05:19 +00:00
Add specific warning for short key IDs in .gpg-id (#974)
This commit is contained in:
@@ -316,7 +316,11 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
|
||||
.filter { it.isNotBlank() }
|
||||
.map { line ->
|
||||
parseGpgIdentifier(line) ?: run {
|
||||
snackbar(message = resources.getString(R.string.invalid_gpg_id))
|
||||
if (line.removePrefix("0x").matches("[a-fA-F0-9]{8}".toRegex())) {
|
||||
snackbar(message = resources.getString(R.string.short_key_ids_unsupported))
|
||||
} else {
|
||||
snackbar(message = resources.getString(R.string.invalid_gpg_id))
|
||||
}
|
||||
return@with
|
||||
}
|
||||
}
|
||||
|
@@ -368,6 +368,7 @@
|
||||
<string name="exporting_passwords">Exporting passwords…</string>
|
||||
<string name="failed_to_find_key_id">Failed to locate .gpg-id, is your store set up correctly?</string>
|
||||
<string name="invalid_gpg_id">Found .gpg-id, but it contains an invalid key ID, fingerprint or user ID</string>
|
||||
<string name="short_key_ids_unsupported">A key ID in .gpg-id is too short, please use either long key IDs (16 characters) or fingerprints (40 characters)</string>
|
||||
<string name="invalid_filename_text">File name must not contain \'/\', set directory above</string>
|
||||
<string name="directory_hint">Directory</string>
|
||||
</resources>
|
||||
|
Reference in New Issue
Block a user