Make Your Tool - ZSShen/ProbeDroid GitHub Wiki
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.
Refer to the ProbeDroidTool repository to get sample source code or the built APK for direct experiment.
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.
- Select the form factor
-
Stop the
instant run
feature introduced by the new Android Studio (version >= 2).- Open the Gradle script
build.gradle(Module: app)
and remove the linecompile '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 theparent value
toparent="@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 theandroid:theme
toandroid:theme="@android:style/Theme.Holo.Light"
. -
sync
the project now.
- Open the Gradle script
-
Import the ProbeDroid API jar.
Suppose our project path isPATH_WORKSPACE/MyProject
.- Copy
ProbeDroid.jar
toPATH_WORKSPACE/MyProject/app/libs
. - Back to Android Studio and switch to the
Project Files
panel. The jar can be seen inapp/app/libs/ProbeDroid.jar
directory. - Right click
ProbeDroid.jar
and selectAdd as Library
.
- Copy
-
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.
- Refer to the upper toolbar and select
Now we finish the work to create our own instrumentation tool.