Step 2 - Basic Application Obfuscation

Files located in the tutorial/step02/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


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 leave original name just for the main class. It is a common situation when you develop a stand-alone application and the more classes/methods/fields you rename the better.

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"/>
        <jar in="mousegestures-1.2.jar" out="obf-mousegestures-1.2.jar"/>
    </input>

    <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