mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-04-04 05:17:36 +03:00
fix: Upgrade to 3.5.2 and add new default configuration for protected memory
This commit is contained in:
parent
2884d12b4b
commit
3f63fa9c30
7 changed files with 39 additions and 26 deletions
|
@ -1,3 +1,6 @@
|
|||
KeePassDX(3.5.2)
|
||||
* Modification of the internal default configuration of the database
|
||||
|
||||
KeePassDX(3.5.1)
|
||||
* Fix action dialog with YubiKey challenge-response #1506
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@ android {
|
|||
applicationId "com.kunzisoft.keepass"
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 32
|
||||
versionCode = 119
|
||||
versionName = "3.5.1"
|
||||
versionCode = 120
|
||||
versionName = "3.5.2"
|
||||
multiDexEnabled true
|
||||
|
||||
testApplicationId = "com.kunzisoft.keepass.tests"
|
||||
|
|
|
@ -21,28 +21,35 @@ package com.kunzisoft.keepass.database.element.security
|
|||
|
||||
class MemoryProtectionConfig {
|
||||
|
||||
var protectTitle = false
|
||||
var protectUserName = false
|
||||
var protectPassword = false
|
||||
var protectUrl = false
|
||||
var protectNotes = false
|
||||
var protectTitle = DEFAULT_PROTECT_TITLE
|
||||
var protectUserName = DEFAULT_PROTECT_USERNAME
|
||||
var protectPassword = DEFAULT_PROTECT_PASSWORD
|
||||
var protectUrl = DEFAULT_PROTECT_URL
|
||||
var protectNotes = DEFAULT_PROTECT_NOTES
|
||||
|
||||
var autoEnableVisualHiding = false
|
||||
var autoEnableVisualHiding = DEFAULT_AUTO_ENABLE_VISUAL_HIDING
|
||||
|
||||
fun isProtected(field: String): Boolean {
|
||||
if (field.equals(ProtectDefinition.TITLE_FIELD, ignoreCase = true)) return protectTitle
|
||||
if (field.equals(ProtectDefinition.USERNAME_FIELD, ignoreCase = true)) return protectUserName
|
||||
if (field.equals(ProtectDefinition.PASSWORD_FIELD, ignoreCase = true)) return protectPassword
|
||||
if (field.equals(ProtectDefinition.URL_FIELD, ignoreCase = true)) return protectUrl
|
||||
return if (field.equals(ProtectDefinition.NOTES_FIELD, ignoreCase = true)) protectNotes else false
|
||||
|
||||
if (field.equals(TITLE_FIELD, ignoreCase = true)) return protectTitle
|
||||
if (field.equals(USERNAME_FIELD, ignoreCase = true)) return protectUserName
|
||||
if (field.equals(PASSWORD_FIELD, ignoreCase = true)) return protectPassword
|
||||
if (field.equals(URL_FIELD, ignoreCase = true)) return protectUrl
|
||||
if (field.equals(NOTES_FIELD, ignoreCase = true)) return protectNotes
|
||||
return false
|
||||
}
|
||||
|
||||
object ProtectDefinition {
|
||||
companion object ProtectDefinition {
|
||||
const val TITLE_FIELD = "Title"
|
||||
const val USERNAME_FIELD = "UserName"
|
||||
const val PASSWORD_FIELD = "Password"
|
||||
const val URL_FIELD = "URL"
|
||||
const val NOTES_FIELD = "Notes"
|
||||
|
||||
const val DEFAULT_PROTECT_TITLE = false
|
||||
const val DEFAULT_PROTECT_USERNAME = false
|
||||
const val DEFAULT_PROTECT_PASSWORD = true
|
||||
const val DEFAULT_PROTECT_URL = false
|
||||
const val DEFAULT_PROTECT_NOTES = true
|
||||
const val DEFAULT_AUTO_ENABLE_VISUAL_HIDING = false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.kunzisoft.keepass.database.element.group.GroupKDBX
|
|||
import com.kunzisoft.keepass.database.element.icon.IconImageCustom
|
||||
import com.kunzisoft.keepass.database.element.node.NodeIdUUID
|
||||
import com.kunzisoft.keepass.database.element.node.NodeKDBXInterface
|
||||
import com.kunzisoft.keepass.database.element.security.MemoryProtectionConfig
|
||||
import com.kunzisoft.keepass.database.element.security.ProtectedString
|
||||
import com.kunzisoft.keepass.database.exception.*
|
||||
import com.kunzisoft.keepass.database.file.DatabaseHeaderKDBX
|
||||
|
@ -405,17 +406,17 @@ class DatabaseInputKDBX(database: DatabaseKDBX)
|
|||
}
|
||||
|
||||
KdbContext.MemoryProtection -> if (name.equals(DatabaseKDBXXML.ElemProtTitle, ignoreCase = true)) {
|
||||
mDatabase.memoryProtection.protectTitle = readBool(xpp, false)
|
||||
mDatabase.memoryProtection.protectTitle = readBool(xpp, MemoryProtectionConfig.DEFAULT_PROTECT_TITLE)
|
||||
} else if (name.equals(DatabaseKDBXXML.ElemProtUserName, ignoreCase = true)) {
|
||||
mDatabase.memoryProtection.protectUserName = readBool(xpp, false)
|
||||
mDatabase.memoryProtection.protectUserName = readBool(xpp, MemoryProtectionConfig.DEFAULT_PROTECT_USERNAME)
|
||||
} else if (name.equals(DatabaseKDBXXML.ElemProtPassword, ignoreCase = true)) {
|
||||
mDatabase.memoryProtection.protectPassword = readBool(xpp, false)
|
||||
mDatabase.memoryProtection.protectPassword = readBool(xpp, MemoryProtectionConfig.DEFAULT_PROTECT_PASSWORD)
|
||||
} else if (name.equals(DatabaseKDBXXML.ElemProtURL, ignoreCase = true)) {
|
||||
mDatabase.memoryProtection.protectUrl = readBool(xpp, false)
|
||||
mDatabase.memoryProtection.protectUrl = readBool(xpp, MemoryProtectionConfig.DEFAULT_PROTECT_URL)
|
||||
} else if (name.equals(DatabaseKDBXXML.ElemProtNotes, ignoreCase = true)) {
|
||||
mDatabase.memoryProtection.protectNotes = readBool(xpp, false)
|
||||
mDatabase.memoryProtection.protectNotes = readBool(xpp, MemoryProtectionConfig.DEFAULT_PROTECT_NOTES)
|
||||
} else if (name.equals(DatabaseKDBXXML.ElemProtAutoHide, ignoreCase = true)) {
|
||||
mDatabase.memoryProtection.autoEnableVisualHiding = readBool(xpp, false)
|
||||
mDatabase.memoryProtection.autoEnableVisualHiding = readBool(xpp, MemoryProtectionConfig.DEFAULT_AUTO_ENABLE_VISUAL_HIDING)
|
||||
} else {
|
||||
readUnknown(xpp)
|
||||
}
|
||||
|
|
|
@ -551,11 +551,11 @@ class DatabaseOutputKDBX(private val mDatabaseKDBX: DatabaseKDBX)
|
|||
var protect = value.isProtected
|
||||
|
||||
when (label) {
|
||||
MemoryProtectionConfig.ProtectDefinition.TITLE_FIELD -> protect = mDatabaseKDBX.memoryProtection.protectTitle
|
||||
MemoryProtectionConfig.ProtectDefinition.USERNAME_FIELD -> protect = mDatabaseKDBX.memoryProtection.protectUserName
|
||||
MemoryProtectionConfig.ProtectDefinition.PASSWORD_FIELD -> protect = mDatabaseKDBX.memoryProtection.protectPassword
|
||||
MemoryProtectionConfig.ProtectDefinition.URL_FIELD -> protect = mDatabaseKDBX.memoryProtection.protectUrl
|
||||
MemoryProtectionConfig.ProtectDefinition.NOTES_FIELD -> protect = mDatabaseKDBX.memoryProtection.protectNotes
|
||||
MemoryProtectionConfig.TITLE_FIELD -> protect = mDatabaseKDBX.memoryProtection.protectTitle
|
||||
MemoryProtectionConfig.USERNAME_FIELD -> protect = mDatabaseKDBX.memoryProtection.protectUserName
|
||||
MemoryProtectionConfig.PASSWORD_FIELD -> protect = mDatabaseKDBX.memoryProtection.protectPassword
|
||||
MemoryProtectionConfig.URL_FIELD -> protect = mDatabaseKDBX.memoryProtection.protectUrl
|
||||
MemoryProtectionConfig.NOTES_FIELD -> protect = mDatabaseKDBX.memoryProtection.protectNotes
|
||||
}
|
||||
|
||||
if (protect) {
|
||||
|
|
1
fastlane/metadata/android/en-US/changelogs/120.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/120.txt
Normal file
|
@ -0,0 +1 @@
|
|||
* Modification of the internal default configuration of the database
|
1
fastlane/metadata/android/fr-FR/changelogs/120.txt
Normal file
1
fastlane/metadata/android/fr-FR/changelogs/120.txt
Normal file
|
@ -0,0 +1 @@
|
|||
* Modification de la configuration interne par défaut de la base de données
|
Loading…
Add table
Add a link
Reference in a new issue