Skip to content
ZongXian Shen edited this page Jul 11, 2016 · 8 revisions

We need to prepare the instrumentation tool to start hacking. For this, the sample tools introduced in the ProbeDroidTool repository can fulfill some basic functionalities. But it is recommended that we code our own tools to fit different analysis objective.

Get Sample Tool

Refer to the ProbeDroidTool repository to get sample source code or the built APK for direct experiment.

Make Custom Tool

We should create a new Android Studio project to build our own instrumentation tool.

  • Create a no activity application.

    • Select the form factor Phone and Tablet.
    • Select the minimum SDK API 21 Android 5.0 (Lollipop).
    • Then add no activity to the application.
  • Stop the instant run feature introduced by the new Android Studio (version >= 2).

    • Open the Gradle script build.gradle(Module: app) and remove the line compile 'com.android.support:appcompat-v7:22.2.0'.
    • Do not follow the sync order enforced by Android Studio now.
    • Open the style resource res/values/styles.xml and change the parent value to parent="@android:style/Theme.Holo.Light".
    • Still in res/values/styles.xml, remove the following lines:
      • <item name="colorPrimary">@color/colorPrimary</item>
      • <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
      • <item name="colorAccent">@color/colorAccent</item>
    • Open the Android manifest AndroidManifest.xml and change the android:theme to android:theme="@android:style/Theme.Holo.Light".
    • sync the project now.
  • Import the ProbeDroid API jar.
    Suppose our project path is PATH_WORKSPACE/MyProject.

    • Copy ProbeDroid.jar to PATH_WORKSPACE/MyProject/app/libs.
    • Back to Android Studio and switch to the Project Files panel. The jar can be seen in app/app/libs/ProbeDroid.jar directory.
    • Right click ProbeDroid.jar and select Add as Library.
  • Start to code your own tool.
    Now we can refer to the javadoc for API usage. Also, you can check out the sample tool as the example.

  • Build the instrumentation APK.

    • Refer to the upper toolbar and select Build -> Generated Signed APK... to build APK.

Now we finish the work to create our own instrumentation tool.

How to Use

How to Contribute

Clone this wiki locally