Giter Site home page Giter Site logo

Comments (10)

yyjdelete avatar yyjdelete commented on May 29, 2024

out.zip
An newer test case with apksign, zipalign and comments.


Seems the format does not forbid other data to be between chunks according to
https://en.wikipedia.org/wiki/Zip_(file_format)

from leanify.

JayXon avatar JayXon commented on May 29, 2024

Yeah... Leanify currently does not support zip files with any data between chunks, should be an easy fix.

from leanify.

JayXon avatar JayXon commented on May 29, 2024

There's another problem... I assumed the order of local file headers is the same as entries in central directory file header, which is true for all the zip files I've encountered until now...
According to Wikipedia: The order of the file entries in the central directory need not coincide with the order of file entries in the archive.
Oh well ¯_(ツ)_/¯ I guess I'll have to rewrite the entire zip parsing logic.

from leanify.

yyjdelete avatar yyjdelete commented on May 29, 2024

Upload a test code, but still some wrong.
master...yyjdelete:patch-2

from leanify.

JayXon avatar JayXon commented on May 29, 2024

Overall looked ok, but I don't get why do you need out_embed_off_, dwf is just a zip file with a prepended header magic, there should be no special handling in the Zip class.

from leanify.

yyjdelete avatar yyjdelete commented on May 29, 2024

Offset(CD/local) in orig dwf file is calc with the whole file instead of just the zip part(like zip.sfx does), so offset of the output zip part must be added to the output offset. Or the output file can not be open by some CAD viewer(It's interesting that some CAD viewer and modern ziper can open both dwf with/without the offset, but I has handled only input files with the offset).

from leanify.

JayXon avatar JayXon commented on May 29, 2024

Interesting, sounds like Leanify should support reading both too, and always write the correct one.
I tried to look for DWF specification, the only one I found is an HTML in the DWF Toolkit, but it has no mention of the offset at all, and probably many others also assumed the offset does not include the header, so the CAD viewer had to support the incorrect one too.

from leanify.

JayXon avatar JayXon commented on May 29, 2024

https://github.com/JayXon/Leanify/tree/zip_parsing
All files work fine now except wizzquiz.zip, which has an invalid EOCD and some other data after the actual ZIP file. Will have to add more logic there to find the correct EOCD.

from leanify.

yyjdelete avatar yyjdelete commented on May 29, 2024

Seems wizzquiz.zip was only used by a test expected error, it should be ok to ignore it.
haf/DotNetZip.Semverd@a66bc69

from leanify.

JayXon avatar JayXon commented on May 29, 2024

But unzip, 7z, windows explorer and master branch Leanify all can handle it correctly, so I should support it otherwise it would be a regression.

from leanify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.