On my android device, I need to extract a file (an xapk, that is a plain zip archive as far as I know) that I get from a content uri. I'm creating the ZipInputStream using this line of code:
ZipInputStream zis = new ZipInputStream(getContentResolver().openInputStream(zipUri));
And then I try to read the first entry of the archive with:
ZipEntry entry = zis.getNextEntry()
The problem is that I get this exception:
java.util.zip.ZipException: only DEFLATED entries can have EXT descriptor
I'm 100% sure that there is no 0bytes files in the archive, and I can extract the same archive with other utilities (RAR, unzip etc) in my device.
If I use a ZipFile with an hard coded path (so no content uri involved), I can extract the same archive without problems, so the issue is related to ZipInputStream with an uri. On the other hand, I can't use a ZipFile here because it doesn't support content uris.