Skip to content

Commit 27b9a72

Browse files
committed
Merge pull request #768 from SecUpwN/development
Unchaining WIP-Release v0.1.39-alpha
2 parents d5a5a02 + abe3165 commit 27b9a72

94 files changed

Lines changed: 1582 additions & 735 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2+
# Keystores
3+
keystore.jks
4+
15
# Built application files
26
*.apk
37
*.ap_

.travis.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ android:
3434
- android-23
3535
# Additional components
3636
- extra-android-m2repository
37-
37+
38+
before_install: 'openssl aes-256-cbc -K $encrypted_dc771c3300d2_key -iv $encrypted_dc771c3300d2_iv -in keystore.jks.enc -out keystore.jks -d || true'
39+
40+
3841
script: ./gradlew build check
3942
# Coverity Scan Settings
4043
#-----------------------
@@ -48,3 +51,18 @@ addons:
4851
build_command_prepend: "./gradlew clean"
4952
build_command: "./gradlew build"
5053
branch_pattern: master
54+
55+
before_deploy: cd AIMSICD/build/outputs/apk; md5sum *.apk > md5sums.txt; cd -
56+
57+
deploy:
58+
skip_cleanup: true
59+
provider: releases
60+
api_key:
61+
secure: hWL8k4eTm6RBA6JtY+zL/bFFm+f2eM466kKlHBrywukSXAThgX8VzHVu9I8u9bL1yP2j8R9XHmG+C49Fy8NZ85Hmj5ECFg3dGRhfxAzr3o3deP3Kaeo+LozGhOy/z2PvOPyHS7XqOK8kk8gmoMJ9jvhz+wFAbW9GxhKLYBMn81E=
62+
file:
63+
- AIMSICD/build/outputs/apk/AIMSICD-normal-debug.apk
64+
- AIMSICD/build/outputs/apk/AIMSICD-system-debug.apk
65+
- AIMSICD/build/outputs/apk/md5sums.txt
66+
on:
67+
repo: SecUpwN/Android-IMSI-Catcher-Detector
68+
tags: true

AIMSICD/build.gradle

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
apply plugin: 'checkstyle'
21
apply plugin: 'com.android.application'
32

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

1413
def buildNumber = null
15-
if(isTravis) {
14+
if (isTravis) {
1615
buildNumber = System.getenv("TRAVIS_BUILD_NUMBER")
1716
} else {
1817
buildNumber = System.getenv("BUILDOZER_BUILDNUMBER")
1918
}
2019

21-
version = '0.1.38-alpha'
20+
version = '0.1.39-alpha'
2221

2322
android {
2423
compileSdkVersion 23
2524
buildToolsVersion '23.0.2'
25+
26+
signingConfigs {
27+
releaseSigningConfig {
28+
keyAlias project.hasProperty("aimsicd_key_alias") ? aimsicd_key_alias : "dummy"
29+
keyPassword project.hasProperty("aimsicd_key_password") ? aimsicd_key_password : "dummy"
30+
storeFile file('../keystore.jks')
31+
storePassword project.hasProperty("aimsicd_keystore_password") ? aimsicd_keystore_password : "dummy"
32+
}
33+
}
34+
2635
defaultConfig {
2736
minSdkVersion 16
2837
targetSdkVersion 19 // Do not change: Working Icons on Android 5+
29-
versionCode 38
38+
versionCode 39
3039
testApplicationId "com.SecUpwN.AIMSICD.test"
3140

3241
buildConfigField 'String', 'BUILD_NUMBER', (buildNumber == null ? 'null' : "\"${buildNumber}\"")
@@ -45,6 +54,7 @@ android {
4554
buildConfigField 'String', 'OPEN_CELLID_API_KEY', '"NA"'
4655
minifyEnabled true
4756
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
57+
signingConfig file('../keystore.jks').exists() ? signingConfigs.releaseSigningConfig : null
4858
}
4959
}
5060
compileOptions {
@@ -65,7 +75,6 @@ android {
6575
exclude 'META-INF/NOTICE.txt'
6676
exclude 'META-INF/LICENSE.txt'
6777
}
68-
6978
productFlavors {
7079
system {
7180
versionName "$project.version-system"
@@ -79,43 +88,30 @@ android {
7988
dependencies {
8089
// DO NOT REMOVE BELOW COMMENTED-OUT CODE BEFORE ASKING!
8190
// Please group dependencies for better review like below.
82-
91+
8392
// Android Support Libraries
8493
compile 'com.android.support:appcompat-v7:23.1.1'
85-
94+
8695
// OpenCSV (comma-separated values) parser library
8796
compile 'au.com.bytecode:opencsv:2.4'
88-
97+
8998
// Easy to use Root Shell for Android Applications
9099
compile 'com.github.Stericson:RootShell:d708ae1f0a'
91-
92-
// SLF4J binding for the Android logger
93-
// https://github.com/lp0/slf4j-android
94-
compile 'eu.lp0.slf4j:slf4j-android:1.7.12-0'
95-
compile 'org.slf4j:slf4j-api:1.7.12'
96-
100+
97101
// Dependency Injection for Android
98102
compile 'io.freefair.android-injection:injection:1.0.0-rc2'
99103
compile 'io.freefair.android-injection:logging:1.0.0-rc2'
100104
compile 'io.freefair.android-injection:okhttp:1.0.0-rc2'
101105

102106
// OSMBonusPack library to interact with OpenStreetMap data
103107
compile 'com.github.MKergall.osmbonuspack:OSMBonusPack:v5.6'
104-
108+
105109
// Transition library for animated transition effects
106110
compile 'com.github.kaichunlin.transition:core:0.9.2'
107-
111+
108112
// ShowcaseView library to highlight specific app elements
109113
//compile 'com.github.amlcurran.showcaseview:library:5.3.0'
110114
}
111115

112-
check.dependsOn 'checkstyle'
113-
114-
task checkstyle(type: Checkstyle) {
115-
source 'src'
116-
include '**/*.java'
117116

118-
119-
120-
classpath = files()
121-
}
117+
apply plugin: "io.freefair.android-checkstyle"
Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,62 @@
1-
<?xml version="1.0"?>
2-
<!DOCTYPE module PUBLIC
1+
<?xml version="1.0"?><!DOCTYPE module PUBLIC
32
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
43
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
54

65
<module name="Checker">
7-
<!--module name="NewlineAtEndOfFile"/-->
6+
<module name="NewlineAtEndOfFile" />
87
<module name="FileLength">
9-
<property name="max" value="2500"/>
8+
<property name="max" value="2500" />
109
</module>
1110
<!--module name="FileTabCharacter"/-->
1211

12+
<!-- Name Checks -->
13+
<module name="TreeWalker">
14+
<property name="severity" value="info" />
15+
16+
<module name="ConstantName" />
17+
<module name="LocalFinalVariableName" />
18+
<module name="LocalVariableName" />
19+
<module name="MemberName" />
20+
<module name="MethodName" />
21+
<module name="ParameterName" />
22+
<module name="StaticVariableName" />
23+
<module name="TypeName" />
24+
</module>
1325
<module name="TreeWalker">
14-
15-
<!--module name="ConstantName"/>
16-
<module name="LocalFinalVariableName"/>
17-
<module name="LocalVariableName"/>
18-
<module name="MemberName"/>
19-
<module name="MethodName"/>
20-
<module name="ParameterName"/>
21-
<module name="StaticVariableName"/>
22-
<module name="TypeName"/-->
23-
2426

2527
<!-- Checks for imports -->
2628
<!-- See http://checkstyle.sf.net/config_import.html -->
27-
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
28-
<module name="RedundantImport"/>
29+
<module name="AvoidStarImport"/>
30+
<module name="IllegalImport" /><!-- defaults to sun.* packages -->
31+
<module name="RedundantImport" />
2932
<module name="UnusedImports">
30-
<property name="processJavadoc" value="true"/>
33+
<property name="processJavadoc" value="true" />
3134
</module>
3235

3336
<!-- Modifier Checks -->
3437
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
35-
<module name="ModifierOrder"/>
36-
<module name="RedundantModifier"/>
38+
<module name="ModifierOrder" />
39+
<module name="RedundantModifier" />
3740

38-
<module name="CovariantEquals"/>
39-
<module name="EmptyStatement"/>
41+
<module name="CovariantEquals" />
42+
<module name="EmptyStatement" />
4043

4144

42-
<module name="IllegalInstantiation"/>
45+
<module name="IllegalInstantiation">
46+
<property name="classes" value="java.util.Vector"/>
47+
<property name="classes" value="java.util.Hashtable"/>
48+
</module>
49+
<module name="IllegalType">
50+
<property name="illegalClassNames" value="java.util.Vector"/>
51+
<property name="illegalClassNames" value="java.util.Hashtable"/>
52+
<property name="illegalClassNames" value="java.util.ArrayList"/>
53+
<property name="illegalClassNames" value="java.util.LinkedList"/>
54+
<property name="illegalClassNames" value="android.util.Log"/>
55+
</module>
4356

4457
<!--module name="MissingSwitchDefault"/-->
4558
<!--module name="RedundantThrows"/-->
46-
<module name="SimplifyBooleanExpression"/>
47-
<module name="SimplifyBooleanReturn"/>
59+
<module name="SimplifyBooleanExpression" />
60+
<module name="SimplifyBooleanReturn" />
4861
</module>
4962
</module>

AIMSICD/proguard-rules.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
-dontobfuscate
22
-verbose
3-
-optimizationpasses 5
4-
-dontpreverify
53
-dump class_files.txt
64
-printseeds seeds.txt
75
-printusage unused.txt

AIMSICD/src/main/AndroidManifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@
9797
</intent-filter>
9898
</activity>
9999

100+
<activity
101+
android:name=".activities.AtCommandActivity"
102+
android:label="@string/at_command_title"
103+
android:parentActivityName=".AIMSICD" />
104+
100105
<activity
101106
android:name=".activities.DebugLogs"
102107
android:icon="@drawable/ic_action_settings"

AIMSICD/src/main/java/com/SecUpwN/AIMSICD/AIMSICD.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import com.SecUpwN.AIMSICD.constants.DrawerMenu;
3838
import com.SecUpwN.AIMSICD.drawer.DrawerMenuActivityConfiguration;
3939
import com.SecUpwN.AIMSICD.drawer.NavDrawerItem;
40-
import com.SecUpwN.AIMSICD.fragments.AtCommandFragment;
40+
import com.SecUpwN.AIMSICD.activities.AtCommandActivity;
4141
import com.SecUpwN.AIMSICD.fragments.DetailsContainerFragment;
4242
import com.SecUpwN.AIMSICD.service.AimsicdService;
4343
import com.SecUpwN.AIMSICD.service.CellTracker;
@@ -252,8 +252,8 @@ void selectItem(int position) {
252252
title = getString(R.string.app_name_short);
253253
break;
254254
case DrawerMenu.ID.MAIN.AT_COMMAND_INTERFACE:
255-
getSupportFragmentManager().beginTransaction()
256-
.replace(R.id.content_frame, new AtCommandFragment()).commit();
255+
Intent atCommandIntent = new Intent(this, AtCommandActivity.class);
256+
startActivity(atCommandIntent);
257257
break;
258258
case DrawerMenu.ID.MAIN.DB_VIEWER:
259259
getSupportFragmentManager().beginTransaction()

AIMSICD/src/main/java/com/SecUpwN/AIMSICD/activities/AboutActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,4 @@ public int getDescription() {
228228
return description;
229229
}
230230
}
231-
}
231+
}

AIMSICD/src/main/java/com/SecUpwN/AIMSICD/fragments/AtCommandFragment.java renamed to AIMSICD/src/main/java/com/SecUpwN/AIMSICD/activities/AtCommandActivity.java

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
* LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o
44
* -----------------------------------------------------------
55
*/
6-
package com.SecUpwN.AIMSICD.fragments;
6+
package com.SecUpwN.AIMSICD.activities;
77

8-
import android.app.Activity;
9-
import android.content.Context;
108
import android.os.Bundle;
119
import android.os.Handler;
1210
import android.os.Looper;
@@ -37,7 +35,7 @@
3735
import io.freefair.android.injection.annotation.Inject;
3836
import io.freefair.android.injection.annotation.InjectView;
3937
import io.freefair.android.injection.annotation.XmlLayout;
40-
import io.freefair.android.injection.app.InjectionFragment;
38+
import io.freefair.android.injection.app.InjectionAppCompatActivity;
4139
import io.freefair.android.util.logging.Logger;
4240

4341

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

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

79-
private Context mContext;
8077
private String mSerialDevice;
8178
private int mTimeout;
8279

@@ -110,8 +107,8 @@ public class AtCommandFragment extends InjectionFragment {
110107
private Button atCommandExecute;
111108

112109
@Override
113-
public void onViewCreated(View view, Bundle savedInstanceState) {
114-
super.onViewCreated(view, savedInstanceState);
110+
protected void onCreate(Bundle savedInstanceState) {
111+
super.onCreate(savedInstanceState);
115112
atCommandExecute.setOnClickListener(new btnClick());
116113
mSerialDeviceSpinner.setOnItemSelectedListener(new spinnerListener());
117114
timeoutSpinner.setOnItemSelectedListener(new timeoutSpinnerListener());
@@ -170,12 +167,6 @@ public void onNothingSelected(AdapterView<?> parentView) {
170167
}
171168
}
172169

173-
@Override
174-
public void onAttach(Activity activity) {
175-
super.onAttach(activity);
176-
mContext = activity.getBaseContext();
177-
}
178-
179170
@Override
180171
public void onDestroy() {
181172
super.onDestroy();
@@ -195,16 +186,16 @@ public void onResume() {
195186
mAtCommandLayout.setVisibility(View.VISIBLE);
196187
break;
197188
case ROOT_UNAVAILABLE:
198-
mAtCommandError.setText(mContext.getString(R.string.unable_to_acquire_root_access));
189+
mAtCommandError.setText(R.string.unable_to_acquire_root_access);
199190
break;
200191
case BUSYBOX_UNAVAILABLE:
201-
mAtCommandError.setText(mContext.getString(R.string.unable_to_detect_busybox));
192+
mAtCommandError.setText(R.string.unable_to_detect_busybox);
202193
break;
203194
case SERIAL_INIT_ERROR:
204-
mAtCommandError.setText(mContext.getString(R.string.unknown_error_trying_to_acquire_serial_device));
195+
mAtCommandError.setText(R.string.unknown_error_trying_to_acquire_serial_device);
205196
break;
206197
default:
207-
mAtCommandError.setText(mContext.getString(R.string.unknown_error_initialising_at_command_injector));
198+
mAtCommandError.setText(R.string.unknown_error_initialising_at_command_injector);
208199
break;
209200
}
210201

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

276267
if (!"UNKNOWN".equals(mSerialDevice)) {
@@ -341,7 +332,7 @@ public void commandOutput(int id, String line) {
341332
if (!mSerialDevices.isEmpty()) {
342333
String[] entries = new String[mSerialDevices.size()];
343334
entries = mSerialDevices.toArray(entries);
344-
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(mContext,
335+
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(this,
345336
android.R.layout.simple_spinner_item, entries);
346337
mSerialDeviceSpinner.setAdapter(spinnerAdapter);
347338
mSerialDeviceSpinner.setVisibility(View.VISIBLE);
@@ -447,4 +438,4 @@ private void commandWait(Shell shell, Command cmd) throws Exception {
447438
}
448439
}
449440
}
450-
}
441+
}

AIMSICD/src/main/java/com/SecUpwN/AIMSICD/activities/BaseActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* @author Tor Henning Ueland
2828
*/
29-
public class BaseActivity extends InjectionAppCompatActivity {
29+
public abstract class BaseActivity extends InjectionAppCompatActivity {
3030

3131
@Inject
3232
private Logger log;

0 commit comments

Comments
 (0)