Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit b0afe8a

Browse files
committed
Try to fix missing .gpg-id files as well (#1246)
(cherry picked from commit c02ad42) Signed-off-by: Harsh Shandilya <[email protected]>
1 parent 964d05f commit b0afe8a

File tree

6 files changed

+5
-8
lines changed

6 files changed

+5
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- Invalid `.gpg-id` files can now be fixed automatically by deleting them and then trying to create a new password.
10+
711
### Fixed
812

913
- Cancelling the Autofill "Generate password" action now correctly returns you to the original app.

app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,7 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
335335
// pass enters the key ID into `.gpg-id`.
336336
val repoRoot = PasswordRepository.getRepositoryDirectory()
337337
val gpgIdentifierFile = File(repoRoot, directory.text.toString()).findTillRoot(".gpg-id", repoRoot)
338-
if (gpgIdentifierFile == null) {
339-
snackbar(message = resources.getString(R.string.failed_to_find_key_id))
340-
return@with
341-
}
338+
?: File(repoRoot, ".gpg-id").apply { createNewFile() }
342339
val gpgIdentifiers = gpgIdentifierFile.readLines()
343340
.filter { it.isNotBlank() }
344341
.map { line ->

app/src/main/res/values-fr/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@
264264
<!-- Password creation failure -->
265265
<string name="password_creation_file_fail_title">Erreur</string>
266266
<string name="exporting_passwords">Exportation des mots de passe…</string>
267-
<string name="failed_to_find_key_id">Impossible de localiser .gpg-id, votre dépôt est-il correctement configuré ?</string>
268267
<string name="short_key_ids_unsupported">Un ID de clé dans .gpg-id est trop court, veuillez utiliser soit des identifiants de clés longs (16 caractères) soit des empreintes digitales (40 caractères)</string>
269268
<string name="directory_hint">Dossier</string>
270269
<string name="new_folder_set_gpg_key">Définir la clé GPG pour le dossier</string>

app/src/main/res/values-pt-rBR/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@
299299
<string name="otp_import_success">Configuração TOTP importada com sucesso</string>
300300
<string name="otp_import_failure">Falha ao importar a configuração TOTP</string>
301301
<string name="exporting_passwords">Exportando senhas…</string>
302-
<string name="failed_to_find_key_id">Falha ao localizar .gpg-id, seu store está configurado corretamente?</string>
303302
<string name="invalid_gpg_id">Encontrado .gpg-id, mas contém uma ID de chave inválida, fingerprint ou ID de usuário</string>
304303
<string name="short_key_ids_unsupported">O ID de chave em .gpg-id é muito curto, por favor utilize os IDs de chaves longos (16 caracteres) ou fingerprints (40 caracteres)</string>
305304
<string name="invalid_filename_text">Nome do arquivo não deve conter \'/\', defina o diretório acima</string>

app/src/main/res/values-ru/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@
303303
<string name="otp_import_success">Конфигурация TOTP успешно импортирована</string>
304304
<string name="otp_import_failure">Не удалось импортировать конфигурацию TOTP</string>
305305
<string name="exporting_passwords">Экспорт паролей…</string>
306-
<string name="failed_to_find_key_id">Не удалось найти .gpg-id, ваше хранилище настроено корректно?</string>
307306
<string name="invalid_gpg_id">Найден .gpg-id, но он содержит неверный ID ключа, fingerprint или ID пользователя</string>
308307
<string name="short_key_ids_unsupported">Идентификатор ключа в .gpg-id слишком короткий, пожалуйста, используйте длинные идентификаторы (16 символов) или fingerprint (40 символов)</string>
309308
<string name="invalid_filename_text">Имя файла не должно содержать \'/\', укажите директорию выше</string>

app/src/main/res/values/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@
361361
<string name="otp_import_success">Successfully imported TOTP configuration</string>
362362
<string name="otp_import_failure">Failed to import TOTP configuration</string>
363363
<string name="exporting_passwords">Exporting passwords…</string>
364-
<string name="failed_to_find_key_id">Failed to locate .gpg-id, is your store set up correctly?</string>
365364
<string name="invalid_gpg_id">Found .gpg-id, but it contains an invalid key ID, fingerprint or user ID</string>
366365
<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>
367366
<string name="invalid_filename_text">File name must not contain \'/\', set directory above</string>

0 commit comments

Comments
 (0)