Wrong Password ZipException when trying unzip archive with password created with PHP
Stafox opened this issue · comments
Describe the bug
Get exception Wrong Password
in case when trying to extract archive with password.
Filesystem Error Error: Failed to unzip file, due to: net.lingala.zip4j.exception.ZipException: Wrong Password
at net.lingala.zip4j.crypto.AESDecrypter.init(AESDecrypter.java:61)
at net.lingala.zip4j.crypto.AESDecrypter.<init>(AESDecrypter.java:49)
at net.lingala.zip4j.io.inputstream.AesCipherInputStream.initializeDecrypter(AesCipherInputStream.java:37)
at net.lingala.zip4j.io.inputstream.AesCipherInputStream.initializeDecrypter(AesCipherInputStream.java:18)
at net.lingala.zip4j.io.inputstream.CipherInputStream.<init>(CipherInputStream.java:25)
at net.lingala.zip4j.io.inputstream.AesCipherInputStream.<init>(AesCipherInputStream.java:32)
at net.lingala.zip4j.io.inputstream.ZipInputStream.initializeCipherInputStream(ZipInputStream.java:196)
at net.lingala.zip4j.io.inputstream.ZipInputStream.initializeEntryInputStream(ZipInputStream.java:186)
at net.lingala.zip4j.io.inputstream.ZipInputStream.getNextEntry(ZipInputStream.java:103)
at net.lingala.zip4j.tasks.AbstractExtractFileTask.verifyNextEntry(AbstractExtractFileTask.java:136)
at net.lingala.zip4j.tasks.AbstractExtractFileTask.extractFile(AbstractExtractFileTask.java:52)
at net.lingala.zip4j.tasks.ExtractFileTask.executeTask(ExtractFileTask.java:39)
at net.lingala.zip4j.tasks.ExtractFileTask.executeTask(ExtractFileTask.java:21)
at net.lingala.zip4j.tasks.AsyncZipTask.performTaskWithErrorHandling(AsyncZipTask.java:46)
at net.lingala.zip4j.tasks.AsyncZipTask.execute(AsyncZipTask.java:40)
at net.lingala.zip4j.ZipFile.extractFile(ZipFile.java:485)
at net.lingala.zip4j.ZipFile.extractFile(ZipFile.java:451)
at com.rnziparchive.RNZipArchiveModule$1.run(RNZipArchiveModule.java:98)
Example of zip can be found there
To Reproduce
Try to extract archive with password and method encryption 256 created in PHP on Android
Expected behavior
A clear and concise description of what you expected to happen.
Env (please complete the following information):
- Device: Redmi Note 7
- OS: Android
- OS Version: 9
- Package Version: 5.0.6 and 5.0.7-beta.3
Additional context
Have created referenced issue in zip4j lib: srikanth-lingala/zip4j#265
Update zip4j version will be required in build.gradle after fix
I just read the discussions on the thread srikanth-lingala/zip4j#265, and it seems like it won't be supported by zip4j. So there is nothing we can do about it, but I would subscribe to the news on this topic.