How It Works
-
You need a working JAR-file, like e.g. the Snake example which will be used for this analogy. Make sure to either include all dependencies or provide them in the next step to be able to completely resolve the JAR-file.
Directoryme
Directorymicartey
Directorysnake
- DataOfSquare.java
- KeyboardListener.java
- Main.java
- SquarePanel.java
- ThreadsControler.java
- Tuple.java
- Window.java
-
Use jCloak to hide selected classes. The example will hide all classes, but that doesn’t need to be the case for you as well. You can also create dummy classes that are present but aren’t being used by the JVM.
Directoryme
Directorymicartey
Directorysnake
- Main.java Entrypoint
- 3eIhqP4SoNi5uEw1
-
jCloak will generate a file which contains all information about the classes. The filename is random, but will be loaded from an entrypoint. The entrypoint is in this case the Main class.
static {JCloak.initialize(Main.class.getClassLoader(), "3eIhqP4SoNi5uEw1");} -
The loading is done by the Loader which is a part of jCloak. The Loader will be included in your project (or dynamically linked during runtime). It will define all the missing classes and thus makes it possible for your file to access the classes. This step is being observed with watchdogs to prevent the classes from being dumped.