androidc++qtzipquazip

QT QuaZip open() fail -1000


I am trying to uncompress a Zip file. Using the latest Qt 5.15 on an Android device.

QFile downloadedZipFile(VALID_ZIP_LOCATION);
QuaZip zip(&downloadedZipFile);
if (!zip.open(QuaZip::mdUnzip)) {
    qDebug() << "error" << zip.getZipError();
}

If my file is above 2GB it am getting an error -1000. Files below 2GB are working as expected.

I tried

zip.setZip64Enabled(true);

before opening the file without success. I also tried to use the constructor

QuaZip zip(VALID_ZIP_LOCATION)

Upon accessing the zip later I also get the following error:

QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode

which makes sense, as it couldn't open the file in the first place.

Any help is appreciated, as I am struggling with this Problem for a few days already.


Solution

  • The problem is an unresolved QT-Bug. Where QFile::seek cannot exceed a limit above a 32Bit Integer. https://bugreports.qt.io/browse/QTBUG-84033

    After identifying the problem I could resolve this issue by implementing native code for unzipping files in java for android. Since iPhones are only running on 64Bit systems the native implementation did not need to be ported to ObjC.