brendan-duncan/archive

ZipDecoder will not run on flutter 3.7.1

Closed this issue · 3 comments

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)

problem is also in flutter 3.7.7

I try to modify the code

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

can pass.

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