ded: Installation and usage
Files are available for Linux and Mac OS. They were compiled on Ubuntu 10.04 and Mac OS 10.6. Please read the FAQ page first if you have any question related to the installation or usage of ded. If you have any other question, please use the ded support mailing list.
Installation of ded (retargeting .dex/.apk to .class)
In order to use ded, you need to download the latest version:
ded uses a customized version of Jasmin to assemble .class files. You need to download it to use ded. It needs to be in the same directory as the ded executable. You also need a Java Runtime Environment to run Jasmin.
ded is used with:
% ded-<version> -d <output dir> <dex/apk file>
It will output .class files whose bytecode is not optimized. Decompiling these files yields source code which can be hard to follow. Below we describe a procedure to optimize .class files using Soot 2.3.0.
Optimizing Retargeted Android Applications
Step 1: Download the files
In addition to the files above you need the following files.
In order to use Soot to optimize your .class files, you need to download Soot from the Sable Research Group's website.
You need to download the launcher for ded and Soot:
You also need the following archive which contains a script that facilitates the use of the launcher. It contains default paths to Soot classes.
Step 2: Extract/copy the files
First, extract the script with
% tar -xf ded-script.tar.gz
It will create a ded directory with two directories and the ded.sh script inside.
You need to extract Soot to the ded/soot directory:
% tar -xf <path_to_soot_archive>/sootall-2.3.0.tar.gz -C <path_to_ded_dir>/ded/soot
Next, you need to move ded, ded-launcher and Jasmin to the ded directory.
Finally, Soot needs to be able to resolve the Android API classes. They are provided with the Android SDK. If you do not already have it, you need to follow steps 2 and 4 at http://developer.android.com/sdk/index.html to install Android platforms. Once you have downloaded the Android platform with the desired API level, you can find the corresponding android.jar under <sdk_directory>/platforms/android-8 for example if you downloaded the Android API level 8. You need to copy android.jar to the ded/android-libs directory. Note that this will allow Soot to resolve most classes it needs. If other classes are needed, you have to look for them and you can add the corresponding .jar packages in the ded/android-libs directory.
After this is done, the directory tree should be the following:
ded |--> soot | |--> jasmin-2.3.0 | |--> polyglot-1.3.5 | |--> soot-2.3.0 |--> android-libs | |--> android.jar |--> ded-0.7.1 |--> ded-launcher-0.7.1 |--> ded.sh |--> jasminclasses-2.4.0.jar
Step 3: Launch ded and Soot using ded.shUse ded.sh as follows:
% ded.sh -d <output directory> [-o] [-c] <dex/apk file>
The -o option triggers optimization by Soot, while -c triggers both optimization and decompilation with Soot.
Note that several Java decompilers target .class files generated using specific compilers and therefore do not perform well with the output of ded. Java decompilers which perform well with retargeted Android applications include Dava (Soot) and Fernflower.
NSRC | SIIS | CSE | Penn State | Copyright 2011 SIIS Lab