So I've got a task today, to automatize the proccess of selecting Java package in LibreOffice (when you install new Java version in GPO, you have to select new version of Java manualy in LibreOffice by Tools->Settings->LibreOffice->Advanced). The idea is pretty much simple, everything that I need to change, is this simple xml file with PowerShell script:
<?xml version="1.0" encoding="UTF-8"?>
<!--This is a generated file. Do not alter this file!-->
<java xmlns="http://openoffice.org/2004/java/framework/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<enabled xsi:nil="true"/>
<userClassPath xsi:nil="false">//server/public/base/mysql-connector-java-5.1.25/mysql-connector-java-5.1.25-bin.jar</userClassPath>
<vmParameters xsi:nil="true"/>
<jreLocations xsi:nil="true"/>
<javaInfo xsi:nil="false" vendorUpdate="2013-05-02" autoSelect="false">
<vendor>Oracle Corporation</vendor>
<location>file:///C:/Program%20Files%20(x86)/Java/jre1.8.0_91</location>
<version>1.8.0_91</version>
<features>0</features>
<requirements>0</requirements>
<vendorData>660069006C0065003A002F00[...]76006D002E0064006C006C00</vendorData> //250+ hex characters
</javaInfo>
</java>
Everything was going fine, till I noticed this vendorData element. It's unique for every package, and contains something like a 250+ hex characters. When I tried to change something manually inside of it, the selection of Java package in LibreOffice was automatically unchecking, and if I select package manually again, the hex string would automatically generate by itself. I think that this string contains checksum.
Does anyone knows, how is this string generated? Is there any LibreOffice documentation, where things like this one, could be found?
Xml file is normally located in %appdata%\Roaming\LibreOffice\4\user\config\javasettings_Windows_x86.xml
Hex strings vary in length, but some parts of them seems to be constant.
Well, answer is really simple. This "strange" hex string is just the path to file location from content + on the end it adds string "/bin/client/jvm.dll" in the same code, where FF in hex code is just number of ASCII character, then 00 means next letter.
For example:
6100620063
So we got 3 characters, 61 in decimal is 97 and in ASCII it's "a".
Whole "6100620063" means "abc".
With this knowledge, we just need simple function for transripting and string "/bin/client/jvm.dll" content to hex code.