diff --git a/CHANGELOG.md b/CHANGELOG.md index a09dbc3..46d1aee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.4.1 + +- Update dependencies. + ## 2.4.0 - Migrate to latest dart version. diff --git a/bin/kdbx.dart b/bin/kdbx.dart index ed8afe5..8bb2885 100644 --- a/bin/kdbx.dart +++ b/bin/kdbx.dart @@ -33,8 +33,7 @@ void main(List arguments) { } class KdbxCommandRunner extends CommandRunner { - KdbxCommandRunner(String executableName, String description) - : super(executableName, description) { + KdbxCommandRunner(super.executableName, super.description) { argParser.addFlag('verbose', abbr: 'v'); addCommand(CatCommand()); addCommand(DumpXmlCommand()); diff --git a/example/pubspec.lock b/example/pubspec.lock index e9e5e72..277f115 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,82 +5,98 @@ packages: dependency: transitive description: name: archive - sha256: a92e39b291073bb840a72cf43d96d2a63c74e9a485d227833e8ea0054d16ad16 + sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.4.10" argon2_ffi_base: dependency: transitive description: name: argon2_ffi_base - sha256: afb48b48cb418fe632863983a54c231c097f495129d3fc9d758d17d209663977 + sha256: "6e8dcdd6cf7f31287a7f7c9ab1db349b3b0ff8f87866dbb1c2582140f79d60aa" url: "https://pub.dev" source: hosted - version: "1.1.0+1" + version: "1.1.1" args: dependency: transitive description: name: args - sha256: "3d82ff8620ec576fd38f6cec0df45a7c088b8704eb1c63d4c336392e5efca6ca" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 url: "https://pub.dev" source: hosted - version: "2.2.0" - charcode: + version: "2.4.2" + async: dependency: transitive description: - name: charcode - sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" clock: dependency: transitive description: name: clock - sha256: "6021e0172ab6e6eaa1d391afed0a99353921f00c54385c574dc53e55d67c092c" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - sha256: "6d4193120997ecfd09acf0e313f13dc122b119e5eca87ef57a7d065ec9183762" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.18.0" convert: dependency: transitive description: name: convert - sha256: f08428ad63615f96a27e34221c65e1a451439b5f26030f78d790f461c686d65d + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.1" crypto: dependency: transitive description: name: crypto - sha256: cf75650c66c0316274e21d7c43d3dea246273af5955bd94e8184837cd577575c + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.3" dio: dependency: transitive description: name: dio - sha256: bf173c8bc66b776e3c2892b6ac56ac1a5ad73d21dd06d337f9fe656f63612947 + sha256: "797e1e341c3dd2f69f2dad42564a6feff3bfb87187d05abb93b9609e6f1645c3" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "5.4.0" ffi: dependency: transitive description: name: ffi - sha256: "35d0f481d939de0d640b3db9a7aa36a52cd22054a798a73b4f50bdad5ce12678" + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "2.1.0" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" flutter_lints: dependency: "direct dev" description: @@ -93,18 +109,18 @@ packages: dependency: transitive description: name: http_parser - sha256: e362d639ba3bc07d5a71faebb98cde68c05bfbcfbbb444b60b6f60bb67719185 + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.2" intl: dependency: transitive description: name: intl - sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.19.0" isolates: dependency: transitive description: @@ -117,17 +133,17 @@ packages: dependency: transitive description: name: js - sha256: d9bdfd70d828eeb352390f81b18d6a354ef2044aa28ef25682079797fa7cd174 + sha256: "4186c61b32f99e60f011f7160e32c89a758ae9b1d0c6d28e2c02ef0382300e2b" url: "https://pub.dev" source: hosted - version: "0.6.3" + version: "0.7.0" kdbx: dependency: "direct main" description: path: ".." relative: true source: path - version: "2.3.0" + version: "2.4.0" lints: dependency: transitive description: @@ -140,137 +156,161 @@ packages: dependency: transitive description: name: logging - sha256: "0520a4826042a8a5d09ddd4755623a50d37ee536d79a70452aff8c8ad7bb6c27" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.2.0" logging_appenders: dependency: transitive description: name: logging_appenders - sha256: "013e8548b79e3b8dc0333f3efae706184356b5926c6bea59150efa126c91598c" + sha256: "1fb8a008c04246f4677a0d034d69779a5975e56e02573a5162240239b247e239" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.2.0+1" matcher: dependency: transitive description: name: matcher - sha256: "2e2c34e631f93410daa3ee3410250eadc77ac6befc02a040eda8a123f34e6f5a" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.16+1" meta: dependency: transitive description: name: meta - sha256: "5202fdd37b4da5fd14a237ed0a01cad6c1efd4c99b5b5a0d3c9237f3728c9485" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.11.0" path: dependency: transitive description: name: path - sha256: "2ad4cddff7f5cc0e2d13069f2a3f7a73ca18f66abd6f5ecf215219cdb3638edb" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.0" petitparser: dependency: transitive description: name: petitparser - sha256: "3abc4a0f06dccb2348ebdab9f5b9cc88bb64bfc830bed6351040ca42722044a6" + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "6.0.2" pointycastle: dependency: transitive description: name: pointycastle - sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" + sha256: "43ac87de6e10afabc85c445745a7b799e04de84cebaa4fd7bf55a5e1e9604d29" url: "https://pub.dev" source: hosted - version: "3.7.3" + version: "3.7.4" quiver: dependency: transitive description: name: quiver - sha256: "5e592c348a6c528fb8deb7cc7d85a7097ce65bf2349121ad004d1fc5d5905eaa" + sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47 url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.2.1" source_span: dependency: transitive description: name: source_span - sha256: d5f89a9e52b36240a80282b3dc0667dd36e53459717bb17b8fb102d30496606a + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: f8d9f247e2f9f90e32d1495ff32dac7e4ae34ffa7194c5ff8fcc0fd0e52df774 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - sha256: dd11571b8a03f7cadcf91ec26a77e02bfbd6bbba2a512924d3116646b4198fc4 + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" supercharged_dart: dependency: transitive description: name: supercharged_dart - sha256: "9d6d4fa1736d07f0506ce2713e5f9815b20bcd741c0d53e9b56c265458c3ce05" + sha256: cb95edda32eacd27664089700a750120be41daa84aa6cd2aeded46227c16b867 url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.1" synchronized: dependency: transitive description: name: synchronized - sha256: "271977ff1e9e82ceefb4f08424b8839f577c1852e0726b5ce855311b46d3ef83" + sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.0+1" term_glyph: dependency: transitive description: name: term_glyph - sha256: a88162591b02c1f3a3db3af8ce1ea2b374bd75a7bb8d5e353bcfbdc79d719830 + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + url: "https://pub.dev" + source: hosted + version: "0.7.0" typed_data: dependency: transitive description: name: typed_data - sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.2" uuid: dependency: transitive description: name: uuid - sha256: "0ea20bfc625477e17f08a92d112272a071609b275ce4ca10ad853e1426ca3758" + sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8 url: "https://pub.dev" source: hosted - version: "3.0.4" + version: "4.3.3" xml: dependency: transitive description: name: xml - sha256: "925e1d7923773fef2f90c5c9ad0f496630f63e03f974a0aaa5fb50c60640c570" + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 url: "https://pub.dev" source: hosted - version: "5.2.0" + version: "6.5.0" sdks: - dart: ">=2.14.0 <4.0.0" + dart: ">=3.2.0 <4.0.0" diff --git a/lib/src/credentials/keyfile.dart b/lib/src/credentials/keyfile.dart index ab9a234..ca55327 100644 --- a/lib/src/credentials/keyfile.dart +++ b/lib/src/credentials/keyfile.dart @@ -87,7 +87,7 @@ class KeyFileCredentials implements CredentialsPart { /// Generates a `.keyx` file as described for Keepass keyfile: /// https://keepass.info/help/base/keys.html#keyfiles Uint8List toXmlV2() { - return utf8.encode(toXmlV2String()) as Uint8List; + return utf8.encode(toXmlV2String()); } /// Generates a `.keyx` file as described for Keepass keyfile: diff --git a/lib/src/crypto/protected_salt_generator.dart b/lib/src/crypto/protected_salt_generator.dart index 36aa785..2c726e0 100644 --- a/lib/src/crypto/protected_salt_generator.dart +++ b/lib/src/crypto/protected_salt_generator.dart @@ -36,7 +36,7 @@ class ProtectedSaltGenerator { } String encryptToBase64(String plainValue) { - final encrypted = _cipher.process(utf8.encode(plainValue) as Uint8List); + final encrypted = _cipher.process(utf8.encode(plainValue)); return base64.encode(encrypted); } } @@ -83,7 +83,7 @@ class ChachaProtectedSaltGenerator implements ProtectedSaltGenerator { @override String encryptToBase64(String plainValue) { - final input = utf8.encode(plainValue) as Uint8List; + final input = utf8.encode(plainValue); final encrypted = _state.process(input); return base64.encode(encrypted); } diff --git a/lib/src/crypto/protected_value.dart b/lib/src/crypto/protected_value.dart index 4a97cc0..d86d8a6 100644 --- a/lib/src/crypto/protected_value.dart +++ b/lib/src/crypto/protected_value.dart @@ -35,7 +35,7 @@ class ProtectedValue implements StringValue { ProtectedValue(this._value, this._salt); factory ProtectedValue.fromString(String value) { - final valueBytes = utf8.encode(value) as Uint8List; + final valueBytes = utf8.encode(value); final salt = _randomBytes(valueBytes.length); return ProtectedValue(_xor(valueBytes, salt), salt); diff --git a/lib/src/kdbx_custom_data.dart b/lib/src/kdbx_custom_data.dart index c319136..955df4b 100644 --- a/lib/src/kdbx_custom_data.dart +++ b/lib/src/kdbx_custom_data.dart @@ -8,14 +8,14 @@ class KdbxCustomData extends KdbxNode { : _data = {}, super.create(TAG_NAME); - KdbxCustomData.read(xml.XmlElement node) + KdbxCustomData.read(super.node) : _data = Map.fromEntries( node.findElements(KdbxXml.NODE_CUSTOM_DATA_ITEM).map((el) { final key = el.singleTextNode(KdbxXml.NODE_KEY); final value = el.singleTextNode(KdbxXml.NODE_VALUE); return MapEntry(key, value); })), - super.read(node); + super.read(); static const String TAG_NAME = KdbxXml.NODE_CUSTOM_DATA; diff --git a/lib/src/kdbx_deleted_object.dart b/lib/src/kdbx_deleted_object.dart index ade4df0..0fc1d69 100644 --- a/lib/src/kdbx_deleted_object.dart +++ b/lib/src/kdbx_deleted_object.dart @@ -2,7 +2,6 @@ import 'package:clock/clock.dart'; import 'package:kdbx/src/kdbx_format.dart'; import 'package:kdbx/src/kdbx_object.dart'; import 'package:kdbx/src/kdbx_xml.dart'; -import 'package:xml/xml.dart'; class KdbxDeletedObject extends KdbxNode implements KdbxNodeContext { KdbxDeletedObject.create(this.ctx, KdbxUuid? uuid, [DateTime? now]) @@ -11,7 +10,7 @@ class KdbxDeletedObject extends KdbxNode implements KdbxNodeContext { deletionTime.set(now ?? clock.now().toUtc()); } - KdbxDeletedObject.read(XmlElement node, this.ctx) : super.read(node); + KdbxDeletedObject.read(super.node, this.ctx) : super.read(); static const NODE_NAME = KdbxXml.NODE_DELETED_OBJECT; diff --git a/lib/src/kdbx_entry.dart b/lib/src/kdbx_entry.dart index d1e5783..afe5c18 100644 --- a/lib/src/kdbx_entry.dart +++ b/lib/src/kdbx_entry.dart @@ -89,7 +89,7 @@ extension KdbxEntryInternal on KdbxEntry { includeHistory: !toHistoryEntry, ); - List get _overwriteNodes => [ + List> get _overwriteNodes => [ ...objectNodes, foregroundColor, backgroundColor, diff --git a/lib/src/kdbx_format.dart b/lib/src/kdbx_format.dart index 044cba2..ef77016 100644 --- a/lib/src/kdbx_format.dart +++ b/lib/src/kdbx_format.dart @@ -121,10 +121,10 @@ class KdbxBody extends KdbxNode { } KdbxBody.read( - xml.XmlElement node, + super.node, this.meta, this.rootGroup, - ) : super.read(node); + ) : super.read(); // final xml.XmlDocument xmlDocument; final KdbxMeta meta; @@ -138,8 +138,8 @@ class KdbxBody extends KdbxNode { final xml = generateXml(saltGenerator); final xmlBytes = utf8.encode(xml.toXmlString()); final compressedBytes = (kdbxFile.header.compression == Compression.gzip - ? KdbxFormat._gzipEncode(xmlBytes as Uint8List) - : xmlBytes) as Uint8List?; + ? KdbxFormat._gzipEncode(xmlBytes) + : xmlBytes); final encrypted = await _encryptV3(kdbxFile, compressedBytes); writer.writeBytes(encrypted); @@ -151,7 +151,7 @@ class KdbxBody extends KdbxNode { final xml = generateXml(saltGenerator); kdbxFile.header.innerHeader.updateBinaries(kdbxFile.ctx.binariesIterable); kdbxFile.header.writeInnerHeader(bodyWriter); - bodyWriter.writeBytes(utf8.encode(xml.toXmlString()) as Uint8List); + bodyWriter.writeBytes(utf8.encode(xml.toXmlString())); final compressedBytes = (kdbxFile.header.compression == Compression.gzip ? KdbxFormat._gzipEncode(bodyWriter.output.toBytes()) : bodyWriter.output.toBytes()); diff --git a/lib/src/kdbx_group.dart b/lib/src/kdbx_group.dart index 90e67f1..9fb9d84 100644 --- a/lib/src/kdbx_group.dart +++ b/lib/src/kdbx_group.dart @@ -172,7 +172,7 @@ class KdbxGroup extends KdbxObject { } } - List get _overwriteNodes => [ + List> get _overwriteNodes => [ ...objectNodes, name, notes, diff --git a/lib/src/kdbx_meta.dart b/lib/src/kdbx_meta.dart index e314adb..1d74263 100644 --- a/lib/src/kdbx_meta.dart +++ b/lib/src/kdbx_meta.dart @@ -37,7 +37,7 @@ class KdbxMeta extends KdbxNode implements KdbxNodeContext { historyMaxSize.set(Consts.DefaultHistoryMaxSize); } - KdbxMeta.read(xml.XmlElement node, this.ctx) + KdbxMeta.read(super.node, this.ctx) : customData = node .singleElement(KdbxXml.NODE_CUSTOM_DATA) ?.let((e) => KdbxCustomData.read(e)) ?? @@ -79,7 +79,7 @@ class KdbxMeta extends KdbxNode implements KdbxNodeContext { .map((e) => MapEntry(e.uuid, e)) .let((that) => Map.fromEntries(that)) ?? {}, - super.read(node); + super.read(); @override final KdbxReadWriteContext ctx; diff --git a/lib/src/kdbx_object.dart b/lib/src/kdbx_object.dart index 2e98a8a..2e9f931 100644 --- a/lib/src/kdbx_object.dart +++ b/lib/src/kdbx_object.dart @@ -14,8 +14,9 @@ import 'package:kdbx/src/utils/sequence.dart'; import 'package:logging/logging.dart'; import 'package:meta/meta.dart'; import 'package:quiver/iterables.dart'; +import 'package:uuid/data.dart'; +import 'package:uuid/rng.dart'; import 'package:uuid/uuid.dart'; -import 'package:uuid/uuid_util.dart'; import 'package:xml/xml.dart'; // ignore: unused_element @@ -132,7 +133,7 @@ extension IterableKdbxObject on Iterable { } extension KdbxObjectInternal on KdbxObject { - List get objectNodes => [ + List> get objectNodes => [ icon, customIconUuid, ]; @@ -150,8 +151,10 @@ extension KdbxObjectInternal on KdbxObject { } } - void overwriteSubNodesFrom(OverwriteContext overwriteContext, - List myNodes, List otherNodes) { + void overwriteSubNodesFrom( + OverwriteContext overwriteContext, + List> myNodes, + List> otherNodes) { for (final node in zip([myNodes, otherNodes])) { final me = node[0]; final other = node[1]; @@ -284,8 +287,7 @@ class KdbxUuid { /// 128 bits set to zero. static const NIL = KdbxUuid('AAAAAAAAAAAAAAAAAAAAAA=='); - static const Uuid uuidGenerator = - Uuid(options: {'grng': UuidUtil.cryptoRNG}); + static final Uuid uuidGenerator = Uuid(goptions: GlobalOptions(CryptoRNG())); /// base64 representation of uuid. final String uuid; diff --git a/lib/src/kdbx_times.dart b/lib/src/kdbx_times.dart index 094821a..ba1bf13 100644 --- a/lib/src/kdbx_times.dart +++ b/lib/src/kdbx_times.dart @@ -4,7 +4,6 @@ import 'package:kdbx/src/kdbx_object.dart'; import 'package:kdbx/src/kdbx_xml.dart'; import 'package:logging/logging.dart'; import 'package:quiver/iterables.dart'; -import 'package:xml/xml.dart'; final _logger = Logger('kdbx_times'); @@ -19,7 +18,7 @@ class KdbxTimes extends KdbxNode implements KdbxNodeContext { usageCount.set(0); locationChanged.set(now); } - KdbxTimes.read(XmlElement node, this.ctx) : super.read(node) { + KdbxTimes.read(super.node, this.ctx) : super.read() { // backward compatibility - there was a bug setting/reading // modification, lastAccess and expiryTime. Make sure they are defined. final checkDates = { @@ -61,7 +60,7 @@ class KdbxTimes extends KdbxNode implements KdbxNodeContext { lastModificationTime.set(clock.now().toUtc()); } - List get _nodes => [ + List> get _nodes => [ creationTime, lastModificationTime, lastAccessTime, diff --git a/lib/src/kdbx_var_dictionary.dart b/lib/src/kdbx_var_dictionary.dart index ee8724c..55d3eaa 100644 --- a/lib/src/kdbx_var_dictionary.dart +++ b/lib/src/kdbx_var_dictionary.dart @@ -56,7 +56,7 @@ class ValueType { (writer, value) => writer.writeBytes(value, writer._lengthWriter()), ); - static ValueType typeByCode(int code) => + static ValueType typeByCode(int code) => values.firstWhere((t) => t.code == code); static final values = [ @@ -92,7 +92,7 @@ class VarDictionary { _dict = Map.fromEntries(items.map((item) => MapEntry(item._key, item))); factory VarDictionary.read(ReaderHelper reader) { - final items = []; + final items = >[]; final versionMinor = reader.readUint8(); final versionMajor = reader.readUint8(); _logger.finest('Reading VarDictionary $versionMajor.$versionMinor'); diff --git a/lib/src/kdbx_xml.dart b/lib/src/kdbx_xml.dart index 1ee2a7c..7164d98 100644 --- a/lib/src/kdbx_xml.dart +++ b/lib/src/kdbx_xml.dart @@ -83,7 +83,7 @@ extension on List { } abstract class KdbxSubTextNode extends KdbxSubNode { - KdbxSubTextNode(KdbxNode node, String name) : super(node, name); + KdbxSubTextNode(super.node, super.name); void Function()? _onModify; @@ -142,7 +142,7 @@ abstract class KdbxSubTextNode extends KdbxSubNode { } class IntNode extends KdbxSubTextNode { - IntNode(KdbxNode node, String name) : super(node, name); + IntNode(super.node, super.name); @override int? decode(String value) => int.tryParse(value); @@ -152,7 +152,7 @@ class IntNode extends KdbxSubTextNode { } class StringNode extends KdbxSubTextNode { - StringNode(KdbxNode node, String name) : super(node, name); + StringNode(super.node, super.name); @override String decode(String value) => value; @@ -162,7 +162,7 @@ class StringNode extends KdbxSubTextNode { } class Base64Node extends KdbxSubTextNode { - Base64Node(KdbxNode node, String name) : super(node, name); + Base64Node(super.node, super.name); @override ByteBuffer decode(String value) => base64.decode(value).buffer; @@ -172,7 +172,7 @@ class Base64Node extends KdbxSubTextNode { } class UuidNode extends KdbxSubTextNode { - UuidNode(KdbxNode node, String name) : super(node, name); + UuidNode(super.node, super.name); @override KdbxUuid decode(String value) => KdbxUuid(value); @@ -182,7 +182,7 @@ class UuidNode extends KdbxSubTextNode { } class IconNode extends KdbxSubTextNode { - IconNode(KdbxNode node, String name) : super(node, name); + IconNode(super.node, super.name); @override KdbxIcon decode(String value) => KdbxIcon.values[int.tryParse(value)!]; @@ -206,7 +206,7 @@ class KdbxColor { } class ColorNode extends KdbxSubTextNode { - ColorNode(KdbxNode node, String name) : super(node, name); + ColorNode(super.node, super.name); @override KdbxColor decode(String value) => KdbxColor.parse(value); @@ -216,7 +216,7 @@ class ColorNode extends KdbxSubTextNode { } class BooleanNode extends KdbxSubTextNode { - BooleanNode(KdbxNode node, String name) : super(node, name); + BooleanNode(super.node, super.name); @override bool? decode(String value) { @@ -236,7 +236,7 @@ class BooleanNode extends KdbxSubTextNode { } class DateTimeUtcNode extends KdbxSubTextNode { - DateTimeUtcNode(KdbxNodeContext node, String name) : super(node, name); + DateTimeUtcNode(KdbxNodeContext super.node, super.name); static const EpochSeconds = 62135596800; diff --git a/lib/src/utils/byte_utils.dart b/lib/src/utils/byte_utils.dart index 6937c04..74d8dfb 100644 --- a/lib/src/utils/byte_utils.dart +++ b/lib/src/utils/byte_utils.dart @@ -105,7 +105,7 @@ class ReaderHelper { } class ReaderHelperDartWeb extends ReaderHelper { - ReaderHelperDartWeb(Uint8List byteData) : super._(byteData); + ReaderHelperDartWeb(super.byteData) : super._(); @override int readUint64() { @@ -184,7 +184,7 @@ class WriterHelper { } class WriterHelperDartWeb extends WriterHelper { - WriterHelperDartWeb([BytesBuilder? output]) : super._(output); + WriterHelperDartWeb([super.output]) : super._(); @override void writeUint64(int value, [LengthWriter? lengthWriter]) { diff --git a/pubspec.yaml b/pubspec.yaml index 23eff22..b5271da 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,10 +1,10 @@ name: kdbx description: KeepassX format implementation in pure dart. (kdbx 3.x and 4.x support). -version: 2.4.0 +version: 2.4.1 homepage: https://github.com/authpass/kdbx.dart environment: - sdk: '>=2.12.0 <4.0.0' + sdk: '>=3.2.0 <4.0.0' dependencies: logging: '>=0.11.3+2 <2.0.0' @@ -30,6 +30,6 @@ dependencies: argon2_ffi_base: ^1.1.0+1 dev_dependencies: - flutter_lints: '>=2.0.0 <3.0.0' + flutter_lints: '>=2.0.0 <4.0.0' test: '>=1.6.0 <2.0.0' fake_async: ^1.2.0 diff --git a/test/kdbx_binaries_test.dart b/test/kdbx_binaries_test.dart index 1909c2f..1ddc54b 100644 --- a/test/kdbx_binaries_test.dart +++ b/test/kdbx_binaries_test.dart @@ -22,13 +22,9 @@ Future _testAddNewAttachment(String filePath) async { f.body.rootGroup.addEntry(entry); expect(entry.binaryEntries, hasLength(0)); entry.createBinary( - isProtected: false, - name: 'test.txt', - bytes: utf8.encode('Content1') as Uint8List); + isProtected: false, name: 'test.txt', bytes: utf8.encode('Content1')); entry.createBinary( - isProtected: false, - name: 'test.txt', - bytes: utf8.encode('Content2') as Uint8List); + isProtected: false, name: 'test.txt', bytes: utf8.encode('Content2')); return await f.save(); })(); {