This repository was archived by the owner on Jun 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug where directories inside rewritten jars had incorrect lengths
Previously, when patching certain jars the length calculations were slightly off due to our usage of CreateRaw to create zip headers to represent empty directories. These slight errors don't seem to actually break the jars from java's perspective, java still opens them fine. But Finder on MacOS complains that they are invalid if someone tries to open them as a zip. Inspecting them with `zipinfo -v` shows a number of warnings along the lines of "There are an extra -2 bytes preceding this file". This PR fixes this by using CreateHeader instead of CreateRaw. I also added tests to ensure that this corruption doesn't happen again.
- Loading branch information
Showing
3 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.