Step 3 - Obfuscation with Setting Classpath

Files located in the tutorial/step03/files directory:
mousegestures-1.2.jarMouse Gestures library jar
test.jarJar with Mouse Gestures demo frame
config.xmlAllatori configuration file
RunAllatori.batRuns Allatori
MouseGesturesOriginal.batRuns original version of Mouse Gestures
MouseGesturesObfuscated.batRuns obfuscated version of Mouse Gestures
Clean.batDeletes generated files


Here, we will obfuscate our jars as if test.jar is a stand-alone application and mousegestures-1.2.jar is a third party library used by test.jar.

Let's look what we've changed in the configuration file, changes are in bold:

<config>
    <input>
        <jar in="test.jar" out="obf-test.jar"/>
    </input>

    <classpath>
        <jar name="mousegestures-1.2.jar"/>
    </classpath>

    <keep-names>
        <class template="class *.TestFrame"/>
    </keep-names>

    <property name="log-file" value="log.xml"/>
</config>

We have removed mousegestures-1.2.jar from jars section and added new classpath section referencing Mouse Gestures library. It is not necessary to reference all jars needed by your application in the classpath section. However, missing classpath elements may result in a weaker obfuscation. If you delete (or comment) classpath section, Allatori will warn you about missing classes during the obfuscation process.

Step 2       Step 4       Contents