mystery byte increments in jar format

I've been working on reproducible jars, and I have fixed the timestamps by running the builds using faketime. Now the contents of the jars are exactly the same when I unzip them, including the timestamps, but the jars themselves do not have the same hash. Using vbindiff, I can see a smattering of bytes that are different, with almost always the same pattern: one build's byte will be +1 from the others, i.e. one has 98 and the other has 99, or 56 and 57. It seems that this byte is some kind of separator between class names.


Hi! Please share output of e.g. "diff -u $<(xxd a.jar) $<(xxd b.jar)" (assuming a Bash shell). They're only .ZIP files; it sounds like you're seeing differences in the file header records at the end of the archive, so we can try to interpret what they mean. https://en.wikipedia.org/wiki/ZIP_%28file_format%29#File_headers


diff does a poor job of showing differences, so here's a screenshot from meld:

cachewordlib-bin-diff.png


The differences shown here are file mtimes in the ZIP file. A difference of 0x01 means 2 seconds' difference. So I'm afraid faketime isn't working as expected for you.


Serves me right for using unzip -lv versus zipinfo -lv. This 2 second difference is clear to see when comparing zipinfo -lv.