Skip to content

HOWTO Compile AFWall

Umakanthan Chandran edited this page Dec 31, 2013 · 36 revisions

Software we need:

Advanced users can build the latest .APK from the Command Line or see the next steps.

Build via Command Line

Choose the Android list targets - lists all your installed Android target e.g. API level 17 for the latest Android Version.

Select: "id: 4 or "Google Inc.:Google APIs:17" Name: Google APIs Type: Add-On Vendor: Google Inc. .... "

You also can use the "-t 4" argument.

After this we set our JAVA_HOME path:

  • export ANDROID_JAVA_HOME="/opt/sun-jdk-1.7.0__21"
  • mkdir afwall_build
  • cd afwall_build
  • git clone git://github.com/ukanth/afwall.git
  • cd afwall
  • git submodule init
  • git submodule update
  • android update project -p . -s
  • ant debug

This build the .apk and place it in bin/afwall-debug.apk

Compiling native binaries

On the host side you'll need to install:

  • NDK r9, nominally under /opt/android-ndk-r9
  • Host-side gcc, make, etc. (Red Hat "Development Tools" group or Debian build-essential)
  • autoconf, automake, and libtool

This command will build the Android binaries and copy them into res/raw/:

make -C external NDK=/opt/android-ndk-r9

Via graphical user interface (GUI)

  • Here is a Video Tutorial from a xda member for those users who want to use the GUI method. The tutorial is based on the needed software explained above.
  • Here you get the official buld instruction

For experts user only!

Create an unsigned .APK file with apkbuilder

use apkbuilder (included in the Android Develop Kit)

apkbuilder ${output.apk.file} -u -z ${packagedresource.file} -f ${dex.file}

Sign an .APK file via jarsigner

use jarsigner

jarsigner -keystore ${keystore} -storepass ${keystore.password} -keypass ${keypass} -signedjar ${signed.apkfile} ${unsigned.apkfile} ${keyalias}

Publish the latest APK file

use adb adb -d install -r ${signed.apk}

Some other useful links