brendan-duncan / archive

Dart library to encode and decode various archive and compression formats, such as Zip, Tar, GZip, ZLib, and BZip2.
MIT License
399 stars 139 forks source link

ZipDecoder will not run on flutter 3.7.1 #243

Closed fangwy closed 11 months ago

fangwy commented 1 year ago
InputStream _decodeZipCrypto(InputStreamBase input) {
    for (var i = 0; i < 12; ++i) {
      _decodeByte(_rawContent.readByte());
    }

    var bytes = _rawContent.toUint8List();
    for (var i = 0; i < bytes.length; ++i) {
      final temp = bytes[i] ^ _decryptByte();
      _updateKeys(temp);
      bytes[i] = temp;
    }
    return InputStream(bytes);
  }

the bytes

UnsupportedError (Unsupported operation: Cannot modify an unmodifiable list)

chaoyang-zhou commented 1 year ago

problem is also in flutter 3.7.7

chaoyang-zhou commented 1 year ago

I try to modify the code

var bytes = _rawContent.toUint8List().toList();

can pass.

brendan-duncan commented 11 months ago

I cannot reproduce the issue with the latest version of Flutter. I suspect there was a bug in the Dart Uint8List at that time.