-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
Description
When an archive's central directory header is corrupted (see this file for an example), you can still search through the archive for local file headers, which is a lot slower than using the central directory header.
- Add a new
-validateArchivemethod that returns whether the archive metadata is good or has problems - Add a new swift
RecoveredArchiveclass (exposed asUZKRecoveredArchiveto Objective-C) that can be instantiated to read archives with damaged central headers (whose documentation would note it won't be as fast as regular archive reading), with these limited capabilities:- The constructor fails if it can't find the first local file header, which should start at the beginning of the file
- Exporting a reconstructed archive with available file headers
- Listing available file info
- Iterating through the recoverable file data
- Iterating through the recoverable file data with a buffer
The RecoveredArchive class would build its own file info mapping on initialization to make further operations faster. File data would still be returned with UZKFileInfo, if possible. If not, create a new RecoveredFileInfo class. Use MiniZip where it makes sense, but do everything outside MiniZip that's necessary. The ZIP spec will be essential to this task.