mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Upgrade to version 2.5.0.0beta21 and fix nested groups in v1 #292
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
KeepassDX (2.5.0.0beta20)
|
||||
* Fix nested groups no longer visible in V1 databases
|
||||
|
||||
KeepassDX (2.5.0.0beta20)
|
||||
* Fix a major bug that displays an entry history
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ android {
|
||||
applicationId "com.kunzisoft.keepass"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 27
|
||||
versionCode = 20
|
||||
versionName = "2.5.0.0beta20"
|
||||
versionCode = 21
|
||||
versionName = "2.5.0.0beta21"
|
||||
multiDexEnabled true
|
||||
|
||||
testApplicationId = "com.kunzisoft.keepass.tests"
|
||||
|
||||
@@ -27,7 +27,6 @@ import java.io.InputStream
|
||||
import java.security.DigestOutputStream
|
||||
import java.security.MessageDigest
|
||||
import java.security.NoSuchAlgorithmException
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author Naomaru Itoi <nao></nao>@phoneid.org>
|
||||
@@ -76,50 +75,44 @@ class PwDatabaseV3 : PwDatabase<PwGroupV3, PwEntryV3>() {
|
||||
numKeyEncRounds = DEFAULT_ENCRYPTION_ROUNDS
|
||||
}
|
||||
|
||||
private fun assignGroupsChildren(parent: PwGroupV3) {
|
||||
val levelToCheck = parent.level + 1
|
||||
var startFromParentPosition = false
|
||||
for (groupToCheck in getGroupIndexes()) {
|
||||
rootGroup?.let { root ->
|
||||
if (root.nodeId == parent.nodeId || groupToCheck.nodeId == parent.nodeId) {
|
||||
startFromParentPosition = true
|
||||
}
|
||||
}
|
||||
if (startFromParentPosition) {
|
||||
if (groupToCheck.level < levelToCheck)
|
||||
break
|
||||
else if (groupToCheck.level == levelToCheck)
|
||||
parent.addChildGroup(groupToCheck)
|
||||
}
|
||||
}
|
||||
private fun buildTreeGroups(previousGroup: PwGroupV3, currentGroup: PwGroupV3, groupIterator: Iterator<PwGroupV3>) {
|
||||
|
||||
if (currentGroup.parent == null && (previousGroup.level + 1) == currentGroup.level) {
|
||||
// Current group has an increment level compare to the previous, current group is a child
|
||||
previousGroup.addChildGroup(currentGroup)
|
||||
currentGroup.parent = previousGroup
|
||||
} else if (previousGroup.parent != null && previousGroup.level == currentGroup.level) {
|
||||
// In the same level, previous parent is the same as previous group
|
||||
previousGroup.parent!!.addChildGroup(currentGroup)
|
||||
currentGroup.parent = previousGroup.parent
|
||||
} else if (previousGroup.parent != null) {
|
||||
// Previous group has a higher level than the current group, check it's parent
|
||||
buildTreeGroups(previousGroup.parent!!, currentGroup, groupIterator)
|
||||
}
|
||||
|
||||
private fun assignEntriesChildren(parent: PwGroupV3) {
|
||||
for (entry in getEntryIndexes()) {
|
||||
if (entry.parent!!.nodeId == parent.nodeId)
|
||||
parent.addChildEntry(entry)
|
||||
}
|
||||
}
|
||||
|
||||
private fun constructTreeFromIndex(currentGroup: PwGroupV3) {
|
||||
|
||||
assignGroupsChildren(currentGroup)
|
||||
assignEntriesChildren(currentGroup)
|
||||
|
||||
// set parent in child entries (normally useless but to be sure or to update parent metadata)
|
||||
for (childEntry in currentGroup.getChildEntries()) {
|
||||
childEntry.parent = currentGroup
|
||||
}
|
||||
// recursively construct child groups
|
||||
for (childGroup in currentGroup.getChildGroups()) {
|
||||
childGroup.parent = currentGroup
|
||||
constructTreeFromIndex(childGroup)
|
||||
// Next current group
|
||||
if (groupIterator.hasNext()){
|
||||
buildTreeGroups(currentGroup, groupIterator.next(), groupIterator)
|
||||
}
|
||||
}
|
||||
|
||||
fun constructTreeFromIndex() {
|
||||
rootGroup?.let {
|
||||
constructTreeFromIndex(it)
|
||||
|
||||
// add each group
|
||||
val groupIterator = getGroupIndexes().iterator()
|
||||
if (groupIterator.hasNext())
|
||||
buildTreeGroups(it, groupIterator.next(), groupIterator)
|
||||
|
||||
// add each child
|
||||
for (currentEntry in getEntryIndexes()) {
|
||||
if (currentEntry.parent != null) {
|
||||
// Only the parent id is known so complete the info
|
||||
val parentGroupRetrieve = getGroupById(currentEntry.parent!!.nodeId)
|
||||
parentGroupRetrieve?.addChildEntry(currentEntry)
|
||||
currentEntry.parent = parentGroupRetrieve
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
9
fastlane/metadata/android/en-US/changelogs/21.txt
Normal file
9
fastlane/metadata/android/en-US/changelogs/21.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
* Add lock button always visible
|
||||
* New connection workflow
|
||||
* Code refactored in Kotlin
|
||||
* Better notification implementation
|
||||
* Better views for large screen
|
||||
* Magikeyboard enhancement
|
||||
* Fix Recycle Bin
|
||||
* Fix memory when load database
|
||||
* Fix bugs that displays bad entries and groups (2.5.0.0beta19-20)
|
||||
9
fastlane/metadata/android/fr-FR/changelogs/21.txt
Normal file
9
fastlane/metadata/android/fr-FR/changelogs/21.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
* Ajout du bouton de lock toujours visible
|
||||
* Nouveau workflow de connexion
|
||||
* Code refactorisé en Kotlin
|
||||
* Meilleure implementation des notifications
|
||||
* Meilleures vues pour les écrans larges
|
||||
* Amélioration du Magikeyboard
|
||||
* Correction de la Corbeille
|
||||
* Correction de la mémoire lors du chargement de base de données
|
||||
* Correction de bugs d'affichage des entrée et groupes (2.5.0.0beta19-20)
|
||||
Reference in New Issue
Block a user