Building FlowDroid (modified for DidFail) in Eclipse

To build FlowDroid in Eclipse in Ubuntu 12.04:

  1. Install JDK 1.7 if it isn't already installed. (Open a terminal (Ctrl+Alt+T) and enter: sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless. If necessary, do sudo apt-get update first.).
  2. Install the standard version of Eclipse (i.e., not the Android version), via "sudo apt-get install eclipse" (but the Android ADT version might also work).
  3. If Eclipse installs and uses JDK 1.6, then uninstall JDK 1.6 (sudo apt-get remove openjdk-6-jre openjdk-6-jre-headless). FlowDroid doesn't work with JDK 1.6.
  4. Install the Eclipse git plugin: sudo apt-get install git eclipse-egit
  5. Build Soot using the instructions here: https://github.com/Sable/soot/wiki/Building-Soot-with-Eclipse. We will assume that you use the workspace ~/workspaces/didfail; if you use a different directory for your workspace, substitute it where appropriate in these instructions.
  6. Rollback Soot to a compatible version:
    git-reset-soot-2014-10.sh for the latest version of DidFail, or
    git-reset-soot-2014-soap.sh for the SOAP 2014 version of DidFail.
    (Modify the "export wkspc=" line as appropriate.)
    Refresh the Eclipse workspace.
  7. Import the FlowDroid projects into the Eclipse workspace, via File > Import > Git. Eclipse will ask you which branch to use; select one of the following branches: service-addition, static-field-support, develop. (Note that develop is an older version without support for either static field support or services.)
    • Newer versions of DidFail (Nov 2014 and later):
      • https://bitbucket.org/wsnavely/soot-infoflow-latest.git
      • https://bitbucket.org/wsnavely/soot-infoflow-android-latest.git
    • Original DidFail (SOAP 2014 version) (only branch is develop):
      • https://bitbucket.org/wklieber/soot-infoflow.git
      • https://bitbucket.org/wklieber/soot-infoflow-android.git
    Eclipse will ask where store the repos locally. Two options:
    1. The default location: ~/git/soot-infoflow-latest and ~/git/soot-infoflow-android-latest. With this option, do the following after building FlowDroid:
      • wkspc=~/workspaces/didfail
      • ln -s ~/git/soot-infoflow-latest/ $wkspc/soot-infoflow
      • ln -s ~/git/soot-infoflow-latest/ ~/git/soot-infoflow
      • ln -s ~/git/soot-infoflow-android-latest/ $wkspc/soot-infoflow-android
      • ln -s ~/git/soot-infoflow-android-latest/ ~/git/soot-infoflow-android
    2. In the workspace: ~/workspaces/didfail/soot-infoflow and ~/workspaces/didfail/soot-infoflow-android. (Note that the “-latest” suffix has been removed.) Eclipse seems to get really flaky if you do this. If you can't import the projects after cloning, do the following to import into the workspace: File > Import > General > Existing Projects into Workspace. If the build path for soot-infoflow-android is broken, right-click on soot-infoflow-android in Project Explorer and choose Properties from the menu, then click Java Build Path, then Projects, and add soot-infoflow and remove "soot-infoflow (missing)".

Additional documentation from the FlowDroid team on how to build and run FlowDroid: https://github.com/secure-software-engineering/soot-infoflow-android/wiki