AppContext Instruction

Running all-in-one version

1. Download AppContext from here.
2. Install APKtools.
3. Install Python 2.
4. Unzip AppContext.zip and run Main.py under the main directory, Main.py take 2 arguments, the first one is the path to the folder where you deposit your apk files, the second one is the path to your android platform folder.
For example, the command on a Linux machine could be "python Main.py ../apks ../android-platforms-soot/"

Running instrumentation
1. Download AppContext from here.
2. Unzip AppContext.zip and navigate into the folder "AppContext\Instrument".
3. For each apk file you want to instrument,  run IfInstrument.jar with the following command "java -jar IfInstrument.jar filepath platformPath libdir dirPath" where filepath is the path to your apk file; platformPath is the path to your android platform folder; libdir is the folder containing additional library for the analysis, we include the folder at "AppContext\libs", dirPath is the folder where you want to deposit the instrumented apk files.

Detailed Instruction
Before you run:
1. install java jdk 1.7
2. install Android SDK tools 24.4 or 25.1
3. install Android ADK platform-tools 23.0.1 or 23.0.3
4.download all Android API in https://github.com/Sable/android-platforms (just download all the folders and put them in your android platform folder)
5. follow "Running all-in-one version" instruction in: https://sites.google.com/site/asergrp/projects/appcontext/appcontext-instruction
6. give the whole "AppContext" folder permission to excute : "sudo chmod -R 777 AppContext"
7. download AppContext_src.zip in http://web.engr.illinois.edu/~weiyang3/AppContext.zip

how to run:
1. Unzip AppContext.zip and run Main.py under the main directory, Main.py take 2 arguments, the first one is the path to the folder where you deposit your apk files, the second one is the path to your android platform folder.
For example, the command on a Linux machine could be "python Main.py ../apks ../android-platforms-soot/"
or "sudo python Main.py /home/MyName/FinalTestApks /home/UsrName/Android/Sdk/platforms/"
you will get "output.csv".

2. Unzip AppContext_src.zip.
run src/manifest/EntrypointParser.java
It take 4 arguments, the first one is the "output.csv" you've got by Main.py. The second one is the csv file you will get, you can name it as you want. I name it "entry.csv" for example. The third one is the path to "AppContext/Manifest/Decomplied/ ". The forth one is the path to the folder in "AppContext/ICC/RetargetDir/" which name is the same as the folder where you deposit your apk files.
for example:"java EntrypointParser.java ../APKcode/output.csv ../entry.csv ../AppContext/Manifest/Decomplied/ ../AppContext/ICC/RetargetDir/FinalTestApks/"

3.
run src/app/TypeFileTransform.java
before run it, make sure "nonFactorColumn“ is 9, "String fileName" is the csv file you got from EntrypointParser.java. "String templateName" is the file you will get.


Comments