Skip to content

Running on the edge

dbradberry edited this page Dec 17, 2012 · 14 revisions

If you want to write Mercury modules, you may want the latest code. We work on the develop branch on Github, which is often newer than the most recent release.

Preparation

If you want to run Mercury from Github, there are a few things environment variables will have to set up first:

  • add to your PATH /path/to/mercury/bin
  • add to your PYTHONPATH /path/to/mercury/src and /path/to/mercury/test
  • set SDK to /path/to/android-sdk-linux/platforms/android-16/android.jar

You will also need javac and dx available on your path.

Starting Mercury

Once you have set up your environment, you should be able to start Mercury using the normal command:

mercury console connect

Note: the behaviour is undefined if you have Mercury installed on your system from a distribution. You may want to adjust your PYTHONPATH to exclude installed Mercury or use virtualenv to create an isolated environment.

Building APKs

Some Mercury commands deliver an APK file to the Agent. These are built from the various Java source files in the src/mwr/droidhg/modules/ tree.

A Makefile is provided to automate building of these sources. To invoke it, run the apks target:

make apks

This should be run every time you make a change to a Java file.

Clone this wiki locally