diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 1cdc282..f9265b5 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -9,6 +9,7 @@ jobs: os: ['ubuntu-latest', 'windows-2019', 'macos-latest'] dart_channel: ['stable'] + fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -16,6 +17,10 @@ jobs: - uses: cedx/setup-dart@v2 with: release-channel: ${{ matrix.dart_channel }} + - run: | + which dart + codesign --remove-signature $(which dart) + if: startsWith(matrix.os, 'macos') - name: Install dependencies run: pub get - name: Run tests diff --git a/bin/kdbx.dart b/bin/kdbx.dart index aa6a2e3..45a3277 100644 --- a/bin/kdbx.dart +++ b/bin/kdbx.dart @@ -94,6 +94,7 @@ abstract class KdbxFileCommand extends Command { final keyFileData = keyFile == null ? null : await File(keyFile).readAsBytes(); + Argon2FfiFlutter.resolveLibraryForceDynamic = true; final file = await KdbxFormat(Argon2FfiFlutter()).read( bytes, Credentials.composite(ProtectedValue.fromString(password), keyFileData), diff --git a/libargon2_ffi.dylib b/libargon2_ffi.dylib index 7256eda..a0d23bd 100755 Binary files a/libargon2_ffi.dylib and b/libargon2_ffi.dylib differ diff --git a/test/internal/test_utils.dart b/test/internal/test_utils.dart index 3bcd93e..b097e75 100644 --- a/test/internal/test_utils.dart +++ b/test/internal/test_utils.dart @@ -7,12 +7,27 @@ import 'package:kdbx/kdbx.dart'; // ignore_for_file: non_constant_identifier_names +import 'package:logging/logging.dart'; + +final _logger = Logger('test_utils'); + class TestUtil { + static KdbxFormat kdbxFormat() { + Argon2FfiFlutter.resolveLibraryForceDynamic = true; + return KdbxFormat(Argon2FfiFlutter(resolveLibrary: (path) { + final cwd = Directory('.').absolute.uri; + final p = cwd.resolve(path); + final filePath = p.toFilePath(); + _logger.fine('Resolving $path to: $filePath (${Platform.script})'); + return filePath; + })); + } + static Future readKdbxFile( String filePath, { String password = 'asdf', }) async { - final kdbxFormat = KdbxFormat(Argon2FfiFlutter()); + final kdbxFormat = TestUtil.kdbxFormat(); final data = await File(filePath).readAsBytes(); final file = await kdbxFormat.read( data, Credentials(ProtectedValue.fromString(password))); @@ -21,7 +36,7 @@ class TestUtil { static Future readKdbxFileBytes(Uint8List data, {String password = 'asdf'}) async { - final kdbxFormat = KdbxFormat(Argon2FfiFlutter()); + final kdbxFormat = TestUtil.kdbxFormat(); final file = await kdbxFormat.read( data, Credentials(ProtectedValue.fromString(password))); return file; diff --git a/test/kdbx4_test.dart b/test/kdbx4_test.dart index 472ef64..dfa24f1 100644 --- a/test/kdbx4_test.dart +++ b/test/kdbx4_test.dart @@ -16,7 +16,7 @@ final _logger = Logger('kdbx4_test'); void main() { Logger.root.level = Level.ALL; PrintAppender().attachToLogger(Logger.root); - final kdbxFormat = KdbxFormat(Argon2FfiFlutter()); + final kdbxFormat = TestUtil.kdbxFormat(); group('Reading', () { test('bubb', () async { final data = await File('test/keepassxcpasswords.kdbx').readAsBytes();