Skip to content

Commit 5229425

Browse files
committed
Initial commit: AMT
0 parents  commit 5229425

28 files changed

Lines changed: 3243 additions & 0 deletions

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
![Java 8](https://img.shields.io/badge/java-8-brightgreen.svg)
2+
---
3+
<p align="center">
4+
<img src="logo.png" width="300px"/>
5+
</p>
6+
7+
# AMT
8+
The *Android Merge Tool (AMT)* does what the name suggests: it merges arbitrary Android apps into a single merged app.
9+
As input it takes a number of Android packages (.apk files) and outputs the merged app as one Android package.
10+
Along with this primary output, a report is generated optionally.
11+
It contains information about the properties (e.g. taint-flows) changed.
12+
13+
<p align="center">
14+
<img src="overview.png" width="75%" />
15+
</p>
16+
17+
An overview of the whole approach is illustrated in the figure above.
18+
On the one hand, the first five steps (1 - 5) represent *Phase I*, the app merging process.
19+
Multiple input apps are merged into a single merged app.
20+
On the other hand, Step 6 and 7 stand for *Phase II*.
21+
During this phase it is evaluated how accurately the merged app represents the input apps.
22+
In order to guarantee accurately merged benchmarks Phase II becomes indispensable.
23+
For more information please take a look at the associated [paper](t.b.a.) (see Publications).
24+
25+
## Usage
26+
Two steps have to be completed in order to use AMT:
27+
- **Step 1: Configuration**
28+
The file *amt.properties* holds the AMT's configuration.
29+
The following options can be configured:
30+
31+
| Parameter | Meaning |
32+
| --------- | ------- |
33+
| `androidPlatforms=/path/to/Android/sdks/platforms` | The path to the Android platforms directory |
34+
| `apktoolPath=/path/to/apktool` | [ApkTool](https://github.com/iBotPeaches/Apktool) must be installed and this path has to point to the directory containing ApkTool's JAR file |
35+
| `apktoolJar=apktool_2.3.4.jar` | Mostly dependent on ApkTool's version, the JAR's filename should be adapted here. |
36+
| `aqlQuery=Flows IN App('%APP_APK%') USES 'FlowDroid' ?` | When run in *check* or *comparison* mode, an [AQL-Query](https://github.com/FoelliX/AQL-System/wiki/Questions) to execute must be defined here. |
37+
| `comparisonAqlQuery=Flows IN App('%APP_APK%' \| 'COMBINE') USES 'FlowDroid' ?` | The query used for the comparison must be defined here. |
38+
| `outputFolder=output` | Any output is stored in the specified directory |
39+
40+
- **Step 2: Launch**
41+
AMT can be accessed from the command-line as follows:
42+
````bash
43+
java -jar AMT-0.0.2.jar [optional launch parameters] [list of .apk files]
44+
````
45+
for example:
46+
````bash
47+
java -jar AMT-0.0.2.jar -comparison -d short -cfg myConfig.xml A.apk B.apk
48+
````
49+
This will launch AMT in comparison mode, shorten its output and use `myConfig.xml` as configuration for the underlying AQL-System.
50+
All launch parameters are listed in the following table:
51+
52+
| Parameter | Meaning |
53+
| --------- | ------- |
54+
| `-check` | Turns on the optional *check* mode |
55+
| `-comparison` | Turns on the optional *comparison* mode |
56+
| `-c %FILE%`, `-cfg %FILE%`, `-config %FILE%` | This parameter can be used to specify a different config file for the underlying [AQL-System](https://github.com/FoelliX/AQL-System) (By default: *config.xml* is used) |
57+
| `-debug "X"`, `-d "X"` | The output generated during the execution of this tool can be set to different levels. `X` may be set to: `error`, `warning`, `normal`, `debug`, `detailed` (ascending precision from left to right). Additionally it can be set to `short`, the output will then be equal to `normal` but shorter at some points. By default it is set to `normal`. |
58+
59+
## Publications
60+
- *App Merging for Benchmark Speed-Up and Analysis Lift-Up* (Felix Pauck, Shikun Zhang)
61+
t.b.a.
62+
63+
## License
64+
AMT is licensed under the *GNU General Public License v3* (see [LICENSE](https://github.com/FoelliX/AMT/blob/master/LICENSE)).
65+
66+
## Contact
67+
**Felix Pauck** (FoelliX)
68+
Paderborn University
69+
fpauck@mail.uni-paderborn.de
70+
[http://www.FelixPauck.de](http://www.FelixPauck.de)
71+
72+
## Links
73+
- AMT requires ApkTool: [https://github.com/iBotPeaches/Apktool](https://github.com/iBotPeaches/Apktool)
74+
- AMT uses the AQL and its system: [https://foellix.github.io/AQL-System](https://foellix.github.io/AQL-System)
75+
- ApkCombiner is a very similar tool: [https://github.com/lilicoding/ApkCombiner](https://github.com/lilicoding/ApkCombiner)

_config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
theme: jekyll-theme-slate
2+
title: AMT
3+
description: Android Merge Tool
4+
show_downloads: true
5+
logo: https://foellix.github.io/AMT/logo.png

amt.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
androidPlatforms=/path/to/Android/sdks/platforms
2+
apktoolPath=/path/to/apktool
3+
apktoolJar=apktool_2.3.4.jar
4+
aqlQuery=Flows IN App('%APP_APK%') USES 'FlowDroid' ?
5+
comparisonAqlQuery=Flows IN App('%APP_APK%' | 'COMBINE') USES 'FlowDroid' ?
6+
outputFolder=output

logo.png

110 KB
Loading

overview.png

68.1 KB
Loading

pom.xml

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>de.upb.mike.amt</groupId>
4+
<artifactId>AMT</artifactId>
5+
<version>0.0.2-SNAPSHOT</version>
6+
<packaging>jar</packaging>
7+
8+
<name>AMT</name>
9+
<description>Android Merge Tool</description>
10+
<url>https://FoelliX.github.io/AMT</url>
11+
12+
<properties>
13+
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
14+
<maven.compiler.source>1.8</maven.compiler.source>
15+
<maven.compiler.target>1.8</maven.compiler.target>
16+
</properties>
17+
18+
<build>
19+
<defaultGoal>clean install</defaultGoal>
20+
<directory>target</directory>
21+
22+
<outputDirectory>target/classes</outputDirectory>
23+
<sourceDirectory>src</sourceDirectory>
24+
<testSourceDirectory>testsrc</testSourceDirectory>
25+
26+
<resources>
27+
<resource>
28+
<directory>${project.basedir}</directory>
29+
<includes>
30+
<include>amt.properties</include>
31+
<include>config*.xml</include>
32+
</includes>
33+
<targetPath>${project.basedir}/target/build</targetPath>
34+
</resource>
35+
<resource>
36+
<directory>${project.basedir}/apktool</directory>
37+
<includes>
38+
<include>*.jar</include>
39+
</includes>
40+
<targetPath>${project.basedir}/target/build/apktool</targetPath>
41+
</resource>
42+
</resources>
43+
44+
<plugins>
45+
<plugin>
46+
<groupId>org.apache.maven.plugins</groupId>
47+
<artifactId>maven-assembly-plugin</artifactId>
48+
<version>3.1.0</version>
49+
<executions>
50+
<execution>
51+
<phase>package</phase>
52+
<goals>
53+
<goal>single</goal>
54+
</goals>
55+
<configuration>
56+
<archive>
57+
<manifest>
58+
<mainClass>
59+
de.upb.mike.amt.AMT
60+
</mainClass>
61+
</manifest>
62+
</archive>
63+
<descriptorRefs>
64+
<descriptorRef>jar-with-dependencies</descriptorRef>
65+
</descriptorRefs>
66+
<outputDirectory>${project.basedir}/target/build</outputDirectory>
67+
<finalName>${project.name}-${project.version}</finalName>
68+
<appendAssemblyId>false</appendAssemblyId>
69+
</configuration>
70+
</execution>
71+
</executions>
72+
</plugin>
73+
74+
<plugin>
75+
<groupId>org.apache.maven.plugins</groupId>
76+
<artifactId>maven-surefire-plugin</artifactId>
77+
<version>2.22.0</version>
78+
<configuration>
79+
<excludedGroups>requiresBuild</excludedGroups>
80+
<excludedGroups>systemIsSetup</excludedGroups>
81+
</configuration>
82+
</plugin>
83+
</plugins>
84+
</build>
85+
86+
<repositories>
87+
<!-- https://sable.github.io/soot/ -->
88+
<repository>
89+
<id>soot-release</id>
90+
<name>soot releases</name>
91+
<url>https://soot-build.cs.uni-paderborn.de/nexus/repository/soot-release/</url>
92+
</repository>
93+
</repositories>
94+
95+
<dependencies>
96+
<!-- https://sable.github.io/soot/ -->
97+
<dependency>
98+
<groupId>ca.mcgill.sable</groupId>
99+
<artifactId>soot</artifactId>
100+
<version>3.3.0</version>
101+
</dependency>
102+
<!-- https://mvnrepository.com/artifact/net.dongliu/apk-parser -->
103+
<dependency>
104+
<groupId>net.dongliu</groupId>
105+
<artifactId>apk-parser</artifactId>
106+
<version>2.6.6</version>
107+
</dependency>
108+
<!-- https://mvnrepository.com/artifact/de.foellix/AQL-System -->
109+
<dependency>
110+
<groupId>de.foellix</groupId>
111+
<artifactId>AQL-System</artifactId>
112+
<version>1.2.0</version>
113+
</dependency>
114+
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
115+
<dependency>
116+
<groupId>org.junit.jupiter</groupId>
117+
<artifactId>junit-jupiter-api</artifactId>
118+
<version>5.2.0</version>
119+
</dependency>
120+
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine -->
121+
<dependency>
122+
<groupId>org.junit.jupiter</groupId>
123+
<artifactId>junit-jupiter-engine</artifactId>
124+
<version>5.2.0</version>
125+
<scope>test</scope>
126+
</dependency>
127+
</dependencies>
128+
129+
<developers>
130+
<developer>
131+
<name>Shikun Zhang</name>
132+
<email>shikun1102@163.com</email>
133+
<organization>Paderborn University</organization>
134+
<organizationUrl>https://cs.uni-paderborn.de</organizationUrl>
135+
</developer>
136+
<developer>
137+
<name>Felix Pauck</name>
138+
<email>fpauck@mail.uni-paderborn.de</email>
139+
<organization>Paderborn University</organization>
140+
<organizationUrl>https://cs.uni-paderborn.de</organizationUrl>
141+
</developer>
142+
</developers>
143+
144+
<licenses>
145+
<license>
146+
<name>GNU General Public License v3.0</name>
147+
<url>https://www.gnu.org/licenses/gpl-3.0.txt</url>
148+
</license>
149+
</licenses>
150+
</project>

0 commit comments

Comments
 (0)