-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File header and local file header mismatch with unzipWithPassword #238
Comments
I am having the same issue, any fix ? |
I would have give it a try myself but I don't know Java / Android enough. |
I found that the error said ‘Error: Failed to unzip file, due to: net.lingala.zip4j.exception.ZipException: File header and local file header mismatch’,this may be related to the file you are unzipping. Could you share a reproducible file to let me dig into? |
in RNZipArchiveModule.java line 98 |
|
change to if (!fileHeader.isDirectory()) { |
Good job @qiyanlong, just released the 6.0.3 which include this fix |
Describe the bug
I get this call stack when trying to unzip a file with password. I am certain my password is correct. Also the same process works (backup, then restore) if I use zip/unzip (no password).
03-16 16:59:49.238 12922 12957 E ReactNativeJS: RestoreScreen._restoreFromBackup reading file failed: Error: Failed to unzip file, due to: net.lingala.zip4j.exception.ZipException: File header and local file header mismatch
03-16 16:59:49.238 12922 12957 E ReactNativeJS: at net.lingala.zip4j.tasks.AbstractExtractFileTask.verifyNextEntry(AbstractExtractFileTask.java:151)
03-16 16:59:49.238 12922 12957 E ReactNativeJS: at net.lingala.zip4j.tasks.AbstractExtractFileTask.extractFile(AbstractExtractFileTask.java:59)
03-16 16:59:49.238 12922 12957 E ReactNativeJS: at net.lingala.zip4j.tasks.ExtractFileTask.executeTask(ExtractFileTask.java:43)
03-16 16:59:49.238 12922 12957 E ReactNativeJS: at net.lingala.zip4j.tasks.ExtractFileTask.executeTask(ExtractFileTask.java:22)
03-16 16:59:49.238 12922 12957 E ReactNativeJS: at net.lingala.zip4j.tasks.AsyncZipTask.performTaskWithErrorHandling(AsyncZipTask.java:46)
03-16 16:59:49.238 12922 12957 E ReactNativeJS: at net.lingala.zip4j.tasks.AsyncZipTask.execute(AsyncZipTask.java:40)
03-16 16:59:49.238 12922 12957 E ReactNativeJS: at net.lingala.zip4j.ZipFile.extractFile(ZipFile.java:689)
03-16 16:59:49.238 12922 12957 E ReactNativeJS: at net.lingala.zip4j.ZipFile.extractFile(ZipFile.java:489)
03-16 16:59:49.238 12922 12957 E ReactNativeJS: at com.rnziparchive.RNZipArchiveModule$1.run(RNZipArchiveModule.java:98)
03-16 16:59:49.238 12922 12957 E ReactNativeJS: at java.lang.Thread.run(Thread.java:761)
To Reproduce
Expected behavior
I expected to be able to extract my zip file the same way it does without password.
Env (please complete the following information):
Additional context
The resulting encrypted zip file can also be open using Desktop zip program (Ark on kubuntu)
The text was updated successfully, but these errors were encountered: