Merge branch 'develop' into release/4.5.0

This commit is contained in:
J-Jamet committed 2026-07-02 19:38:50 +02:00
commit 19df38adb1
6 files changed
+20 -3

No files matched your search

+3
View File
@@ -20,6 +20,9 @@ KeePassDX(4.5.0_beta01)
* Fix copy with User Verification #2575
* Refactoring #2541
KeePassDX(4.4.5)
* Fix OTP tag #2570 #2571
KeePassDX(4.4.4)
* Fix return to previous keyboard #2529
* Fix keyboard view update #2539
@@ -46,6 +46,7 @@ import com.kunzisoft.keepass.model.EntryInfo
import com.kunzisoft.keepass.model.FieldProtection
import com.kunzisoft.keepass.model.StreamDirection
import com.kunzisoft.keepass.otp.OtpEntryFields
import com.kunzisoft.keepass.otp.OtpEntryFields.isOTP
import com.kunzisoft.keepass.view.TagsCompletionView
import com.kunzisoft.keepass.view.TemplateEditView
import com.kunzisoft.keepass.view.collapse
@@ -211,6 +212,10 @@ class EntryEditFragment: DatabaseFragment() {
if (newField == null) {
oldField?.let {
templateView.removeCustomField(it)
// If no more OTP fields, remove the OTP tag
if (it.isOTP() && templateView.getEntryInfo().customFields.none { field -> field.isOTP() }) {
tagsCompletionView.removeObjectSync(OtpEntryFields.OTP_TAG)
}
}
}
}
@@ -520,7 +520,13 @@ open class DatabaseInfo: Database() {
newEntryInfo.setCreditCard(it)
}
newEntryInfo.otpModel?.let {
newEntryInfo.setOtp(OtpEntryFields.buildOtpField(OtpElement(it)).protectedValue.toString())
newEntryInfo.setOtp(
otpString = OtpEntryFields
.buildOtpField(OtpElement(it))
.protectedValue
.toString(),
addTag = false
)
}
newEntryInfo.appOrigin?.let {
newEntryInfo.saveAppOrigin(it, database.allowEntryCustomFields())
@@ -441,10 +441,11 @@ object OtpEntryFields {
)
}
fun EntryInfo.setOtp(otpString: String): Boolean {
fun EntryInfo.setOtp(otpString: String, addTag: Boolean = true): Boolean {
// Replace the OTP field
parseOTPUri(otpString)?.let { otpElement ->
tags.put(OTP_TAG)
if (addTag)
tags.put(OTP_TAG)
if (title.isEmpty())
title = otpElement.issuer
if (username.isEmpty())
@@ -0,0 +1 @@
* Fix OTP tag #2570 #2571
@@ -0,0 +1 @@
* Correction de tag OTP #2570 #2571