From b743d004e2b88b8e4620c748b867efed895dc527 Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Thu, 24 Jul 2025 18:22:11 +0200 Subject: [PATCH] fix: Template EMAIL #1986 --- CHANGELOG | 1 + .../element/template/TemplateBuilder.kt | 137 +++++++++++++----- .../metadata/android/en-US/changelogs/135.txt | 3 +- .../metadata/android/fr-FR/changelogs/135.txt | 3 +- 4 files changed, 105 insertions(+), 39 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 229b1cb39..d902fdd6a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ KeePassDX(4.1.3) * Fix Autofill Registration #2089 * Fix Biometric errors #2081 * Fixed timestamp in copy file #1981 #1983 + * Fix Template Email #1986 KeePassDX(4.1.2) * Fix URL search #1940 #1946 #2003 #2040 #2044 diff --git a/database/src/main/java/com/kunzisoft/keepass/database/element/template/TemplateBuilder.kt b/database/src/main/java/com/kunzisoft/keepass/database/element/template/TemplateBuilder.kt index 74c783551..311bd4e17 100644 --- a/database/src/main/java/com/kunzisoft/keepass/database/element/template/TemplateBuilder.kt +++ b/database/src/main/java/com/kunzisoft/keepass/database/element/template/TemplateBuilder.kt @@ -24,52 +24,115 @@ import java.util.* class TemplateBuilder { - private val urlAttribute = TemplateAttribute(TemplateField.LABEL_URL, TemplateAttributeType.TEXT) - private val usernameAttribute = TemplateAttribute(TemplateField.LABEL_USERNAME, TemplateAttributeType.TEXT) + private val urlAttribute = TemplateAttribute( + label = TemplateField.LABEL_URL, + type = TemplateAttributeType.TEXT + ) + private val usernameAttribute = TemplateAttribute( + label = TemplateField.LABEL_USERNAME, + type = TemplateAttributeType.TEXT + ) private val notesAttribute = TemplateAttribute( - TemplateField.LABEL_NOTES, - TemplateAttributeType.TEXT, - false, - TemplateAttributeOption().apply { + label = TemplateField.LABEL_NOTES, + type = TemplateAttributeType.TEXT, + protected = false, + options = TemplateAttributeOption().apply { setNumberLinesToMany() - }) - private val holderAttribute = TemplateAttribute(TemplateField.LABEL_HOLDER, TemplateAttributeType.TEXT) - private val numberAttribute = TemplateAttribute(TemplateField.LABEL_NUMBER, TemplateAttributeType.TEXT) - private val cvvAttribute = TemplateAttribute(TemplateField.LABEL_CVV, TemplateAttributeType.TEXT, true) - private val pinAttribute = TemplateAttribute(TemplateField.LABEL_PIN, TemplateAttributeType.TEXT, true) - private val nameAttribute = TemplateAttribute(TemplateField.LABEL_NAME, TemplateAttributeType.TEXT) - private val placeOfIssueAttribute = TemplateAttribute(TemplateField.LABEL_PLACE_OF_ISSUE, TemplateAttributeType.TEXT) + } + ) + private val holderAttribute = TemplateAttribute( + label = TemplateField.LABEL_HOLDER, + type = TemplateAttributeType.TEXT + ) + private val numberAttribute = TemplateAttribute( + label = TemplateField.LABEL_NUMBER, + type = TemplateAttributeType.TEXT + ) + private val cvvAttribute = TemplateAttribute( + label = TemplateField.LABEL_CVV, + type = TemplateAttributeType.TEXT, + protected = true + ) + private val pinAttribute = TemplateAttribute( + label = TemplateField.LABEL_PIN, + type = TemplateAttributeType.TEXT, + protected = true + ) + private val nameAttribute = TemplateAttribute( + label = TemplateField.LABEL_NAME, + type = TemplateAttributeType.TEXT + ) + private val placeOfIssueAttribute = TemplateAttribute( + label = TemplateField.LABEL_PLACE_OF_ISSUE, + type = TemplateAttributeType.TEXT + ) private val dateOfIssueAttribute = TemplateAttribute( - TemplateField.LABEL_DATE_OF_ISSUE, - TemplateAttributeType.DATETIME, - false, - TemplateAttributeOption().apply { + label = TemplateField.LABEL_DATE_OF_ISSUE, + type = TemplateAttributeType.DATETIME, + protected = false, + options = TemplateAttributeOption().apply { setDateFormatToDate() - }) + } + ) private val expirationDateAttribute = TemplateAttribute( - TemplateField.LABEL_EXPIRATION, - TemplateAttributeType.DATETIME, - false, - TemplateAttributeOption().apply { + label = TemplateField.LABEL_EXPIRATION, + type = TemplateAttributeType.DATETIME, + protected = false, + options = TemplateAttributeOption().apply { setDateFormatToDate() - }) - private val emailAddressAttribute = TemplateAttribute(TemplateField.LABEL_EMAIL_ADDRESS, TemplateAttributeType.TEXT) - private val passwordAttribute = TemplateAttribute(TemplateField.LABEL_PASSWORD, TemplateAttributeType.TEXT, true) - private val ssidAttribute = TemplateAttribute(TemplateField.LABEL_SSID, TemplateAttributeType.TEXT) + } + ) + private val emailAddressAttribute = TemplateAttribute( + label = TemplateField.LABEL_USERNAME, + type = TemplateAttributeType.TEXT, + options = TemplateAttributeOption().apply { + alias = TemplateField.LABEL_EMAIL_ADDRESS + } + ) + private val passwordAttribute = TemplateAttribute( + label = TemplateField.LABEL_PASSWORD, + type = TemplateAttributeType.TEXT, + protected = true + ) + private val ssidAttribute = TemplateAttribute( + label = TemplateField.LABEL_SSID, + type = TemplateAttributeType.TEXT + ) private val wirelessTypeAttribute = TemplateAttribute( - TemplateField.LABEL_TYPE, - TemplateAttributeType.LIST, - false, - TemplateAttributeOption().apply{ + label = TemplateField.LABEL_TYPE, + type = TemplateAttributeType.LIST, + protected = false, + options = TemplateAttributeOption().apply{ setListItems("WPA3", "WPA2", "WPA", "WEP") default = "WPA2" - }) - private val tokenAttribute = TemplateAttribute(TemplateField.LABEL_TOKEN, TemplateAttributeType.TEXT) - private val publicKeyAttribute = TemplateAttribute(TemplateField.LABEL_PUBLIC_KEY, TemplateAttributeType.TEXT) - private val privateKeyAttribute = TemplateAttribute(TemplateField.LABEL_PRIVATE_KEY, TemplateAttributeType.TEXT, true) - private val seedAttribute = TemplateAttribute(TemplateField.LABEL_SEED, TemplateAttributeType.TEXT, true) - private val bicAttribute = TemplateAttribute(TemplateField.LABEL_BIC, TemplateAttributeType.TEXT) - private val ibanAttribute = TemplateAttribute(TemplateField.LABEL_IBAN, TemplateAttributeType.TEXT) + } + ) + private val tokenAttribute = TemplateAttribute( + label = TemplateField.LABEL_TOKEN, + type = TemplateAttributeType.TEXT + ) + private val publicKeyAttribute = TemplateAttribute( + label = TemplateField.LABEL_PUBLIC_KEY, + type = TemplateAttributeType.TEXT + ) + private val privateKeyAttribute = TemplateAttribute( + label = TemplateField.LABEL_PRIVATE_KEY, + type = TemplateAttributeType.TEXT, + protected = true + ) + private val seedAttribute = TemplateAttribute( + label = TemplateField.LABEL_SEED, + type = TemplateAttributeType.TEXT, + protected = true + ) + private val bicAttribute = TemplateAttribute( + label = TemplateField.LABEL_BIC, + type = TemplateAttributeType.TEXT + ) + private val ibanAttribute = TemplateAttribute( + label = TemplateField.LABEL_IBAN, + type = TemplateAttributeType.TEXT + ) val email: Template get() { diff --git a/fastlane/metadata/android/en-US/changelogs/135.txt b/fastlane/metadata/android/en-US/changelogs/135.txt index 4e08c9697..f8fff9e8b 100644 --- a/fastlane/metadata/android/en-US/changelogs/135.txt +++ b/fastlane/metadata/android/en-US/changelogs/135.txt @@ -1,3 +1,4 @@ * Fix Autofill Registration #2089 * Fix Biometric errors #2081 - * Fixed timestamp in copy file #1981 #1983 \ No newline at end of file + * Fixed timestamp in copy file #1981 #1983 + * Fix Template Email #1986 \ No newline at end of file diff --git a/fastlane/metadata/android/fr-FR/changelogs/135.txt b/fastlane/metadata/android/fr-FR/changelogs/135.txt index 386f2bfd7..0995b995d 100644 --- a/fastlane/metadata/android/fr-FR/changelogs/135.txt +++ b/fastlane/metadata/android/fr-FR/changelogs/135.txt @@ -1,3 +1,4 @@ * Correction de l'enregistrement pour le remplissage automatique #2089 * Correction des erreurs biométriques #2081 - * Correction du timestamp dans le fichier de copie #1981 #1983 \ No newline at end of file + * Correction du timestamp dans le fichier de copie #1981 #1983 + * Correction des gabaris Email #1986 \ No newline at end of file