Browse Source

fix generator default value.

remove-cryptography-dependency
Herbert Poul 5 years ago
parent
commit
5c00d134c3
  1. 8
      lib/src/kdbx_format.dart
  2. 4
      lib/src/kdbx_meta.dart

8
lib/src/kdbx_format.dart

@ -278,11 +278,15 @@ class KdbxBody extends KdbxNode {
} }
class KdbxFormat { class KdbxFormat {
static KdbxFile create(Credentials credentials, String name) { static KdbxFile create(
Credentials credentials,
String name, {
String generator,
}) {
final header = KdbxHeader.create(); final header = KdbxHeader.create();
final meta = KdbxMeta.create( final meta = KdbxMeta.create(
databaseName: name, databaseName: name,
generator: 'AuthPass', generator: generator,
); );
final rootGroup = KdbxGroup.create(parent: null, name: name); final rootGroup = KdbxGroup.create(parent: null, name: name);
final body = KdbxBody.create(meta, rootGroup); final body = KdbxBody.create(meta, rootGroup);

4
lib/src/kdbx_meta.dart

@ -8,11 +8,11 @@ import 'package:xml/xml.dart' as xml;
class KdbxMeta extends KdbxNode { class KdbxMeta extends KdbxNode {
KdbxMeta.create({ KdbxMeta.create({
@required String databaseName, @required String databaseName,
String generator = 'kdbx.dart', String generator,
}) : customData = KdbxCustomData.create(), }) : customData = KdbxCustomData.create(),
super.create('Meta') { super.create('Meta') {
this.databaseName.set(databaseName); this.databaseName.set(databaseName);
this.generator.set(generator); this.generator.set(generator ?? 'kdbx.dart');
} }
KdbxMeta.read(xml.XmlElement node) KdbxMeta.read(xml.XmlElement node)

Loading…
Cancel
Save