Skip to content

Allow archive recovery with central directory header is missing or damaged #104

@abbeycode

Description

@abbeycode

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 -validateArchive method that returns whether the archive metadata is good or has problems
  • Add a new swift RecoveredArchive class (exposed as UZKRecoveredArchive to 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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions