Building DEX files from the command line
DEX files without a doubt are one of the most important parts of an Android app, which is often useful for an attacker or penetration tester. We will have to deal with DEX files a lot in the Reverse Engineering section of this book. So, let's see how these DEX files are created during the app building process. We are going to do it from the command line so that it is better understandable as we can have a close look at each step.
The following diagram shows the high level process of how .dex
files are generated:
The first step is to write a simple Java program in order to start with the process. The following piece of Java code simply prints the word Hacking Android on the output console:
public class HackingAndroid{ Public static void main(String[] args){ System.out.println("Hacking Android"); } }
Save this file as HackingAndroid.java
.
Now we need to compile this Java file. The initial compilation process of Java code written for...