Skip to content

Commit

Permalink
Merge pull request #768 from SecUpwN/development
Browse files Browse the repository at this point in the history
Unchaining WIP-Release v0.1.39-alpha
  • Loading branch information
SecUpwN committed Feb 14, 2016
2 parents d5a5a02 + abe3165 commit 27b9a72
Show file tree
Hide file tree
Showing 94 changed files with 1,582 additions and 735 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -1,3 +1,7 @@

# Keystores
keystore.jks

# Built application files
*.apk
*.ap_
Expand Down
20 changes: 19 additions & 1 deletion .travis.yml
Expand Up @@ -34,7 +34,10 @@ android:
- android-23
# Additional components
- extra-android-m2repository


before_install: 'openssl aes-256-cbc -K $encrypted_dc771c3300d2_key -iv $encrypted_dc771c3300d2_iv -in keystore.jks.enc -out keystore.jks -d || true'


script: ./gradlew build check
# Coverity Scan Settings
#-----------------------
Expand All @@ -48,3 +51,18 @@ addons:
build_command_prepend: "./gradlew clean"
build_command: "./gradlew build"
branch_pattern: master

before_deploy: cd AIMSICD/build/outputs/apk; md5sum *.apk > md5sums.txt; cd -

deploy:
skip_cleanup: true
provider: releases
api_key:
secure: hWL8k4eTm6RBA6JtY+zL/bFFm+f2eM466kKlHBrywukSXAThgX8VzHVu9I8u9bL1yP2j8R9XHmG+C49Fy8NZ85Hmj5ECFg3dGRhfxAzr3o3deP3Kaeo+LozGhOy/z2PvOPyHS7XqOK8kk8gmoMJ9jvhz+wFAbW9GxhKLYBMn81E=
file:
- AIMSICD/build/outputs/apk/AIMSICD-normal-debug.apk
- AIMSICD/build/outputs/apk/AIMSICD-system-debug.apk
- AIMSICD/build/outputs/apk/md5sums.txt
on:
repo: SecUpwN/Android-IMSI-Catcher-Detector
tags: true
46 changes: 21 additions & 25 deletions AIMSICD/build.gradle
@@ -1,4 +1,3 @@
apply plugin: 'checkstyle'
apply plugin: 'com.android.application'

def gitSha = null
Expand All @@ -12,21 +11,31 @@ def isCi = "true".equals(System.getenv("CI"))
def isTravis = "true".equals(System.getenv("TRAVIS"))

def buildNumber = null
if(isTravis) {
if (isTravis) {
buildNumber = System.getenv("TRAVIS_BUILD_NUMBER")
} else {
buildNumber = System.getenv("BUILDOZER_BUILDNUMBER")
}

version = '0.1.38-alpha'
version = '0.1.39-alpha'

android {
compileSdkVersion 23
buildToolsVersion '23.0.2'

signingConfigs {
releaseSigningConfig {
keyAlias project.hasProperty("aimsicd_key_alias") ? aimsicd_key_alias : "dummy"
keyPassword project.hasProperty("aimsicd_key_password") ? aimsicd_key_password : "dummy"
storeFile file('../keystore.jks')
storePassword project.hasProperty("aimsicd_keystore_password") ? aimsicd_keystore_password : "dummy"
}
}

defaultConfig {
minSdkVersion 16
targetSdkVersion 19 // Do not change: Working Icons on Android 5+
versionCode 38
versionCode 39
testApplicationId "com.SecUpwN.AIMSICD.test"

buildConfigField 'String', 'BUILD_NUMBER', (buildNumber == null ? 'null' : "\"${buildNumber}\"")
Expand All @@ -45,6 +54,7 @@ android {
buildConfigField 'String', 'OPEN_CELLID_API_KEY', '"NA"'
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig file('../keystore.jks').exists() ? signingConfigs.releaseSigningConfig : null
}
}
compileOptions {
Expand All @@ -65,7 +75,6 @@ android {
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
}

productFlavors {
system {
versionName "$project.version-system"
Expand All @@ -79,43 +88,30 @@ android {
dependencies {
// DO NOT REMOVE BELOW COMMENTED-OUT CODE BEFORE ASKING!
// Please group dependencies for better review like below.

// Android Support Libraries
compile 'com.android.support:appcompat-v7:23.1.1'

// OpenCSV (comma-separated values) parser library
compile 'au.com.bytecode:opencsv:2.4'

// Easy to use Root Shell for Android Applications
compile 'com.github.Stericson:RootShell:d708ae1f0a'

// SLF4J binding for the Android logger
// https://github.com/lp0/slf4j-android
compile 'eu.lp0.slf4j:slf4j-android:1.7.12-0'
compile 'org.slf4j:slf4j-api:1.7.12'


// Dependency Injection for Android
compile 'io.freefair.android-injection:injection:1.0.0-rc2'
compile 'io.freefair.android-injection:logging:1.0.0-rc2'
compile 'io.freefair.android-injection:okhttp:1.0.0-rc2'

// OSMBonusPack library to interact with OpenStreetMap data
compile 'com.github.MKergall.osmbonuspack:OSMBonusPack:v5.6'

// Transition library for animated transition effects
compile 'com.github.kaichunlin.transition:core:0.9.2'

// ShowcaseView library to highlight specific app elements
//compile 'com.github.amlcurran.showcaseview:library:5.3.0'
}

check.dependsOn 'checkstyle'

task checkstyle(type: Checkstyle) {
source 'src'
include '**/*.java'



classpath = files()
}
apply plugin: "io.freefair.android-checkstyle"
61 changes: 37 additions & 24 deletions AIMSICD/config/checkstyle/checkstyle.xml
@@ -1,49 +1,62 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
<?xml version="1.0"?><!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">

<module name="Checker">
<!--module name="NewlineAtEndOfFile"/-->
<module name="NewlineAtEndOfFile" />
<module name="FileLength">
<property name="max" value="2500"/>
<property name="max" value="2500" />
</module>
<!--module name="FileTabCharacter"/-->

<!-- Name Checks -->
<module name="TreeWalker">
<property name="severity" value="info" />

<module name="ConstantName" />
<module name="LocalFinalVariableName" />
<module name="LocalVariableName" />
<module name="MemberName" />
<module name="MethodName" />
<module name="ParameterName" />
<module name="StaticVariableName" />
<module name="TypeName" />
</module>
<module name="TreeWalker">

<!--module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/-->


<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
<module name="AvoidStarImport"/>
<module name="IllegalImport" /><!-- defaults to sun.* packages -->
<module name="RedundantImport" />
<module name="UnusedImports">
<property name="processJavadoc" value="true"/>
<property name="processJavadoc" value="true" />
</module>

<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<module name="ModifierOrder" />
<module name="RedundantModifier" />

<module name="CovariantEquals"/>
<module name="EmptyStatement"/>
<module name="CovariantEquals" />
<module name="EmptyStatement" />


<module name="IllegalInstantiation"/>
<module name="IllegalInstantiation">
<property name="classes" value="java.util.Vector"/>
<property name="classes" value="java.util.Hashtable"/>
</module>
<module name="IllegalType">
<property name="illegalClassNames" value="java.util.Vector"/>
<property name="illegalClassNames" value="java.util.Hashtable"/>
<property name="illegalClassNames" value="java.util.ArrayList"/>
<property name="illegalClassNames" value="java.util.LinkedList"/>
<property name="illegalClassNames" value="android.util.Log"/>
</module>

<!--module name="MissingSwitchDefault"/-->
<!--module name="RedundantThrows"/-->
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />
</module>
</module>
2 changes: 0 additions & 2 deletions AIMSICD/proguard-rules.txt
@@ -1,7 +1,5 @@
-dontobfuscate
-verbose
-optimizationpasses 5
-dontpreverify
-dump class_files.txt
-printseeds seeds.txt
-printusage unused.txt
Expand Down
5 changes: 5 additions & 0 deletions AIMSICD/src/main/AndroidManifest.xml
Expand Up @@ -97,6 +97,11 @@
</intent-filter>
</activity>

<activity
android:name=".activities.AtCommandActivity"
android:label="@string/at_command_title"
android:parentActivityName=".AIMSICD" />

<activity
android:name=".activities.DebugLogs"
android:icon="@drawable/ic_action_settings"
Expand Down
6 changes: 3 additions & 3 deletions AIMSICD/src/main/java/com/SecUpwN/AIMSICD/AIMSICD.java
Expand Up @@ -37,7 +37,7 @@
import com.SecUpwN.AIMSICD.constants.DrawerMenu;
import com.SecUpwN.AIMSICD.drawer.DrawerMenuActivityConfiguration;
import com.SecUpwN.AIMSICD.drawer.NavDrawerItem;
import com.SecUpwN.AIMSICD.fragments.AtCommandFragment;
import com.SecUpwN.AIMSICD.activities.AtCommandActivity;
import com.SecUpwN.AIMSICD.fragments.DetailsContainerFragment;
import com.SecUpwN.AIMSICD.service.AimsicdService;
import com.SecUpwN.AIMSICD.service.CellTracker;
Expand Down Expand Up @@ -252,8 +252,8 @@ void selectItem(int position) {
title = getString(R.string.app_name_short);
break;
case DrawerMenu.ID.MAIN.AT_COMMAND_INTERFACE:
getSupportFragmentManager().beginTransaction()
.replace(R.id.content_frame, new AtCommandFragment()).commit();
Intent atCommandIntent = new Intent(this, AtCommandActivity.class);
startActivity(atCommandIntent);
break;
case DrawerMenu.ID.MAIN.DB_VIEWER:
getSupportFragmentManager().beginTransaction()
Expand Down
Expand Up @@ -228,4 +228,4 @@ public int getDescription() {
return description;
}
}
}
}
Expand Up @@ -3,10 +3,8 @@
* LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o
* -----------------------------------------------------------
*/
package com.SecUpwN.AIMSICD.fragments;
package com.SecUpwN.AIMSICD.activities;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
Expand Down Expand Up @@ -37,7 +35,7 @@
import io.freefair.android.injection.annotation.Inject;
import io.freefair.android.injection.annotation.InjectView;
import io.freefair.android.injection.annotation.XmlLayout;
import io.freefair.android.injection.app.InjectionFragment;
import io.freefair.android.injection.app.InjectionAppCompatActivity;
import io.freefair.android.util.logging.Logger;


Expand All @@ -63,8 +61,8 @@
* [ ] Need a "no" timeout to watch output for while, or let's make it 10 minutes.
* Perhaps with a manual stop?
*/
@XmlLayout(R.layout.at_command_fragment)
public class AtCommandFragment extends InjectionFragment {
@XmlLayout(R.layout.activity_at_command)
public class AtCommandActivity extends InjectionAppCompatActivity {

@Inject
private Logger log;
Expand All @@ -76,7 +74,6 @@ public class AtCommandFragment extends InjectionFragment {
private static final int BUSYBOX_UNAVAILABLE = 103;
private static final List<String> mSerialDevices = new ArrayList<>();

private Context mContext;
private String mSerialDevice;
private int mTimeout;

Expand Down Expand Up @@ -110,8 +107,8 @@ public class AtCommandFragment extends InjectionFragment {
private Button atCommandExecute;

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
atCommandExecute.setOnClickListener(new btnClick());
mSerialDeviceSpinner.setOnItemSelectedListener(new spinnerListener());
timeoutSpinner.setOnItemSelectedListener(new timeoutSpinnerListener());
Expand Down Expand Up @@ -170,12 +167,6 @@ public void onNothingSelected(AdapterView<?> parentView) {
}
}

@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
mContext = activity.getBaseContext();
}

@Override
public void onDestroy() {
super.onDestroy();
Expand All @@ -195,16 +186,16 @@ public void onResume() {
mAtCommandLayout.setVisibility(View.VISIBLE);
break;
case ROOT_UNAVAILABLE:
mAtCommandError.setText(mContext.getString(R.string.unable_to_acquire_root_access));
mAtCommandError.setText(R.string.unable_to_acquire_root_access);
break;
case BUSYBOX_UNAVAILABLE:
mAtCommandError.setText(mContext.getString(R.string.unable_to_detect_busybox));
mAtCommandError.setText(R.string.unable_to_detect_busybox);
break;
case SERIAL_INIT_ERROR:
mAtCommandError.setText(mContext.getString(R.string.unknown_error_trying_to_acquire_serial_device));
mAtCommandError.setText(R.string.unknown_error_trying_to_acquire_serial_device);
break;
default:
mAtCommandError.setText(mContext.getString(R.string.unknown_error_initialising_at_command_injector));
mAtCommandError.setText(R.string.unknown_error_initialising_at_command_injector);
break;
}

Expand Down Expand Up @@ -270,7 +261,7 @@ private int initSerialDevice() {
// THIS IS A BAD IDEA TODO: Consider removing
// Use RIL Serial Device details from the System Property
try {
String rilDevice = Helpers.getSystemProp(mContext, "rild.libargs", "UNKNOWN");
String rilDevice = Helpers.getSystemProp(this, "rild.libargs", "UNKNOWN");
mSerialDevice = ("UNKNOWN".equals(rilDevice) ? rilDevice : rilDevice.substring(3));

if (!"UNKNOWN".equals(mSerialDevice)) {
Expand Down Expand Up @@ -341,7 +332,7 @@ public void commandOutput(int id, String line) {
if (!mSerialDevices.isEmpty()) {
String[] entries = new String[mSerialDevices.size()];
entries = mSerialDevices.toArray(entries);
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(mContext,
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(this,
android.R.layout.simple_spinner_item, entries);
mSerialDeviceSpinner.setAdapter(spinnerAdapter);
mSerialDeviceSpinner.setVisibility(View.VISIBLE);
Expand Down Expand Up @@ -447,4 +438,4 @@ private void commandWait(Shell shell, Command cmd) throws Exception {
}
}
}
}
}
Expand Up @@ -26,7 +26,7 @@
*
* @author Tor Henning Ueland
*/
public class BaseActivity extends InjectionAppCompatActivity {
public abstract class BaseActivity extends InjectionAppCompatActivity {

@Inject
private Logger log;
Expand Down

0 comments on commit 27b9a72

Please sign in to comment.