Skip to content

Commit

Permalink
Initial commit: AMT
Browse files Browse the repository at this point in the history
  • Loading branch information
FoelliX committed Jun 21, 2019
0 parents commit 5229425
Show file tree
Hide file tree
Showing 28 changed files with 3,243 additions and 0 deletions.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
![Java 8](https://img.shields.io/badge/java-8-brightgreen.svg)
---
<p align="center">
<img src="logo.png" width="300px"/>
</p>

# AMT
The *Android Merge Tool (AMT)* does what the name suggests: it merges arbitrary Android apps into a single merged app.
As input it takes a number of Android packages (.apk files) and outputs the merged app as one Android package.
Along with this primary output, a report is generated optionally.
It contains information about the properties (e.g. taint-flows) changed.

<p align="center">
<img src="overview.png" width="75%" />
</p>

An overview of the whole approach is illustrated in the figure above.
On the one hand, the first five steps (1 - 5) represent *Phase I*, the app merging process.
Multiple input apps are merged into a single merged app.
On the other hand, Step 6 and 7 stand for *Phase II*.
During this phase it is evaluated how accurately the merged app represents the input apps.
In order to guarantee accurately merged benchmarks Phase II becomes indispensable.
For more information please take a look at the associated [paper](t.b.a.) (see Publications).

## Usage
Two steps have to be completed in order to use AMT:
- **Step 1: Configuration**
The file *amt.properties* holds the AMT's configuration.
The following options can be configured:

| Parameter | Meaning |
| --------- | ------- |
| `androidPlatforms=/path/to/Android/sdks/platforms` | The path to the Android platforms directory |
| `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 |
| `apktoolJar=apktool_2.3.4.jar` | Mostly dependent on ApkTool's version, the JAR's filename should be adapted here. |
| `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. |
| `comparisonAqlQuery=Flows IN App('%APP_APK%' \| 'COMBINE') USES 'FlowDroid' ?` | The query used for the comparison must be defined here. |
| `outputFolder=output` | Any output is stored in the specified directory |

- **Step 2: Launch**
AMT can be accessed from the command-line as follows:
````bash
java -jar AMT-0.0.2.jar [optional launch parameters] [list of .apk files]
````
for example:
````bash
java -jar AMT-0.0.2.jar -comparison -d short -cfg myConfig.xml A.apk B.apk
````
This will launch AMT in comparison mode, shorten its output and use `myConfig.xml` as configuration for the underlying AQL-System.
All launch parameters are listed in the following table:

| Parameter | Meaning |
| --------- | ------- |
| `-check` | Turns on the optional *check* mode |
| `-comparison` | Turns on the optional *comparison* mode |
| `-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) |
| `-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`. |

## Publications
- *App Merging for Benchmark Speed-Up and Analysis Lift-Up* (Felix Pauck, Shikun Zhang)
t.b.a.

## License
AMT is licensed under the *GNU General Public License v3* (see [LICENSE](https://github.com/FoelliX/AMT/blob/master/LICENSE)).

## Contact
**Felix Pauck** (FoelliX)
Paderborn University
[email protected]
[http://www.FelixPauck.de](http://www.FelixPauck.de)

## Links
- AMT requires ApkTool: [https://github.com/iBotPeaches/Apktool](https://github.com/iBotPeaches/Apktool)
- AMT uses the AQL and its system: [https://foellix.github.io/AQL-System](https://foellix.github.io/AQL-System)
- ApkCombiner is a very similar tool: [https://github.com/lilicoding/ApkCombiner](https://github.com/lilicoding/ApkCombiner)
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
theme: jekyll-theme-slate
title: AMT
description: Android Merge Tool
show_downloads: true
logo: https://foellix.github.io/AMT/logo.png
6 changes: 6 additions & 0 deletions amt.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
androidPlatforms=/path/to/Android/sdks/platforms
apktoolPath=/path/to/apktool
apktoolJar=apktool_2.3.4.jar
aqlQuery=Flows IN App('%APP_APK%') USES 'FlowDroid' ?
comparisonAqlQuery=Flows IN App('%APP_APK%' | 'COMBINE') USES 'FlowDroid' ?
outputFolder=output
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
150 changes: 150 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>de.upb.mike.amt</groupId>
<artifactId>AMT</artifactId>
<version>0.0.2-SNAPSHOT</version>
<packaging>jar</packaging>

<name>AMT</name>
<description>Android Merge Tool</description>
<url>https://FoelliX.github.io/AMT</url>

<properties>
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<build>
<defaultGoal>clean install</defaultGoal>
<directory>target</directory>

<outputDirectory>target/classes</outputDirectory>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>testsrc</testSourceDirectory>

<resources>
<resource>
<directory>${project.basedir}</directory>
<includes>
<include>amt.properties</include>
<include>config*.xml</include>
</includes>
<targetPath>${project.basedir}/target/build</targetPath>
</resource>
<resource>
<directory>${project.basedir}/apktool</directory>
<includes>
<include>*.jar</include>
</includes>
<targetPath>${project.basedir}/target/build/apktool</targetPath>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>
de.upb.mike.amt.AMT
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<outputDirectory>${project.basedir}/target/build</outputDirectory>
<finalName>${project.name}-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<excludedGroups>requiresBuild</excludedGroups>
<excludedGroups>systemIsSetup</excludedGroups>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<!-- https://sable.github.io/soot/ -->
<repository>
<id>soot-release</id>
<name>soot releases</name>
<url>https://soot-build.cs.uni-paderborn.de/nexus/repository/soot-release/</url>
</repository>
</repositories>

<dependencies>
<!-- https://sable.github.io/soot/ -->
<dependency>
<groupId>ca.mcgill.sable</groupId>
<artifactId>soot</artifactId>
<version>3.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.dongliu/apk-parser -->
<dependency>
<groupId>net.dongliu</groupId>
<artifactId>apk-parser</artifactId>
<version>2.6.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/de.foellix/AQL-System -->
<dependency>
<groupId>de.foellix</groupId>
<artifactId>AQL-System</artifactId>
<version>1.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>

<developers>
<developer>
<name>Shikun Zhang</name>
<email>[email protected]</email>
<organization>Paderborn University</organization>
<organizationUrl>https://cs.uni-paderborn.de</organizationUrl>
</developer>
<developer>
<name>Felix Pauck</name>
<email>[email protected]</email>
<organization>Paderborn University</organization>
<organizationUrl>https://cs.uni-paderborn.de</organizationUrl>
</developer>
</developers>

<licenses>
<license>
<name>GNU General Public License v3.0</name>
<url>https://www.gnu.org/licenses/gpl-3.0.txt</url>
</license>
</licenses>
</project>
Loading

0 comments on commit 5229425

Please sign in to comment.