leanflutter / auto_updater

This plugin allows Flutter desktop apps to automatically update themselves (based on sparkle and winsparkle).
MIT License
285 stars 41 forks source link

sign_update.dart crashes on Flutter 3.10.0 #49

Closed umberto-sonnino closed 1 year ago

umberto-sonnino commented 1 year ago

I'm seeing a crash on the latest Flutter stable - the sign_update binary complains about not being able to modify the arguments list.

Unhandled exception:
Unsupported operation: Cannot add to a fixed-length list
#0      FixedLengthListMixin.add (dart:_internal/list.dart:21:5)
#1      main ([...]/auto_updater-0.1.6/bin/sign_update.dart:21:17)
#2      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:294:33)
#3      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)

A simple patch would be to clone the arguments list instead of adding to it, like so:

  final args = List<String>.from(arguments);

  if (Platform.isWindows) {
    if (args.length == 1) {
      args.add('.\\dsa_priv.pem');
    }
  }

  Process process = await Process.start(
    executable,
    args,
  );

I'd submit a PR but I don't think I have the privileges to push to this repository.

annd22 commented 1 year ago

is there any update for this?

lijy91 commented 1 year ago

Please update to 0.1.7