5 ms·
> renamed .jar files .ja so Microsoft System restore wouldn’t corrupt Firefox OHH that's why it's called omni.ja.. But why was it "jar" in the first place, for
by floatboth 5y ago
> renamed .jar files .ja so Microsoft System restore wouldn’t corrupt Firefox
OHH that's why it's called omni.ja.. But why was it "jar" in the first place, for a thing that's not Java?
- ronsor 5y agoIt's simply a jar of files, not a JAR (JAva aRchive) of files.
- koolba 5y agoThough even the Java JAR file is itself just a zip file.
- js2 5y agoAs are apk, aar and ipa files among others. However, they aren’t just zip files as they must be in a specific layout, so they are a subset of the zip format.
- easrng 5y agoYou can make a valid APK/IPA/JAR polyglot, just put all the files in one folder, and use the jar tool to make it back into a zip, then rerun jarsigner because the APK has to be resigned after adding the Java and iOS files.
- tadfisher 5y agoI believe the format specifies the META-INF/MANIFEST.MF path, but in practice the classloader and jar tools can deal with a missing manifest. Otherwise it is a zip, with all of its warts and non-reproducible default behavior. Did you know you can have multiple zip entries with the same path? Ask me how I found out.
- koolba 5y agoThat sounds like a recipe for a good time with ClassLoaders.
- mdaniel 5y agoIt's been the source of at least two Android vulns that I can recall, since code-path A uses the top manifest for signature verification but code-path B uses the bottom manifest for reading out "the file" and poof!
- dolmen 5y agoHow did you find out?
- usrusr 5y agoThe usual way to find out is using JarOutputStream without thinking about content name uniqueness. I suspect that of those who do know many have learned it this way.
- diroussel 5y agoAnother difference is that In a jar file, all file names are utf-8 encoded. Where as in a zip file the encoding is not specified.
- ajb 5y agoMost of the old school archive formats allow adding the same path twice. It's to avoid having to rewrite a huge archive just to change a file.
- account42 5y agoYou don't need the same path twice in the central directory record for that though.
- pvorb 5y agoHow did you find out?
- userbinator 5y agoThere's plenty of JavaScript files in there.
- josefx 5y agoThat is nice, but they started to use the extension in 2010, when java had been using it for over a decade already. Sadly applications relying on the file extension alone as file type indication are still common so that was a rather big oversight.
- cxr 5y agoDon't make the mistake of thinking the commenter you're responding to as authoritative on anything. The comment is bullshit.
- dblohm7 5y agoAnother reason was because people trying to open omni.jar with zip utilities were always filing bugs, when the real issue was that the utilities couldn’t handle our optimized format. (I owned the JAR code for a few years after Taras left Mozilla)