Skip to content

Commit

Permalink
Merge pull request #437 from SecUpwN/development
Browse files Browse the repository at this point in the history
Unchaining WIP-Release v0.1.28-alpha-build-00
  • Loading branch information
SecUpwN committed May 24, 2015
2 parents 8cc506f + 15515cf commit d876ee5
Show file tree
Hide file tree
Showing 20 changed files with 261 additions and 133 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
# CHANGELOG of 'AIMSICD'
----------------------

#### [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
* Changed: Tables in the `Database Viewer` will now be loaded automatically
* Added: New overlay BTS map legend now clarifies meanings of the map pins

---

#### 22.05.2015 - WIP-Internal v0.1.27-alpha-build-03

* Moved: App data as been moved to new location (will update automatically)

---

#### 21.05.2015 - WIP-Internal v0.1.27-alpha-build-02

* Fixed: Strange NPE related to `TelephonyManager.getNeighboringCellInfo()`

---

#### 15.05.2015 - WIP-Internal v0.1.27-alpha-build-01

* Changed: Links within our app have been changed to permanent `HEAD` links
* Added: Donations to encourage developers are now possible via [Bountysource](https://www.bountysource.com/teams/android-imsi-catcher-detector/issues)

---

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

* Removed: Buggy `Toast Extender` for making toasts last longer than 3.5 seconds
Expand Down
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ Can't code (yet)? No problem, we love you too!

---

#### DONATING

Thank you for encouraging our developers!

* Feel invited to donate using [this guide](https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/wiki/Donations).

---

#### SEEKING

Special positions we are currently seeking skilled people for:
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
### Android IMSI-Catcher Detector

[![Build Status](https://travis-ci.org/SecUpwN/Android-IMSI-Catcher-Detector.svg)](https://travis-ci.org/SecUpwN/Android-IMSI-Catcher-Detector) [![Development Status](http://img.shields.io/badge/Development_Status-ALPHA-brightgreen.svg)](https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/wiki/Development-Status) [![GooglePlay](http://img.shields.io/badge/GooglePlay-NOT%20SUPPORTED-brightgreen.svg)](https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/wiki/FAQ#q-why-wont-you-upload-your-app-to-the-google-play-store) [![CoverityScan](https://scan.coverity.com/projects/3346/badge.svg)](https://scan.coverity.com/projects/3346)
[![BuildStatus](https://travis-ci.org/SecUpwN/Android-IMSI-Catcher-Detector.svg)](https://travis-ci.org/SecUpwN/Android-IMSI-Catcher-Detector) [![DevelopmentStatus](http://img.shields.io/badge/Development_Status-ALPHA-brightgreen.svg)](https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/wiki/Development-Status) [![CoverityScan](https://scan.coverity.com/projects/3346/badge.svg)](https://scan.coverity.com/projects/3346)
[![Bountysource](https://www.bountysource.com/badge/team?team_id=40338&style=bounties_received)](https://www.bountysource.com/teams/android-imsi-catcher-detector/issues?utm_source=Android%20IMSI-Catcher%20Detector&utm_medium=shield&utm_campaign=bounties_received)

--
AIMSICD is an app to detect [IMSI-Catchers](https://en.wikipedia.org/wiki/IMSI-catcher). IMSI-Catchers are false mobile towers (base stations) acting between the target mobile phone(s) and the real towers of service providers. As such they are considered a Man-In-The-Middle (MITM) attack. In the USA the IMSI-Catcher technology is known under the name "[StingRay](https://en.wikipedia.org/wiki/Stingray_phone_tracker)". Find out more in our [WIKI](https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/wiki).

Expand All @@ -14,7 +16,9 @@ AIMSICD is an app to detect [IMSI-Catchers](https://en.wikipedia.org/wiki/IMSI-c

---

[![Aptoide](https://spideroak.com/share/IFEU2U2JINCA/GitHub/home/SecUpwN/SpiderOak/MISC/external/Aptoide.png)](http://aimsicd.store.aptoide.com/ "NOTE: Installs Aptoide-App first!") [![GitHub](https://spideroak.com/share/IFEU2U2JINCA/GitHub/home/SecUpwN/SpiderOak/MISC/external/GitHub.png)](https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/releases "GitHub Releases") [![F-Droid](https://spideroak.com/share/IFEU2U2JINCA/GitHub/home/SecUpwN/SpiderOak/MISC/external/F-Droid.png)](https://f-droid.org/repository/browse/?fdid=com.SecUpwN.AIMSICD "F-Droid Store") [![Twitter](https://spideroak.com/share/IFEU2U2JINCA/GitHub/home/SecUpwN/SpiderOak/MISC/external/Twitter.png)](https://twitter.com/AIMSICD "Official Twitter-Account")
[![Aptoide](https://spideroak.com/share/IFEU2U2JINCA/GitHub/home/SecUpwN/SpiderOak/MISC/external/Aptoide.png)](http://aimsicd.store.aptoide.com/ "NOTE: Installs Aptoide-App first!") [![GitHub](https://spideroak.com/share/IFEU2U2JINCA/GitHub/home/SecUpwN/SpiderOak/MISC/external/GitHub.png)](https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/releases "GitHub Releases") [![F-Droid](https://spideroak.com/share/IFEU2U2JINCA/GitHub/home/SecUpwN/SpiderOak/MISC/external/F-Droid.png)](https://f-droid.org/repository/browse/?fdid=com.SecUpwN.AIMSICD "F-Droid Store")
[![NoGooglePlay](https://spideroak.com/share/IFEU2U2JINCA/GitHub/home/SecUpwN/SpiderOak/MISC/external/NoGooglePlay.png)](https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/wiki/FAQ#q-why-wont-you-upload-your-app-to-the-google-play-store "Statement against GooglePlay")
[![Twitter](https://spideroak.com/share/IFEU2U2JINCA/GitHub/home/SecUpwN/SpiderOak/MISC/external/Twitter.png)](https://twitter.com/AIMSICD "Official Twitter-Account")

---

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.SecUpwN.AIMSICD"
android:versionCode="27"
android:versionName="0.1.27-alpha-b00">
android:versionCode="28"
android:versionName="0.1.28-alpha-b00">

<!-- If we ever wanna make this a system app, we can add the following 2 lines above:
coreApp="true"
Expand Down
13 changes: 8 additions & 5 deletions app/src/main/assets/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ for letting us use your data. Thanks!
\n
ziem\n
https://github.com/ziem\n
for the implementation of\n
map scaling and clustering.\n
for all the awesome work on our\n
Antenna Map Viewer with adding\n
scaling, clustering and a legend!\n
Keep around for more map changes. ;-)\n
\n
Dave Mariano\n
https://github.com/d-mariano\n
Expand All @@ -177,8 +179,8 @@ lovely contributions.\n
\n
Paul Kinsella\n
https://github.com/banjaxbanjo\n
for the code to dump SMS as PDU and\n
all the other very cool pull requests!
for enabling SILENT SMS DETECTION\n
and all other very cool pull requests!\n
\n
Joey Hewitt\n
https://github.com/scintill\n
Expand All @@ -201,7 +203,8 @@ https://rtyley.github.io/bfg-repo-cleaner/\n
\n
agilob\n
http://b.agilob.net/\n
for enabling TRANSLATIONS of our app!\n
for enabling app TRANSLATIONS and\n
his BOUNTY on silent SMS detection!\n
\n
Dima Kozhevin\n
https://github.com/DimaKoz\n
Expand Down
42 changes: 42 additions & 0 deletions app/src/main/java/com/SecUpwN/AIMSICD/AIMSICD.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.IBinder;
import android.provider.MediaStore;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.DrawerLayout;
import android.telephony.TelephonyManager;
import android.util.Log;
Expand Down Expand Up @@ -55,6 +58,12 @@
import com.SecUpwN.AIMSICD.utils.LocationServices;
import com.SecUpwN.AIMSICD.utils.RequestTask;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -100,6 +109,8 @@ public class AIMSICD extends BaseActivity implements AsyncResponse {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

moveData();

getWindow().requestFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

mNavConf = new DrawerMenuActivityConfiguration.Builder(this).build();
Expand Down Expand Up @@ -625,4 +636,35 @@ public void onStart() {
((AppAIMSICD) getApplication()).attach(this);
}

/**
* TODO: Remove move in 2016.
* All people should have more than enough time to update their AIMSICD
* this method will be obsolete.
*/
private void moveData() {

// /storage/emulated/0/Android/data/com.SecUpwN.AIMSICD/
File destinedPath = new File(getExternalFilesDir(null) + File.separator);
// /storage/emulated/0/AIMSICD
File currentPath = new File(Environment.getExternalStorageDirectory().toString() + "/AIMSICD");
//Log.d(TAG, destinedPath.toString());
//Log.d(TAG, currentPath.toString());

//checks if /storage/emulated/0/AIMSICD exists
if(currentPath.exists()) {
// and if it's a directory, don't touch files
if(currentPath.isDirectory()) {
//list all files (and folders) in /storage/emulated/0/AIMSICD
File[] content = currentPath.listFiles();
for(int i = 0; i < content.length; i++) {
File from = new File(content[i].toString());
//move file to new directory
from.renameTo(new File(destinedPath.toString() + content[i].getName().toString()));
}
}
//remove current directory so it won't try to move it again
currentPath.delete();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import android.content.ContentValues;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.AssetManager;
import android.database.Cursor;
import android.database.SQLException;
Expand Down Expand Up @@ -91,7 +92,7 @@

public class AIMSICDDbAdapter {

public static final String FOLDER = Environment.getExternalStorageDirectory() + "/AIMSICD/";
public static String FOLDER;
public static final int DATABASE_VERSION = 9; // Is this "pragma user_version;" ?

// TODO: This should be implemented as a SharedPreference...
Expand Down Expand Up @@ -147,6 +148,7 @@ public class AIMSICDDbAdapter {
*/
public AIMSICDDbAdapter(Context context) {
mContext = context;
FOLDER = mContext.getExternalFilesDir(null) + File.separator; //e.g. /storage/emulated/0/Android/data/com.SecUpwN.AIMSICD/
mDbHelper = new DbHelper(context);
mTables = new String[]{
// Old...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Spinner;

Expand All @@ -35,7 +34,6 @@ public class DbViewerFragment extends Fragment {

private AIMSICDDbAdapter mDb;
private StatesDbViewer mTableSelected;
private boolean mMadeSelection;
private Context mContext;

//Layout items
Expand All @@ -58,50 +56,16 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

View view = inflater.inflate(R.layout.db_view, container, false);

if (view != null) {
lv = (ListView) view.findViewById(R.id.list_view);
emptyView = view.findViewById(R.id.db_list_empty);
lv = (ListView) view.findViewById(R.id.list_view);
emptyView = view.findViewById(R.id.db_list_empty);
tblSpinner = (Spinner) view.findViewById(R.id.table_spinner);
DbViewerSpinnerAdapter mSpinnerAdapter = new DbViewerSpinnerAdapter(getActivity(), R.layout.item_spinner_db_viewer);
tblSpinner.setAdapter(mSpinnerAdapter);

tblSpinner = (Spinner) view.findViewById(R.id.table_spinner);
DbViewerSpinnerAdapter mSpinnerAdapter = new DbViewerSpinnerAdapter(getActivity(), R.layout.item_spinner_db_viewer);
tblSpinner.setAdapter(mSpinnerAdapter);
tblSpinner.setOnItemSelectedListener(new spinnerListener());

Button loadTable = (Button) view.findViewById(R.id.load_table_data);
loadTable.setOnClickListener(new btnClick());
}

return view;
}

private class spinnerListener implements AdapterView.OnItemSelectedListener {

@Override
public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {

mTableSelected = (StatesDbViewer)tblSpinner.getSelectedItem();

mMadeSelection = true;
}

@Override
public void onNothingSelected(AdapterView<?> parentView) {
mMadeSelection = false;
}
}

/**
* Button Click (DB table selector) of "Database Viewer"
*
*/
private class btnClick implements View.OnClickListener {

@Override
public void onClick(final View v) {
if (mMadeSelection) {
v.setEnabled(false);
getActivity().setProgressBarIndeterminateVisibility(true);
lv.setVisibility(View.GONE);
Spinner spnLocale = (Spinner) view.findViewById(R.id.table_spinner);
spnLocale.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parentView, View selectedItemView, final int position, long id) {

new AsyncTask<Void, Void, BaseInflaterAdapter> () {

Expand All @@ -113,49 +77,51 @@ protected BaseInflaterAdapter doInBackground(Void... params) {
//TODO Table: "DetectionFlags"
//case DETECTION_FLAGS:
//result = mDb.getDetectionFlagsData();
switch (mTableSelected) {
mTableSelected = (StatesDbViewer)tblSpinner.getSelectedItem();

case UNIQUE_BTS_DATA:
switch (position) {
case 0: //UNIQUE_BTS_DATA
// The unique BTSs we have been connected to in the past
// EVA: Was "Cell Data" // Table: cellinfo
// ToBe: "DBi_bts"
result = mDb.getCellData();
break;

case BTS_MEASUREMENTS:
case 1: //BTS_MEASUREMENTS:
// All BTS measurements we have done since start
// EVA: Was "Location Data" // Table: locationinfo
// ToBe: "DBi_measure"
result = mDb.getLocationData();
break;

case IMPORTED_OCID_DATA:
case 2: //IMPORTED_OCID_DATA:
// EVA: Was "OpenCellID Data" // Table: opencellid
// ToBe: "DBe_import"
result = mDb.getOpenCellIDData();
break;

case DEFAULT_MCC_LOCATIONS:
case 3: //DEFAULT_MCC_LOCATIONS:
result = mDb.getDefaultMccLocationData();
break;

case SILENT_SMS:
case 4: //SILENT_SMS:
result = mDb.getSilentSmsData();
break;

case MEASURED_SIGNAL_STRENGTHS:
case 5: //MEASURED_SIGNAL_STRENGTHS:
// ToBe merged into "DBi_measure:rx_signal"
result = mDb.getSignalStrengthMeasurementData();
break;

case EVENT_LOG:
case 6: //EVENT_LOG:
// Table: "EventLog"
result = mDb.getEventLogData();
break;

default:
throw new IllegalArgumentException("Unknown type of table");
}

BaseInflaterAdapter adapter = null;
if (result != null) {
adapter = BuildTable(result);
Expand All @@ -176,15 +142,20 @@ protected void onPostExecute(BaseInflaterAdapter adapter) {
} else {
lv.setVisibility(View.GONE);
emptyView.setVisibility(View.VISIBLE);
//Helpers.msgShort(mContext, "Table contains no data to display.");
}

v.setEnabled(true);
getActivity().setProgressBarIndeterminateVisibility(false);
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}

@Override
public void onNothingSelected(AdapterView<?> parentView) {
return;
}
});

return view;
}

/**
Expand Down
Loading

0 comments on commit d876ee5

Please sign in to comment.