Skip to content

Commit

Permalink
Changed map pins and toaster timeout
Browse files Browse the repository at this point in the history
Changed the map pins to round dots and use msgLong instead of msgShort
for the "contacting OCID" toaster message.
Disabled persistent service startup by default. (Dev annoyance!)
  • Loading branch information
E3V3A committed Jan 5, 2015
1 parent 1e8031e commit 463fec0
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 21 deletions.
17 changes: 12 additions & 5 deletions app/src/main/java/com/SecUpwN/AIMSICD/AIMSICD.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void selectItem(int position) {
new RequestTask(mContext, RequestTask.BACKUP_DATABASE).execute();
} else if (selectedItem.getId() == 204) {
if (CellTracker.LAST_DB_BACKUP_VERSION < AIMSICDDbAdapter.DATABASE_VERSION) {
Helpers.msgShort(mContext, "Unable to restore backup from previous database version"
Helpers.msgLong(mContext, "Unable to restore backup from previous database version"
+ " due to structural changes!");
} else {
new RequestTask(mContext, RequestTask.RESTORE_DATABASE).execute();
Expand All @@ -285,7 +285,8 @@ void selectItem(int position) {
if (CellTracker.OCID_API_KEY != null && !CellTracker.OCID_API_KEY.equals("NA")) {
GeoLocation loc = mAimsicdService.lastKnownLocation();
if (loc != null) {
Helpers.msgShort(mContext, "Contacting OpenCellID.org for data...");
Helpers.msgLong(mContext, "Contacting opencellid.org for data...\nThis may "
+ "take up to a minute.");
Cell cell = new Cell();
cell.setLon(loc.getLongitudeInDegrees());
cell.setLat(loc.getLatitudeInDegrees());
Expand Down Expand Up @@ -360,12 +361,13 @@ void selectItem(int position) {
public void processFinish(float[] location) {
Log.i(TAG, "processFinish - location[0]=" + location[0] + " location[1]=" + location[1]);
if (location[0] != 0.0f && location[1] != 0.0f) {
Helpers.msgShort(mContext, "Contacting OpenCellID.org for data...");
Helpers.msgLong(mContext, "Contacting opencellid.org for data...\nThis may "
+ "take up to a minute.");
Helpers.getOpenCellData(mContext, mAimsicdService.getCell(),
RequestTask.OPEN_CELL_ID_REQUEST);
} else {
Helpers.msgShort(mContext,
"Unable to determine your last location. \nEnable Location Services and try again.");
Helpers.msgLong(mContext,
"Unable to determine your last location.\nEnable Location Services and try again.");
}
}

Expand Down Expand Up @@ -424,6 +426,11 @@ public DrawerMenuActivityConfiguration getNavDrawerConfiguration() {
(203, getString(R.string.backup_database), "ic_action_import_export", false, this));
menu.add(DrawerMenuItem.create
(204, getString(R.string.restore_database), "ic_action_import_export", false, this));
// E:V:A
// TODO: placeholder for "Reset/Clear DataBase"
// menu.add(DrawerMenuItem.create
// (205?, getString(R.string.reset_database), "ic_action_clear", false, this));

menu.add(DrawerMenuSection.create(300, "Application"));
menu.add(DrawerMenuItem.create
(301, getString(R.string.get_opencellid), "stat_sys_download_anim0", false, this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ private void loadPreferences() {
}
}

// E:V:A 20150105
// TODO: Remove HYBRID and SATELLITE MAP choices as they don't work!
// See: https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/issues/228
private void setupMapType(int mapType) {
mMap.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE);
switch (mapType) {
Expand Down Expand Up @@ -287,7 +290,8 @@ public boolean onOptionsItemSelected(MenuItem item) {
if (mBound) {
GeoLocation lastKnown = mAimsicdService.lastKnownLocation();
if (lastKnown != null) {
Helpers.msgShort(this, "Contacting OpenCellID.org for data...");
Helpers.msgLong(mContext,
"Contacting opencellid.org for data...\nThis may take up to a minute.");
Cell cell;
cell = mAimsicdService.getCell();
cell.setLon(lastKnown.getLongitudeInDegrees());
Expand All @@ -298,14 +302,15 @@ public boolean onOptionsItemSelected(MenuItem item) {
}
}
if (loc != null) {
Helpers.msgShort(this, "Contacting OpenCellID.org for data...");
Helpers.msgLong(this,
"Contacting opencellid.org for data...\nThis may take up to a minute.");
Cell cell = new Cell();
cell.setLat(loc.getLatitude());
cell.setLon(loc.getLongitude());
Helpers.getOpenCellData(mContext, cell,
RequestTask.OPEN_CELL_ID_REQUEST_FROM_MAP);
} else {
Helpers.msgShort(mContext,
Helpers.msgLong(mContext,
"Unable to determine your last location. \nEnable Location Services and try again.");
}
return true;
Expand Down Expand Up @@ -449,16 +454,21 @@ public void run() {
mDbHelper.close();

// plot neighbouring cells
while (mAimsicdService == null) try { Thread.sleep(100); } catch (Exception e) {};
while (mAimsicdService == null) try { Thread.sleep(100); } catch (Exception e) {}
List<Cell> nc = mAimsicdService.getCellTracker().updateNeighbouringCells();
for (Cell cell : nc) {
try {
loc = new GeoPoint(cell.getLat(), cell.getLon());
CellTowerOverlayItem ovm = new CellTowerOverlayItem("Cell ID: " + cell.getCID(),
"",
loc,
new MarkerData("" + cell.getCID(), "" + loc.getLatitude(),"" +
loc.getLongitude(), "" + cell.getLAC(), "" + cell.getMCC(), "" + cell.getMNC(), "", false));
"", loc,
new MarkerData(
"" + cell.getCID(),
"" + loc.getLatitude(),
"" + loc.getLongitude(),
"" + cell.getLAC(),
"" + cell.getMCC(),
"" + cell.getMNC(),
"", false));

ovm.setMarker(getResources().getDrawable(R.drawable.ic_map_pin_orange));
items.add(ovm);
Expand Down Expand Up @@ -490,7 +500,7 @@ protected void onPostExecute(GeoPoint defaultLoc) {
mMap.getController().setZoom(16);
mMap.getController().animateTo(new GeoPoint(loc.getLatitude(), loc.getLongitude()));
} else {
//Use Mcc to move camera to an approximate location near Countries Capital
//Use MCC to move camera to an approximate location near Countries Capital
loc = defaultLoc;

mMap.getController().setZoom(13);
Expand Down Expand Up @@ -529,8 +539,7 @@ private void loadOpenCellIDMarkers() {


CellTowerOverlayItem ovm = new CellTowerOverlayItem("Cell ID: " + cellID,
"",
location,
"", location,
new MarkerData("" + cellID, "" + location.getLatitude(),"" +
location.getLongitude(), "" + lac, "" + mcc, "" + mnc, "" + samples, false));

Expand All @@ -557,9 +566,14 @@ public class MarkerData {
public final String samples;
public final boolean openCellID;

MarkerData(String cell_id, String latitude, String longitude,
String local_area_code, String mobile_country_code, String mobile_network_code,
String samples_taken, boolean openCellID_Data) {
MarkerData(String cell_id,
String latitude,
String longitude,
String local_area_code,
String mobile_country_code,
String mobile_network_code,
String samples_taken,
boolean openCellID_Data) {
cellID = cell_id;
lat = latitude;
lng = longitude;
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/SecUpwN/AIMSICD/utils/Helpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class Helpers {

/**
* Long toast message
* (Predefined in AOS to 3500 ms = 3.5 sec)
*
* @param context Application Context
* @param msg Message to send
Expand All @@ -70,6 +71,7 @@ public void run() {

/**
* Short toast message
* (Predefined in AOS to 2000 ms = 2 sec)
*
* @param context Application Context
* @param msg Message to send
Expand Down
Binary file modified app/src/main/res/drawable-hdpi/ic_map_pin_blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-hdpi/ic_map_pin_green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-hdpi/ic_map_pin_orange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-hdpi/ic_map_pin_red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-mdpi/ic_map_pin_blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-mdpi/ic_map_pin_green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-mdpi/ic_map_pin_orange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-mdpi/ic_map_pin_red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xhdpi/ic_map_pin_blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xhdpi/ic_map_pin_green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xhdpi/ic_map_pin_orange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xhdpi/ic_map_pin_red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xxhdpi/ic_map_pin_blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xxhdpi/ic_map_pin_green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xxhdpi/ic_map_pin_orange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xxhdpi/ic_map_pin_red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
android:key="pref_key_system_settings"
android:title="@string/pref_system_title">
<CheckBoxPreference
android:defaultValue="true"
android:defaultValue="false"
android:key="@string/pref_autostart_key"
android:summary="@string/pref_autostart_summ"
android:title="@string/pref_autostart_title"/>
<CheckBoxPreference
android:defaultValue="true"
android:defaultValue="false"
android:key="@string/pref_persistservice_key"
android:summary="@string/pref_persistservice_summ"
android:title="@string/pref_persistservice_title"/>
Expand Down

0 comments on commit 463fec0

Please sign in to comment.