Try to fix missing .gpg-id files as well (#1246)

This commit is contained in:
Harsh Shandilya 2020-12-10 21:06:45 +05:30 committed by GitHub
parent 29778e0e3d
commit c02ad427be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 2 additions and 8 deletions

View file

@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
### Added
- On Android 11, Autofill will use the new [inline autofill](https://developer.android.com/guide/topics/text/ime-autofill#configure-provider) UI that integrates Autofill results into your keyboard app.
- Invalid `.gpg-id` files can now be fixed automatically by deleting them and then trying to create a new password.
### Fixed

View file

@ -335,10 +335,7 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
// pass enters the key ID into `.gpg-id`.
val repoRoot = PasswordRepository.getRepositoryDirectory()
val gpgIdentifierFile = File(repoRoot, directory.text.toString()).findTillRoot(".gpg-id", repoRoot)
if (gpgIdentifierFile == null) {
snackbar(message = resources.getString(R.string.failed_to_find_key_id))
return@with
}
?: File(repoRoot, ".gpg-id").apply { createNewFile() }
val gpgIdentifiers = gpgIdentifierFile.readLines()
.filter { it.isNotBlank() }
.map { line ->

View file

@ -245,7 +245,6 @@
<!-- Password creation failure -->
<string name="password_creation_file_fail_title">Erreur</string>
<string name="exporting_passwords">Exportation des mots de passe…</string>
<string name="failed_to_find_key_id">Impossible de localiser .gpg-id, votre dépôt est-il correctement configuré ?</string>
<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>
<string name="directory_hint">Dossier</string>
<string name="new_folder_set_gpg_key">Définir la clé GPG pour le dossier</string>

View file

@ -279,7 +279,6 @@
<string name="otp_import_success">Configuração TOTP importada com sucesso</string>
<string name="otp_import_failure">Falha ao importar a configuração TOTP</string>
<string name="exporting_passwords">Exportando senhas…</string>
<string name="failed_to_find_key_id">Falha ao localizar .gpg-id, seu store está configurado corretamente?</string>
<string name="invalid_gpg_id">Encontrado .gpg-id, mas contém uma ID de chave inválida, fingerprint ou ID de usuário</string>
<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>
<string name="invalid_filename_text">Nome do arquivo não deve conter \'/\', defina o diretório acima</string>

View file

@ -283,7 +283,6 @@
<string name="otp_import_success">Конфигурация TOTP успешно импортирована</string>
<string name="otp_import_failure">Не удалось импортировать конфигурацию TOTP</string>
<string name="exporting_passwords">Экспорт паролей…</string>
<string name="failed_to_find_key_id">Не удалось найти .gpg-id, ваше хранилище настроено корректно?</string>
<string name="invalid_gpg_id">Найден .gpg-id, но он содержит неверный ID ключа, fingerprint или ID пользователя</string>
<string name="short_key_ids_unsupported">Идентификатор ключа в .gpg-id слишком короткий, пожалуйста, используйте длинные идентификаторы (16 символов) или fingerprint (40 символов)</string>
<string name="invalid_filename_text">Имя файла не должно содержать \'/\', укажите директорию выше</string>

View file

@ -344,7 +344,6 @@
<string name="otp_import_success">Successfully imported TOTP configuration</string>
<string name="otp_import_failure">Failed to import TOTP configuration</string>
<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>