Skip to content

ZipArchive::new(f) returns InvalidArchive("Extra field header truncated") for a valid ZIP archive #681

@Mrakorez

Description

@Mrakorez

Describe the bug

ZipArchive::new(f) returns InvalidArchive("Extra field header truncated") for a ZIP archive that unzip and Android runtime handle successfully.

To Reproduce

  1. Download an APK from APKMirror

  2. Rename it for convenience:

    mv 'bin.mt.plus_2.26.2-26020493_minAPI21(arm64-v8a,armeabi-v7a,x86,x86_64)(nodpi)_apkmirror.com.apk' bin.mt.plus_2.26.2.apk
  3. Verify it is a valid ZIP:

    unzip -l bin.mt.plus_2.26.2.apk | tail -5
  4. Run the following code:

    let f = File::open("bin.mt.plus_2.26.2.apk").unwrap();
    let archive = ZipArchive::new(f);
    dbg!(&archive);
  5. See error

Expected behavior

ZipArchive::new(f) returns Ok(ZipArchive<File>).

Desktop (please complete the following information):

  • OS: Linux
  • zip version: 8.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions