mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
fix: Save search info if URL present #2255
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
KeePassDX(4.2.3)
|
||||
* Fix multiple Passkey selection #2253
|
||||
* Fix database dialog subtitle #2254
|
||||
* Fix save search info if URL present #2255
|
||||
|
||||
KeePassDX(4.2.2)
|
||||
* Fix database merge algorithm #2223
|
||||
|
||||
@@ -841,7 +841,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
// Open child group
|
||||
loadMainGroup(GroupState(group.nodeId, 0))
|
||||
} catch (e: ClassCastException) {
|
||||
Log.e(TAG, "Node can't be cast in Group")
|
||||
Log.e(TAG, "Node can't be cast in Group", e)
|
||||
}
|
||||
|
||||
Type.ENTRY -> try {
|
||||
@@ -867,6 +867,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
if (!database.isReadOnly
|
||||
&& searchInfo != null
|
||||
&& PreferencesUtil.isKeyboardSaveSearchInfoEnable(this@GroupActivity)
|
||||
&& entryVersioned.containsSearchInfo(database, searchInfo).not()
|
||||
) {
|
||||
updateEntryWithRegisterInfo(
|
||||
database,
|
||||
@@ -884,6 +885,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
if (!database.isReadOnly
|
||||
&& searchInfo != null
|
||||
&& PreferencesUtil.isAutofillSaveSearchInfoEnable(this@GroupActivity)
|
||||
&& entryVersioned.containsSearchInfo(database, searchInfo).not()
|
||||
) {
|
||||
updateEntryWithRegisterInfo(
|
||||
database,
|
||||
@@ -912,7 +914,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
finish()
|
||||
})
|
||||
} catch (e: ClassCastException) {
|
||||
Log.e(TAG, "Node can't be cast in Entry")
|
||||
Log.e(TAG, "Node can't be cast in Entry", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -981,6 +983,17 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
updateEntry(entry, newEntry)
|
||||
}
|
||||
|
||||
private fun Entry.containsSearchInfo(
|
||||
database: ContextualDatabase,
|
||||
searchInfo: SearchInfo
|
||||
): Boolean {
|
||||
return getEntryInfo(
|
||||
database,
|
||||
raw = true,
|
||||
removeTemplateConfiguration = false
|
||||
).containsSearchInfo(searchInfo)
|
||||
}
|
||||
|
||||
private fun finishNodeAction() {
|
||||
actionNodeMode?.finish()
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ object AppOriginEntryField {
|
||||
/**
|
||||
* Useful to detect if an other KeePass compatibility app already add a web domain or an app id
|
||||
*/
|
||||
private fun EntryInfo.containsDomainOrApplicationId(search: String): Boolean {
|
||||
fun EntryInfo.containsDomainOrApplicationId(search: String): Boolean {
|
||||
if (url.contains(search))
|
||||
return true
|
||||
return customFields.find {
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.kunzisoft.keepass.database.element.Database
|
||||
import com.kunzisoft.keepass.database.element.Field
|
||||
import com.kunzisoft.keepass.database.element.Tags
|
||||
import com.kunzisoft.keepass.database.element.entry.AutoType
|
||||
import com.kunzisoft.keepass.model.AppOriginEntryField.containsDomainOrApplicationId
|
||||
import com.kunzisoft.keepass.model.AppOriginEntryField.setAppOrigin
|
||||
import com.kunzisoft.keepass.model.AppOriginEntryField.setApplicationId
|
||||
import com.kunzisoft.keepass.model.AppOriginEntryField.setWebDomain
|
||||
@@ -183,6 +184,18 @@ class EntryInfo : NodeInfo {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* True if this entry contains domain or applicationId,
|
||||
* OTP is ignored and considered not present
|
||||
*/
|
||||
fun containsSearchInfo(searchInfo: SearchInfo): Boolean {
|
||||
return searchInfo.webDomain?.let { webDomain ->
|
||||
containsDomainOrApplicationId(webDomain)
|
||||
} ?: searchInfo.applicationId?.let { applicationId ->
|
||||
containsDomainOrApplicationId(applicationId)
|
||||
} ?: false
|
||||
}
|
||||
|
||||
/**
|
||||
* Add searchInfo to current EntryInfo
|
||||
*/
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
* Fix multiple Passkey selection #2253
|
||||
* Fix database dialog subtitle #2254
|
||||
* Fix database dialog subtitle #2254
|
||||
* Fix save search info if URL present #2255
|
||||
@@ -1,2 +1,3 @@
|
||||
* Correction de la selection multiple des Passkeys #2253
|
||||
* Correction du sous-titre du dialogue de la base de données #2254
|
||||
* Correction du sous-titre du dialogue de la base de données #2254
|
||||
* Correction de la sauvegarde des infos de recherchesi l'URL est present #2255
|
||||
Reference in New Issue
Block a user