Step 2 - Basic Application Obfuscation

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


In the first step we have obfuscated Mouse Gestures as a library and now we will obfuscate it as a stand-alone application. It means that public API should not be visible, in fact we can just leave original name only for the main class. This is a common situation when you develop a stand-alone application and the more classes you will hide the better.

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

<config>
    <jars>
        <jar in="test.jar" out="obf-test.jar"/>
        <jar in="mousegestures-1.2.jar" out="obf-mousegestures-1.2.jar"/>
    </jars>

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

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

We have changed the keep-names section so that only the class com.smardec.mousegestures.test.TestFrame wouldn't be renamed. We have used wildcard syntax (*.TestFrame) for short.

Step 1       Step 3       Contents