Skip to content

Commit ea066f9

Browse files
authored
Merge pull request #3 from diegoflassa/compatibility-win
Compatibility win
2 parents 253f00a + c5e7ff3 commit ea066f9

File tree

87 files changed

+5474
-177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+5474
-177
lines changed

Readme.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#Android Vulnerability Test Suite
22

3-
Download the official VTS for Android app from Google Play [here](https://play.google.com/store/apps/details?id=com.nowsecure.android.vts).
3+
Download from [Github](https://github.com/nowsecure/android-vts/releases)
44

5-
** Beta Testers needed **
6-
A beta version of VTS is available through Play as well. [Register for beta](https://play.google.com/apps/testing/com.nowsecure.android.vts). Beta testers capable of filing Github issues are greatly appreciated!
5+
UPDATE 2015/12/15: AndroidVTS is currently not available in the Google Play™ store app, [more info here](https://www.nowsecure.com/blog/2015/12/15/appealing-google-play-s-suspension-of-the-vts-for-android-app/).
76

87
## Overview
98
This tool was meant to show the end user the attack surface that a given device is susceptible to. In implementing these checks we attempt to minimize or eliminate both false positives/false negatives without negatively affecting system stability.
@@ -34,6 +33,9 @@ A list of current bug checks:
3433
- [Stagefright - CVE-2015-6602](https://blog.zimperium.com/zimperium-zlabs-is-raising-the-volume-new-vulnerability-processing-mp3mp4-media/)
3534
- [Samsung Remote Code Execution as System] (https://code.google.com/p/google-security-research/issues/detail?id=489)
3635
- [CVE-2015-6608](https://groups.google.com/forum/#!topic/android-security-updates/GwZn7sixask)
36+
- [CVE-2015-7414](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-1474)
37+
- [CVE-2015-1528](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-1528)
38+
- [CVE-2015-6616](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-6616)
3739

3840
## Previous work
3941
There have been attempts before to solve this issue. [xray.io](http://www.xray.io/) Xray works by actually attempting the exploit which doesn't satisfy our system stability constraint. There also exist other applications which attempt to determine a devices attack surface by simply using a lookup based on Android verison/build information. This causes both false negatives and false positives. Imagine the case where an OEM has back ported a fix to a device, but the check solely relies on an Android device; false positive. The case where an OEM upgrades to an Android version/kernel version which includes patches, but manages to break them causes the case of a false negative.
@@ -44,6 +46,8 @@ There have been attempts before to solve this issue. [xray.io](http://www.xray.i
4446

4547
Some parts of VTS require that native executables be used. Currently the build system does not support this. If your contribution requires rebuilding of these assets, please denote this in the pull req and I will build the asset after merging the PR.
4648

49+
If changing an existing test, you must set `mTestWasChanged` to true in `ApplicationUpdateBroadcastReceiver`. This notifies the user that an existing test has changed.
50+
4751
## Building
4852

4953
You can import this project into AndroidStudio or use gradle from the CLI. You need the Android SDK and NDK installed to properly build this project.

app/app.iml

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="androidVTS" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
2+
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
33
<component name="FacetManager">
44
<facet type="android-gradle" name="Android-Gradle">
55
<configuration>
@@ -9,13 +9,9 @@
99
<facet type="android" name="Android">
1010
<configuration>
1111
<option name="SELECTED_BUILD_VARIANT" value="debug" />
12-
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
1312
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
1413
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
15-
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
16-
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
1714
<afterSyncTasks>
18-
<task>generateDebugAndroidTestSources</task>
1915
<task>generateDebugSources</task>
2016
</afterSyncTasks>
2117
<option name="ALLOW_USER_CONFIGURATION" value="false" />
@@ -26,84 +22,91 @@
2622
</configuration>
2723
</facet>
2824
</component>
29-
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
25+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
3026
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
31-
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
27+
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
3228
<exclude-output />
3329
<content url="file://$MODULE_DIR$">
3430
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
3531
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
3632
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
3733
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
34+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
3835
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
3936
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
4037
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
4138
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
4239
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
4340
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
41+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
4442
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
4543
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
4644
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
4745
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
4846
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
4947
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
5048
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
51-
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
5249
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
50+
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
51+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
52+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
53+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
54+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
55+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
56+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
57+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
5358
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
5459
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
5560
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
5661
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
5762
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
5863
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
64+
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
5965
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
6066
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
6167
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
6268
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
6369
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
64-
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
6570
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
66-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
67-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
68-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
69-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
70-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
71-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
72-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
73-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/jars" />
74-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/cardview-v7/23.1.0/jars" />
75-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/23.1.0/jars" />
76-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.0/jars" />
77-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/jars" />
78-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.github.afollestad.material-dialogs/core/0.8.5.0/jars" />
79-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/me.zhanghai.android.materialprogressbar/library/1.1.4/jars" />
71+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
72+
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
73+
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
74+
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
75+
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
76+
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
77+
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
78+
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
79+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
8080
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
81-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
82-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
83-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
84-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
8581
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
86-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
87-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
88-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
8982
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
9083
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
9184
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
9285
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
93-
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
9486
</content>
9587
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
9688
<orderEntry type="sourceFolder" forTests="false" />
97-
<orderEntry type="library" exported="" name="xz-1.2" level="project" />
98-
<orderEntry type="library" exported="" name="recyclerview-v7-23.1.0" level="project" />
99-
<orderEntry type="library" exported="" name="support-annotations-23.1.0" level="project" />
100-
<orderEntry type="library" exported="" name="appcompat-v7-23.1.0" level="project" />
101-
<orderEntry type="library" exported="" name="design-23.1.0" level="project" />
102-
<orderEntry type="library" exported="" name="library-1.1.4" level="project" />
103-
<orderEntry type="library" exported="" name="core-0.8.5.0" level="project" />
104-
<orderEntry type="library" exported="" name="commons-io-2.4" level="project" />
105-
<orderEntry type="library" exported="" name="cardview-v7-23.1.0" level="project" />
106-
<orderEntry type="library" exported="" name="support-v4-23.1.0" level="project" />
107-
<orderEntry type="library" exported="" name="commons-compress-1.5" level="project" />
89+
<orderEntry type="library" exported="" name="Gradle: com.android.support:support-vector-drawable-23.2.0" level="project" />
90+
<orderEntry type="library" exported="" name="Gradle: com.squareup.retrofit2:retrofit:2.0.0-beta3@jar" level="project" />
91+
<orderEntry type="library" exported="" name="Gradle: com.android.support:support-annotations:23.2.0@jar" level="project" />
92+
<orderEntry type="library" exported="" name="Gradle: com.android.support:recyclerview-v7-23.2.0" level="project" />
93+
<orderEntry type="library" exported="" name="Gradle: org.apache.commons:commons-compress:1.5@jar" level="project" />
94+
<orderEntry type="library" exported="" name="Gradle: com.android.support:appcompat-v7-23.2.0" level="project" />
95+
<orderEntry type="library" exported="" name="Gradle: org.tukaani:xz:1.2@jar" level="project" />
96+
<orderEntry type="library" exported="" name="Gradle: com.github.paolorotolo:appintro-3.3.0" level="project" />
97+
<orderEntry type="library" exported="" name="Gradle: commons-io:commons-io:2.4@jar" level="project" />
98+
<orderEntry type="library" exported="" name="Gradle: com.squareup.retrofit2:adapter-rxjava:2.0.0-beta3@jar" level="project" />
99+
<orderEntry type="library" exported="" name="Gradle: com.squareup.retrofit2:converter-gson:2.0.0-beta3@jar" level="project" />
100+
<orderEntry type="library" exported="" name="Gradle: me.zhanghai.android.materialprogressbar:library-1.1.4" level="project" />
101+
<orderEntry type="library" exported="" name="Gradle: com.android.support:cardview-v7-23.2.0" level="project" />
102+
<orderEntry type="library" exported="" name="Gradle: com.squareup.okio:okio:1.6.0@jar" level="project" />
103+
<orderEntry type="library" exported="" name="Gradle: com.android.support:support-v4-23.2.0" level="project" />
104+
<orderEntry type="library" exported="" name="Gradle: com.android.support:animated-vector-drawable-23.2.0" level="project" />
105+
<orderEntry type="library" exported="" name="Gradle: io.reactivex:rxandroid-1.0.1" level="project" />
106+
<orderEntry type="library" exported="" name="Gradle: com.android.support:design-23.2.0" level="project" />
107+
<orderEntry type="library" exported="" name="Gradle: io.reactivex:rxjava:1.1.0@jar" level="project" />
108+
<orderEntry type="library" exported="" name="Gradle: com.squareup.okhttp3:okhttp:3.0.0-RC1@jar" level="project" />
109+
<orderEntry type="library" exported="" name="Gradle: com.google.code.gson:gson:2.4@jar" level="project" />
110+
<orderEntry type="library" exported="" name="Gradle: com.github.afollestad.material-dialogs:core-0.8.5.3" level="project" />
108111
</component>
109112
</module>

app/build.gradle

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,25 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion 23
5-
buildToolsVersion "23.0.1"
5+
buildToolsVersion "25.0.0"
66

77
defaultConfig {
88
applicationId "com.nowsecure.android.vts"
99
minSdkVersion 15
1010
targetSdkVersion 23
11-
versionCode 9
12-
versionName "v.9"
11+
versionCode 13
12+
versionName "v.13"
1313
}
1414

1515
buildTypes {
1616
release {
1717
minifyEnabled false
1818
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1919
}
20+
21+
debug {
22+
applicationIdSuffix ".debug"
23+
}
2024
}
2125

2226
sourceSets.main {
@@ -40,35 +44,59 @@ repositories {
4044

4145
dependencies {
4246
compile fileTree(dir: 'libs', include: ['*.jar'])
43-
compile 'com.android.support:appcompat-v7:23.1.0'
44-
compile 'org.apache.commons:commons-compress:1.5'
47+
compile 'com.android.support:appcompat-v7:23.2.0'
48+
compile 'com.android.support:cardview-v7:23.2.0'
49+
compile 'com.android.support:design:23.2.0'
50+
compile 'com.github.paolorotolo:appintro:3.3.0'
51+
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta3'
52+
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'
53+
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
4554
compile 'commons-io:commons-io:2.4'
46-
compile 'com.android.support:cardview-v7:23.1.0'
47-
compile 'com.android.support:design:23.1.0'
48-
compile('com.github.afollestad.material-dialogs:core:0.8.5.0@aar') {
55+
compile 'io.reactivex:rxandroid:1.0.1'
56+
compile 'org.apache.commons:commons-compress:1.5'
57+
compile('com.github.afollestad.material-dialogs:core:0.8.5.3@aar') {
4958
transitive = true
5059
}
5160
}
5261

5362
Properties properties = new Properties()
5463
properties.load(project.rootProject.file('local.properties').newDataInputStream())
55-
def ndkDir = properties.getProperty('ndk.dir')
64+
ext.ndkDir = properties.getProperty('ndk.dir')
65+
66+
import org.apache.tools.ant.taskdefs.condition.Os
67+
def getNDKCommand() {
68+
if (ext.ndkDir == null) {
69+
ext.ndkDir = file(System.getenv('NDK_ROOT'))
70+
}
71+
72+
if (ext.ndkDir == null) {
73+
def gradle_project_root = project.rootProject.rootDir
74+
throw new GradleException("NDK is not configured. Make sure there is a local.properties " +
75+
"file with an ndk.dir entry in the directory ${gradle_project_root}, or set the " +
76+
"ANDROID_NDK envrionment variable")
77+
}
78+
79+
def ndkBuildExecutable = new File(ext.ndkDir, 'ndk-build')
80+
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
81+
ndkBuildExecutable= new File(ext.ndkDir, 'ndk-build.cmd')
82+
}
83+
if (!ndkBuildExecutable.exists()) {
84+
throw new GradleException("Could not find ndk-build. The configured NDK directory ${ndkDir} may not be correct.")
85+
}
86+
return ndkBuildExecutable;
87+
}
5688

5789
task buildNative(type: Exec, description: 'Compile JNI source via NDK') {
58-
commandLine "$ndkDir/ndk-build",
59-
'-C', file('src/main/jni').absolutePath, // Change src/main/jni the relative path to your jni source
60-
'-j', Runtime.runtime.availableProcessors()
90+
commandLine(getNDKCommand(), '-j', Runtime.runtime.availableProcessors(), '-C', file('src/main/jni').absolutePath)
6191
}
6292

6393
task cleanNative(type: Exec, description: 'Clean JNI object files') {
64-
commandLine "$ndkDir/ndk-build",
65-
'-C', file('src/main/jni').absolutePath, // Change src/main/jni the relative path to your jni source
66-
'clean'
94+
commandLine(getNDKCommand(), '-C', file('src/main/jni').absolutePath, 'clean')
6795
}
6896

6997
clean.dependsOn 'cleanNative'
7098

7199

72100
tasks.withType(JavaCompile) {
73101
compileTask -> compileTask.dependsOn buildNative
74-
}
102+
}

0 commit comments

Comments
 (0)