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

Use [zip -q -r -D -m -P xxx] command to encrypt the zip package, which cannot be decrypted #250

Closed chaoyang-zhou closed 1 year ago

chaoyang-zhou commented 1 year ago

archive version: 3.3.6 flutter version 3.7.7

void unzipWith(Uint8List bytes) async {
    var archive = ZipDecoder().decodeBytes(bytes, password: "xxx");
    for (var file in archive) {
      if (file.isFile) {
        if (file.name == "config.ini") {
          // file.content always [], empty list
          var data = file.content as List<int>;
          String content = utf8.decode(data);
          Log.i(content);
        }
      }
    }
  }