Author Topic: updated java-jar.trid.xml for Java Archive with extra fields  (Read 1817 times)

jenderek

  • Sr. Member
  • ****
  • Posts: 370
updated java-jar.trid.xml for Java Archive with extra fields
« on: January 04, 2020, 03:59:40 PM »
Hello trid users,

some days ago i run TrID on hundreds of Java Archive (*.jar). These should
be described by java-jar.trid.xml as "Java Archive". Many inspected samples
like CleverEPGDataService.jar are only described in general by
ark-zip.trid.xml as "ZIP compressed archive" (see appended
output/trid-old.txt).

On the other hand the newest file command {See
https://en.wikipedia.org/wiki/File_(command)} describes many inspected examples
correctly like "Java archive data" ( see appended output/file.txt),
because the file command use another method to detect JAR archives.

So i run tridscan on unsubscribed examples to update trid definition.
In current definition outdated URL http://java.sun.com/ is used which directs
to not help full site https://www.oracle.com/java/technologies/ . So i
replace this URL by page about JAR file format on Wikipedia. This is now
expressed by line:

   <RefURL>https://en.wikipedia.org/wiki/JAR_(file_format)</RefURL>

According to that page i also add mime type. This is now shown by
additional line:

   <Mime>application/java-archive</Mime>

According to Wikipedia page a JAR file may contain a manifest file, that is
located at META-INF/MANIFEST.MF. According to Wikipedia page about Zip file
format for "simple" Jar archives after the archive member file name the next
ZIP directory entry starts which is characterized by magic string "PK". In
current definition these 2 facts are expressed in global string section by XML
construct:

        <String>MANIFEST.MFPK</String>
   <String>META-INF</String>

But JAR archives like org-eclipse-core-commands-3.6.0.jar can also contain
extra field after member file name. So there after string MANIFEST.MF does
not come next ZIP fragment, starting with PK magic. So in global string
section this is now expressed by XML construct:

        <String>MANIFEST.MF</String>
   <String>META-INF</String>

With the updated trid definition file more JAR archives are described
correctly ( see appended deb/output/trid-new.txt).

TrID definition, some examples  and output are stored in archive jar.zip.
I hope that the updated XML file can be used in future version of triddefs.

With best wishes
Jörg Jenderek


Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 2684
    • Mark0's Home Page
Re: updated java-jar.trid.xml for Java Archive with extra fields
« Reply #1 on: January 04, 2020, 09:16:01 PM »
Thanks!