Skip to content

Commit

Permalink
Merge pull request #444 from SecUpwN/development
Browse files Browse the repository at this point in the history
Unchaining WIP-Release v0.1.29-alpha-build-00
  • Loading branch information
SecUpwN committed May 31, 2015
2 parents d876ee5 + 4c42ea3 commit 0d19048
Show file tree
Hide file tree
Showing 35 changed files with 3,043 additions and 77 deletions.
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
# CHANGELOG of 'AIMSICD'
----------------------

#### [31.05.2015 - WIP-Release v0.1.29-alpha-build-00](https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/releases/tag/v0.1.29-alpha-b00)

* Added: New WAP Push Detection and corresponding popup as well as custom strings
* Added: All detection strings will now be added to and loaded from `det_strings.json`
* Fixed: Small typos in German translation removed, shortened OCID notifications

---

#### 28.05.2015 - WIP-Internal v0.1.28-alpha-build-03

* Changed: Many German translation improvements for much easier understanding
* Removed: SMS Detection `try` has been purged since it was not needed anymore
* Updated: Improvements across all translation files for better display of notifications
* Updated: SMS Detection improved and moved some functions in `CustomPopUp.java`
* Updated: Moved some Detection functions to `MiscUtils` and added minor comments
* Moved: Untranslatable strings have been removed from all existing translation files
* Fixed: Padding issue displaying detected SMS only partially has been resolved

---

#### 27.05.2015 - WIP-Internal v0.1.28-alpha-build-02

* Added: Translations into German have been started, many string improvements

---

#### 25.05.2015 - WIP-Internal v0.1.28-alpha-build-01

* Added: New SMS Detection to detect tracking via silent SMS and silent Voice ;-)
* Added: New WIKI entry on how to test your own detection strings in [Special SMS](https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/wiki/Special-SMS)

---

#### [24.05.2015 - WIP-Release v0.1.28-alpha-build-00](https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/releases/tag/v0.1.28-alpha-b00)

* Updated: `CREDITS` now reflect the latest contributions by our developers
Expand Down
11 changes: 10 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.SecUpwN.AIMSICD"
android:versionCode="28"
android:versionName="0.1.28-alpha-b00">
android:versionName="0.1.29-alpha-b00">

<!-- If we ever wanna make this a system app, we can add the following 2 lines above:
coreApp="true"
Expand Down Expand Up @@ -193,6 +193,15 @@
android:label="@string/title_activity_about_pop_up"
android:theme="@android:style/Theme.Dialog">
</activity>

<activity
android:name=".smsdetection.AdvancedUserActivity"
android:label="@string/title_activity_advanced_user" >
</activity>
<activity
android:name=".smsdetection.AdvancedUserSmsActivity"
android:label="@string/title_activity_advanced_user" >
</activity>
</application>

</manifest>
18 changes: 18 additions & 0 deletions app/src/main/assets/det_strings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{"load_detection_strings":[

{"detection_string":"Received short message type 0, Don't display or store it. Send Ack",
"detection_type":"TYPE0"},

{"detection_string":"Received voice mail indicator clear SMS shouldStore=false",
"detection_type":"SILENTVOICE"},

{"detection_string":"SMS TP-PID:0 data coding scheme: 24",
"detection_type":"FLASH"},

{"detection_string":"isTypeZero=true",
"detection_type":"TYPE0"},

{"detection_string":"incoming msg. Mti 0 ProtocolID 0 DCS 0x04 class -1",
"detection_type":"WAPPUSH"}

]}
63 changes: 63 additions & 0 deletions app/src/main/java/com/SecUpwN/AIMSICD/AIMSICD.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
import android.app.ActionBar;
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
Expand Down Expand Up @@ -50,20 +53,30 @@
import com.SecUpwN.AIMSICD.fragments.DetailsContainerFragment;
import com.SecUpwN.AIMSICD.service.AimsicdService;
import com.SecUpwN.AIMSICD.service.CellTracker;
import com.SecUpwN.AIMSICD.smsdetection.SmsDetectionDbAccess;
import com.SecUpwN.AIMSICD.smsdetection.SmsDetectionDbHelper;
import com.SecUpwN.AIMSICD.utils.AsyncResponse;
import com.SecUpwN.AIMSICD.utils.Cell;
import com.SecUpwN.AIMSICD.utils.GeoLocation;
import com.SecUpwN.AIMSICD.utils.Helpers;
import com.SecUpwN.AIMSICD.utils.Icon;
import com.SecUpwN.AIMSICD.utils.LocationServices;
import com.SecUpwN.AIMSICD.utils.MiscUtils;
import com.SecUpwN.AIMSICD.utils.RequestTask;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -85,6 +98,7 @@ public class AIMSICD extends BaseActivity implements AsyncResponse {
private final Context mContext = this;
private boolean mBound;
private SharedPreferences prefs;
private SharedPreferences.OnSharedPreferenceChangeListener prefListener;
private Editor prefsEditor;
private String mDisclaimerAccepted;
private AimsicdService mAimsicdService;
Expand All @@ -96,6 +110,7 @@ public class AIMSICD extends BaseActivity implements AsyncResponse {
private CharSequence mDrawerTitle;
private CharSequence mTitle;
public static ProgressBar mProgressBar;
SmsDetectionDbHelper dbhelper;

//Back press to exit timer
private long mLastPress = 0;
Expand All @@ -109,6 +124,9 @@ public class AIMSICD extends BaseActivity implements AsyncResponse {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

/* add new detection strings if any*/
MiscUtils.refreshDetectionDbStrings(getApplicationContext());

moveData();

getWindow().requestFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
Expand All @@ -117,6 +135,9 @@ public void onCreate(Bundle savedInstanceState) {

setContentView(mNavConf.getMainLayout());

//create the database on first install
dbhelper = new SmsDetectionDbHelper(this);

mDrawerLayout = (DrawerLayout) findViewById(mNavConf.getDrawerLayoutId());
mDrawerList = (ListView) findViewById(mNavConf.getLeftDrawerId());
mActionBar = getActionBar();
Expand Down Expand Up @@ -157,6 +178,17 @@ public void onDrawerOpened(View drawerView) {

prefs = mContext.getSharedPreferences( AimsicdService.SHARED_PREFERENCES_BASENAME, 0);

/* Pref listener to enable sms detection on pref change */
prefListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
if(key.equals(mContext.getString(R.string.adv_user_root_pref_key))){
SmsDetection();
}

}
};
prefs.registerOnSharedPreferenceChangeListener(prefListener);

mDisclaimerAccepted = getResources().getString(R.string.disclaimer_accepted);

if (!prefs.getBoolean(mDisclaimerAccepted, false)) {
Expand Down Expand Up @@ -425,6 +457,15 @@ public void onServiceConnected(ComponentName name, IBinder service) {
if (mAimsicdService.isTrackingCell()) {
mAimsicdService.checkLocationServices();
}

if(!mAimsicdService.isSmsTracking() && prefs.getBoolean(mContext.getString(R.string.adv_user_root_pref_key),false)){
/*Auto Start sms detection here if:
* isSmsTracking = false <---- not running
* root sms enabled = true
*
* */
SmsDetection();
}
}

@Override
Expand Down Expand Up @@ -544,10 +585,32 @@ public void onBackPressed() {
} else {
onBackPressedToast.cancel();
super.onBackPressed();
try {
if(mAimsicdService.isSmsTracking()) {
mAimsicdService.stopSmsTracking();
}
}catch (Exception ee){System.out.println("Error Stopping sms detection");}
finish();
}
}


private void SmsDetection()
{
boolean root_sms = prefs.getBoolean(mContext.getString(R.string.adv_user_root_pref_key),false);//default is false

if(root_sms && !mAimsicdService.isSmsTracking()){
mAimsicdService.startSmsTracking();
Helpers.msgShort(mContext,"Sms Detection Started");
Log.i(TAG,"Sms Detection Thread Started");
}else if(!root_sms && mAimsicdService.isSmsTracking()) {
mAimsicdService.stopSmsTracking();
Helpers.msgShort(mContext, "Sms Detection Stopped");
Log.i(TAG, "Sms Detection Thread Stopped");
}

}

/**
* Show the Map Viewer Activity
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
import android.widget.TextView;

import com.SecUpwN.AIMSICD.R;
import com.SecUpwN.AIMSICD.utils.MiscUtils;

public class CustomPopUp extends Activity {
TextView tv_popup_title,about_tv_status,about_tv_data;
ImageView about_icon_holder;
int mode = 0; //default
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -49,7 +51,6 @@ protected void onCreate(Bundle savedInstanceState) {
about_tv_data = (TextView)findViewById(R.id.about_tv_data);
tv_popup_title = (TextView)findViewById(R.id.tv_popup_title);

int mode = 0; //default
Bundle extras = getIntent().getExtras();
if (extras != null) {
mode = extras.getInt("display_mode");
Expand Down Expand Up @@ -100,6 +101,43 @@ protected void onCreate(Bundle savedInstanceState) {
getResources().getString(R.string.detail_info_run)
,getResources().getDrawable(R.drawable.sense_skull));
break;
case 6:
MiscUtils.showNotification(getApplicationContext(),
getResources().getString(R.string.alert_silent_sms_detected),
getResources().getString(R.string.app_name_short)+ " - "+getResources().getString(R.string.typezero_header),
R.drawable.sense_danger,true);
createPopUp(
getResources().getString(R.string.typezero_title),
getResources().getString(R.string.typezero_header),
getResources().getString(R.string.typezero_data)
,getResources().getDrawable(R.drawable.sense_danger));
break;

case 7:
MiscUtils.showNotification(getApplicationContext(),
getResources().getString(R.string.alert_silent_voice_sms_detected),
getResources().getString(R.string.app_name_short)+" - "+getResources().getString(R.string.typevoice_header),
R.drawable.sense_danger,true);

createPopUp(
getResources().getString(R.string.typevoice_title),
getResources().getString(R.string.typevoice_header),
getResources().getString(R.string.typevoice_data)
,getResources().getDrawable(R.drawable.sense_danger));
break;

case 8:
MiscUtils.showNotification(getApplicationContext(),
getResources().getString(R.string.alert_silent_wap_sms_detected),
getResources().getString(R.string.app_name_short)+" - "+getResources().getString(R.string.typewap_header),
R.drawable.sense_danger,true);

createPopUp(
getResources().getString(R.string.typevoice_title),
getResources().getString(R.string.typewap_header),
getResources().getString(R.string.typewap_data)
,getResources().getDrawable(R.drawable.sense_danger));
break;

}
}
Expand All @@ -125,6 +163,12 @@ public void createPopUp(String title,String header,String data,Drawable icon){
public boolean onTouchEvent(MotionEvent event) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
if(mode == 6 || mode == 7 || mode == 8) {
MiscUtils.showNotification(getApplicationContext(),
getResources().getString(R.string.app_name_short),
getResources().getString(R.string.app_name_short) + " - " + getResources().getString(R.string.status_good),
R.drawable.sense_ok, false);
}
finish();
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public enum StatesDbViewer {
DEFAULT_MCC_LOCATIONS(R.string.default_mmc_locations),
SILENT_SMS(R.string.silent_sms),
MEASURED_SIGNAL_STRENGTHS(R.string.measured_signal_strengths),
EVENT_LOG(R.string.eventlog);
EVENT_LOG(R.string.eventlog),
DETECTION_STRINGS(R.string.detection_strings);
//TODO DetectionFlags
// DETECTION_FLAGS(R.string.detection_flags)

Expand Down
Loading

0 comments on commit 0d19048

Please sign in to comment.