Page still under construction, stay tuned
DefDroid is a research prototype and is provided on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. In no event shall the creators of DefDroid or any of its contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
The hardware requirements to build DefDroid are roughly the same as building the original Android release: you need to have a decent machine running 64-bit Linux or Mac OS: 8+ GB RAM, 100+ GB storage (preferablly SSD), and fast Internet connection.
Before the actual building, make sure you have JDK 7, and prepare the build environment by following the Android build guide to install necessary libraries and packages. For example, if your machine is running Ubuntu 14.04, run the following commands:
Android release uses a Git wrapper called
repo to manage the source code. Get it
First, create the workspace to store the source code and build result:
mkdir -p ~/android/defdroid. In the following, we assume the workspace is in
~/android/defdroid. If you chose a different path, make sure to substitute it
<branch> with the desired Android base repo and branch
that DefDroid has been ported to:
The last step (
repo sync) would take a while to download the repository.
To speed up the building process on re-compilation, it is recommended to enable
CCACHE_DIR setting by default is in
The repo command to be used in the initialization step for CM
11.0 build is
repo init -u https://github.com/CyanogenMod/android.git -b cm-11.0.
Then get the DefDroid modifications by using the local manifests approach:
This step only needs to be done once to populate the built-in apps from CM into the repository:
To build a working image for a particular device usually requires device-dependent code
and proprietary blobs to be pulled in the repo. In CM release, this is mainly handled
breakfast command and some scripts. For example, to build for Motorola G device,
you need to run:
Then you need to pull the proprietary blobs from the device: connect your Motorola G
device to your computer via USB; make sure the
adb command from Android SDK is in
your PATH; and ironically, your Motorola G should already be running a CM release
for the following script to work:
Using Motorola G target as an example:
Once the system finishes building, you should see the output image in
<device> is the code name for your Android devices. For Motorola G, it’s
With the image zip file, follow the standard way to flash it to the phone. If you are not familiar with how to flash a custom ROM, there are plenty of guides online. For example, for the Motorola G device, you can follow steps in this guide