mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-11-30 13:52:58 -08:00
Add version
This commit is contained in:
1 parent
ccae0d1a57
commit
0f39409386
2 files changed
+8
-3
No files matched your search
@@ -75,6 +75,8 @@ abstract class TemplateEngine(private val mDatabase: DatabaseKDBX) {
|
||||
return null
|
||||
}
|
||||
|
||||
abstract fun getVersion(): Int
|
||||
|
||||
abstract fun getTemplate(entryKDBX: EntryKDBX): Template?
|
||||
|
||||
abstract fun removeMetaTemplateRecognitionFromEntry(entry: EntryKDBX): EntryKDBX
|
||||
@@ -150,8 +152,7 @@ abstract class TemplateEngine(private val mDatabase: DatabaseKDBX) {
|
||||
}
|
||||
templateSections.add(buildTemplateSectionFromFields(sectionFields))
|
||||
|
||||
// TODO Add decoder version
|
||||
return Template(templateEntry.id, templateEntry.title, templateEntry.icon, templateSections, 1)
|
||||
return Template(templateEntry.id, templateEntry.title, templateEntry.icon, templateSections, getVersion())
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
+5
-1
@@ -10,6 +10,10 @@ import com.kunzisoft.keepass.utils.UuidUtil
|
||||
|
||||
class TemplateEngineCompatible(database: DatabaseKDBX): TemplateEngine(database) {
|
||||
|
||||
override fun getVersion(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
override fun getTemplate(entryKDBX: EntryKDBX): Template? {
|
||||
UuidUtil.fromHexString(entryKDBX.getCustomFieldValue(TEMPLATE_ENTRY_UUID))?.let { templateUUID ->
|
||||
return getTemplateByCache(templateUUID)
|
||||
@@ -71,7 +75,7 @@ class TemplateEngineCompatible(database: DatabaseKDBX): TemplateEngine(database)
|
||||
entryCopy.getFieldValue(TEMPLATE_LABEL_VERSION)
|
||||
try {
|
||||
// value.toIntOrNull()
|
||||
// TODO template decoder version
|
||||
// At the moment, only the version 1 is known
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to retrieve template version", e)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user