Oleksii Khomchenko created COMPRESS-562:
-------------------------------------------

             Summary: ZipArchiveInputStream fails with unexpected record 
signature while ZipInputStream from java.util.zip succeeds
                 Key: COMPRESS-562
                 URL: https://issues.apache.org/jira/browse/COMPRESS-562
             Project: Commons Compress
          Issue Type: Bug
          Components: Archivers
    Affects Versions: 1.20
         Environment: Zip 3.0 (July 5th 2008), by Info-ZIP, Compiled with gcc 
4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14) for Unix (Mac OS X) on 
Feb 22 2019.

osx 10.14.6, AdoptOpenJDK 11.0.7
            Reporter: Oleksii Khomchenko


Thank you a lot for the library.

 

I recently encountered next issue:
{code:java}
Exception in thread "main" java.util.zip.ZipException: Unexpected record 
signature: 0X0
{code}
is thrown when reading test-services-1.1.0.apk from 
[https://maven.google.com/web/index.html?q=test-ser#androidx.test.services:test-services:1.1.0]
 via commons-compress:1.20 while java.util.zip reads it without the exception.

 
{code:java}
public class UnzipTestServicesSample {
    public static void main(String[] args) throws Exception {
        Path p = Paths.get("test-services-1.1.0.apk");

        System.out.println("\n=== java std zip ===\n");

        try (InputStream is = Files.newInputStream(p); ZipInputStream zis = new 
ZipInputStream(is)) {
            ZipEntry entry;

            while ((entry = zis.getNextEntry()) != null) {
                System.out.println("entry: " + entry.getName());
            }
        }

        System.out.println("\n=== apache compress zip ===\n");

        try (InputStream is = Files.newInputStream(p); ArchiveInputStream ais = 
new ZipArchiveInputStream(is)) {
            ArchiveEntry entry;

            while ((entry = ais.getNextEntry()) != null) {
                System.out.println("entry: " + entry.getName());
            }
        }
    }
}{code}
 

zip -T says that archive is fine:

 
{code:java}
$ zip -T test-services-1.1.0.apk 
test of test-services-1.1.0.apk OK{code}
 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to