diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d89906f1..ce884f4d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,76 @@ # CHANGELOG of 'AIMSICD' ---------------------- +#### [21.06.2015 - WIP-Release v0.1.30-alpha-build-00](https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/releases/tag/v0.1.30-alpha-b00) + +* Updated: Refactored OpenCellId activity for better code quality and error handling +* Updated: A few more wording improvements for our `README` and additions in `CREDITS` +* Changed: Removed references and links to organizations not supporting our project +* Changed: Improved `LOGTAG` to use proper class name `SmsDetectionDbHelper` +* Added: Refresh Rate is now shown on menu entry in `Preferences` without opening it +* Fixed: Made buttons in `About` menu reappear and fixed code for shrinked buttons +* Fixed: Resolved reappearance of too many unnecessary database open/close operations + +--- + +#### 17.06.2015 - WIP-Internal v0.1.29-alpha-build-06 + +* Updated: Slight translation updates of strings due to previous menu changes +* Changed: Removed unused imports and shrinked some buttons in `About` menu +* Fixed: Resolved UI Issue in `Database Viewer` and corrected button link naming + +--- + +#### 17.06.2015 - WIP-Internal v0.1.29-alpha-build-05 + +* Changed: Removed old copyright and code of unused Femtocell toggle button +* Added: New `logcatTimeStampParser` for friendly timestamp from a logcat string +* Fixed: Endlessly receiving the same detected SMS has finally come to an end +* Fixed: Exception on UI and database has been fixed (possibly just tentative) + +--- + +#### 16.06.2015 - WIP-Internal v0.1.29-alpha-build-04 + +* Updated: Better RIL/API support with refreshed `ServiceMode` parser +* Updated: Increased timeout of OCID download to avoid retrieval errors +* Added: New feature to read OCID data from generated [lacells.db](https://github.com/n76/Local-GSM-Backend) as well +* Fixed: Resolved WIN DEATH when using Advanced User Preferences +* Fixed: Startup crash fixed with `Lat` and `Lng` in `AIMSICDDbAdapter.java` + +--- + +#### 12.06.2015 - WIP-Internal v0.1.29-alpha-build-03 + +* Changed: Moved hardcoding of OCDB download path to static variable +* Updated: Refactored OCID CSV parsing and truncated GPS coordinates + +--- + +#### 09.06.2015 - WIP-Internal v0.1.29-alpha-build-02 + +* Updated: Improved menu translations in `Navigation Drawer` for better understanding + +--- + +#### 08.06.2015 - WIP-Internal v0.1.29-alpha-build-01 + +* Removed: Purged unused imports and unnecessary `toString` calls +* Removed: Purged public modifier from interface methods +* Changed: Switched CoverityScan analysis to branch `development` to analyze current code +* Changed: Replaced deprecated `GridMarkerClusterer` with `RadiusMarkerClusterer` +* Changed: Closed some database cursors and replaced `dp` with `sp` for TextViews +* Updated: License header has been unified across all source files to ensure proper GPL +* Updated: Refactored `AIMSICDDbAdapter::DbHelper#onCreate` for easier reading +* Updated: Refactored redundant parsing from get OCID API request +* Added: Default `locale` has been implemented into `SimpleDateFormat` constructor +* Added: Now using parent view instead of null when inflating layouts +* Added: French translations as well as `leakcanary` analysis for detecting leaks +* Fixed: Minor translation and punctuation improvements in several translation string files +* Fixed: Corrected filename of CSV loaded in into `AIMSICDDbAdapter#updateOpenCellID` + +--- + #### [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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 34f524095..0c1270fe6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,7 +55,6 @@ Thank you for encouraging our developers! Special positions we are currently seeking skilled people for: -* People with equipment to verify our app (e.g. OpenBTS). * People with a CryptoPhone for double app verification. * Fixing the identified [Coverity Scan Defects](https://scan.coverity.com/projects/3346) of our app. * Whistleblower working for an IMSI-Catcher producer. diff --git a/README.md b/README.md index 76c6eb93c..e0cc78a8b 100644 --- a/README.md +++ b/README.md @@ -89,13 +89,7 @@ Please follow [how to correctly submit Issues](https://github.com/SecUpwN/Androi ### Support -Although this project is fully Open Source, developing AIMSICD is a lot of work and done by enthusiastic people during their free time. If you're a developer yourself, we welcome you with open arms! To keep developers in a great mood and support development, please consider making a (fully anonymous) [donation](https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/wiki/Donations). - -All collected donations shall be split into appropriate pieces and directly sent to developers who contribute useful code (at our discretion). Additionally, donations will be used to support these privacy organizations (contact us if you are a like-minded organization): - -[![EFF](https://spideroak.com/share/IFEU2U2JINCA/GitHub/home/SecUpwN/SpiderOak/MISC/external/EFF.png)](https://www.eff.org/) -[![Guardian Project](https://spideroak.com/share/IFEU2U2JINCA/GitHub/home/SecUpwN/SpiderOak/MISC/external/GuardianProject.png)](https://guardianproject.info/) -[![Privacy International](https://spideroak.com/share/IFEU2U2JINCA/GitHub/home/SecUpwN/SpiderOak/MISC/external/PrivacyInternational.png)](https://www.privacyinternational.org/) +Although this project is fully Open Source, developing AIMSICD is a lot of work and done by enthusiastic people during their free time. If you're a developer yourself, we welcome you with open arms! To keep developers in a great mood and support development, please consider making a [donation](https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/wiki/Donations). It will be split into appropriate pieces and directly sent to developers who solved the backed Issue. --- diff --git a/app/build.gradle b/app/build.gradle index 1e1c8c5d5..7fdda084c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -38,12 +38,12 @@ def getManifestVersionName() { //====================================================================== android { - compileSdkVersion 19 + compileSdkVersion 21 buildToolsVersion '21.1.2' defaultConfig { minSdkVersion 16 - targetSdkVersion 19 + targetSdkVersion 21 versionCode = getManifestVersionCode() versionName = getManifestVersionName() testApplicationId "com.SecUpwN.AIMSICD.test" @@ -125,13 +125,13 @@ android { } dependencies { - // compile 'com.github.amlcurran.showcaseview:library:5.0.0' + //compile 'com.github.amlcurran.showcaseview:library:5.0.0' + //compile 'com.android.support:appcompat-v7:22.1.1' + //https://github.com/lp0/slf4j-android compile fileTree(dir: 'libs', include: '*.jar') compile project(':third_party:rootshell') compile 'com.android.support:support-v4:19.1.0' - //compile 'com.android.support:appcompat-v7:22.1.1' compile 'org.osmdroid:osmdroid-android:4.2' - //https://github.com/lp0/slf4j-android compile 'org.slf4j:slf4j-api:1.7.12' compile 'eu.lp0.slf4j:slf4j-android:1.7.12-0' compile 'org.apache.httpcomponents:httpmime:4.2.1' @@ -140,4 +140,6 @@ dependencies { compile 'com.nineoldandroids:library:2.4.0' compile 'org.apache.commons:commons-lang3:3.3.2' compile 'com.google.code.gson:gson:2.2.4' + debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1' + releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1' } diff --git a/app/src/androidTest/java/com/SecUpwN/AIMSICD/test/Detection1.java b/app/src/androidTest/java/com/SecUpwN/AIMSICD/test/Detection1.java index b11a2f7f9..790b9cc35 100644 --- a/app/src/androidTest/java/com/SecUpwN/AIMSICD/test/Detection1.java +++ b/app/src/androidTest/java/com/SecUpwN/AIMSICD/test/Detection1.java @@ -1,3 +1,8 @@ +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o + * ----------------------------------------------------------- + */ package com.SecUpwN.AIMSICD.test; import android.test.AndroidTestCase; diff --git a/app/src/androidTest/java/com/SecUpwN/AIMSICD/test/DummyTest.java b/app/src/androidTest/java/com/SecUpwN/AIMSICD/test/DummyTest.java index c6e73e678..539cbfa04 100644 --- a/app/src/androidTest/java/com/SecUpwN/AIMSICD/test/DummyTest.java +++ b/app/src/androidTest/java/com/SecUpwN/AIMSICD/test/DummyTest.java @@ -1,3 +1,8 @@ +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o + * ----------------------------------------------------------- + */ package com.SecUpwN.AIMSICD.test; import android.test.ActivityInstrumentationTestCase2; diff --git a/app/src/androidTest/java/com/SecUpwN/AIMSICD/test/GetProp.java b/app/src/androidTest/java/com/SecUpwN/AIMSICD/test/GetProp.java index 0b6f59fe1..64c548f75 100644 --- a/app/src/androidTest/java/com/SecUpwN/AIMSICD/test/GetProp.java +++ b/app/src/androidTest/java/com/SecUpwN/AIMSICD/test/GetProp.java @@ -1,14 +1,14 @@ +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o + * ----------------------------------------------------------- + */ package com.SecUpwN.AIMSICD.test; import android.test.ActivityInstrumentationTestCase2; -import android.test.AndroidTestCase; import android.util.Log; -import android.widget.Toast; -import com.SecUpwN.AIMSICD.AIMSICD; import com.SecUpwN.AIMSICD.activities.DebugLogs; -import com.SecUpwN.AIMSICD.adapters.AIMSICDDbAdapter; -import com.SecUpwN.AIMSICD.utils.Cell; import java.io.IOException; diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c913614e1..4f5a1f007 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="30" + android:versionName="0.1.30-alpha-b00"> we dont need the last 4 digits in timestamp .988 + // | way to accurate but easily change if needed + String timestamp = line.substring(0,line.length()-4)// <-| + .replace(":","") + .replace(".","") + .replace("-",""); + + return timestamp; + } } diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/OCIDCSV.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/OCIDCSV.java new file mode 100644 index 000000000..a41fa04cb --- /dev/null +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/OCIDCSV.java @@ -0,0 +1,87 @@ +package com.SecUpwN.AIMSICD.utils; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Marvin Arnold on 9/06/15. + */ +public class OCIDCSV extends ArrayList { + + public OCIDCSV() { + super(); + } + + public void add(String[] newLine) { + add(new OCIDCSVLine(newLine)); + } + + public class OCIDCSVLine { + private final String[] ocidCell; + + public OCIDCSVLine(String[] ocidCell) { + this.ocidCell = ocidCell; + } + + public double getGPSLat() { + return truncateDouble(this.ocidCell[0], 5); + } + + public double getGPSLon() { + return truncateDouble(this.ocidCell[1], 5); + } + + public int getMCC() { + return Integer.parseInt(this.ocidCell[2]); + } + + public int getMNC() { + return Integer.parseInt(this.ocidCell[3]); + } + + public int getLAC() { + return Integer.parseInt(this.ocidCell[4]); + } + + public int getCID() { + return Integer.parseInt(this.ocidCell[5]); + } + + /** + * Average signal in [dBm] + * @return + */ + public int getAvgSig() { + return Integer.parseInt(this.ocidCell[6]); + } + + /** + * Average range in [m] + * @return + */ + public int getAvgRange() { + return Integer.parseInt(this.ocidCell[7]); + } + + public int getSamples() { + return Integer.parseInt(this.ocidCell[8]); + } + + public int isGPSExact() { + return Integer.parseInt(this.ocidCell[9]); + } + + public String getRAT() { + return String.valueOf(this.ocidCell[10]); + } + + public double truncateDouble(String d, int numDecimal) { + return truncateDouble(Double.parseDouble(d), numDecimal); + } + + public double truncateDouble(double d, int numDecimal) { + String s = String.format("%." + Integer.toString(numDecimal) +"f", d); + return Double.parseDouble(s); + } + } +} diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/OCIDResponse.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/OCIDResponse.java new file mode 100644 index 000000000..74a5ded7e --- /dev/null +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/OCIDResponse.java @@ -0,0 +1,53 @@ +package com.SecUpwN.AIMSICD.utils; + +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.StatusLine; + +import java.io.ByteArrayOutputStream; +import java.io.InputStream; + +/** + * Created by Marvin Arnold on 7/06/15. + */ +public class OCIDResponse { + private final HttpResponse httpResponse; + + public OCIDResponse(HttpResponse httpResponse) { + this.httpResponse = httpResponse; + } + + public int getStatusCode() { + return getStatus().getStatusCode(); + } + + public HttpEntity getEntity() { + return httpResponse.getEntity(); + } + + public String getResponseFromServer() throws Exception { + String responseFromServer = null; + if (httpResponse.getEntity() != null) { + InputStream is = httpResponse.getEntity().getContent(); + ByteArrayOutputStream content = new ByteArrayOutputStream(); + // Read response into a buffered stream + int readBytes; + byte[] sBuffer = new byte[4096]; + while ((readBytes = is.read(sBuffer)) != -1) { + content.write(sBuffer, 0, readBytes); + } + responseFromServer = content.toString("UTF-8"); + httpResponse.getEntity().consumeContent(); + } + + return responseFromServer; + } + + public String getReasonPhrase() { + return getStatus().getReasonPhrase(); + } + + public StatusLine getStatus() { + return httpResponse.getStatusLine(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/OemCommands.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/OemCommands.java index 356c282cd..a9db8f06c 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/OemCommands.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/OemCommands.java @@ -1,15 +1,18 @@ /* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project * ----------------------------------------------------------- - * LICENSE: http://git.io/vJaf6 | TERMS: http://git.io/vJMf5 + * LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o * ----------------------------------------------------------- */ package com.SecUpwN.AIMSICD.utils; import android.util.Log; +import com.SecUpwN.AIMSICD.R; + import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; +import android.content.Context; /* * These are the OEM commands used by the MulticlientRil ServiceMode menu scraper, @@ -51,7 +54,7 @@ public class OemCommands { public static final char OEM_SM_TYPE_SUB_FACTORY_RESET_ENTER = 13; public static final char OEM_SM_TYPE_SUB_FACTORY_PRECONFIG_ENTER = 14; public static final char OEM_SM_TYPE_SUB_TFS4_EXPLORE_ENTER = 15; - // E:V:A What is 16? + // E:V:A What is 16? // SecUpwN: Does not seem to be defined. Remove this line? public static final char OEM_SM_TYPE_SUB_RSC_FILE_VERSION_ENTER = 17; public static final char OEM_SM_TYPE_SUB_USB_DRIVER_ENTER = 18; public static final char OEM_SM_TYPE_SUB_USB_UART_DIAG_CONTROL_ENTER = 19; @@ -73,13 +76,31 @@ public class OemCommands { public static final char OEM_SM_TYPE_SUB_TST_FTA_SW_VERSION_ENTER = 4098; public static final char OEM_SM_TYPE_SUB_TST_FTA_HW_VERSION_ENTER = 4099; - public static byte[] getEnterServiceModeData(int modeType, int subType, int query) { + private int mApiVersion; + + private OemCommands(int apiVersion) { + mApiVersion = apiVersion; + } + + public static OemCommands getInstance(Context context) { + int apiVersion = context.getResources().getInteger(R.integer.config_api_version); + return new OemCommands(apiVersion); + } + + public byte[] getEnterServiceModeData(int modeType, int subType, int query) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); dos.writeByte(OEM_SERVM_FUNCTAG); dos.writeByte(OEM_SM_ENTER_MODE_MESSAGE); - dos.writeShort(7); + if (mApiVersion == 1) { + dos.writeShort(7); + } else if (mApiVersion == 2) { + dos.writeShort(8); + dos.writeByte(4); + } else { + throw new IllegalArgumentException("Invalid API version " + mApiVersion); + } dos.writeByte(modeType); dos.writeByte(subType); dos.writeByte(query); @@ -90,13 +111,20 @@ public static byte[] getEnterServiceModeData(int modeType, int subType, int quer return null; } - public static byte[] getEndServiceModeData(int modeType) { + public byte[] getEndServiceModeData(int modeType) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); dos.writeByte(OEM_SERVM_FUNCTAG); dos.writeByte(OEM_SM_END_MODE_MESSAGE); - dos.writeShort(5); + if (mApiVersion == 1) { + dos.writeShort(5); + } else if (mApiVersion == 2) { + dos.writeShort(6); + dos.writeByte(4); + } else { + throw new IllegalArgumentException("Invalid API version " + mApiVersion); + } dos.writeByte(modeType); return baos.toByteArray(); } catch (IOException e) { @@ -105,13 +133,20 @@ public static byte[] getEndServiceModeData(int modeType) { return null; } - public static byte[] getPressKeyData(int keycode, int query) { + public byte[] getPressKeyData(int keycode, int query) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); dos.writeByte(OEM_SERVM_FUNCTAG); dos.writeByte(OEM_SM_PROCESS_KEY_MESSAGE); - dos.writeShort(6); + if (mApiVersion == 1) { + dos.writeShort(6); + } else if (mApiVersion == 2) { + dos.writeShort(7); + dos.writeByte(4); + } else { + throw new IllegalArgumentException("Invalid API version " + mApiVersion); + } dos.writeByte(keycode); dos.writeByte(query); return baos.toByteArray(); @@ -121,4 +156,4 @@ public static byte[] getPressKeyData(int keycode, int query) { return null; } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/RequestTask.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/RequestTask.java index d74c7473a..5d7c3b7f0 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/RequestTask.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/RequestTask.java @@ -1,12 +1,14 @@ +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o + * ----------------------------------------------------------- + */ package com.SecUpwN.AIMSICD.utils; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.Intent; -import android.content.SharedPreferences; -import android.os.AsyncTask; -import android.os.Environment; import android.support.v4.content.LocalBroadcastManager; import android.util.Log; @@ -16,10 +18,16 @@ import com.SecUpwN.AIMSICD.activities.MapViewerOsmDroid; import com.SecUpwN.AIMSICD.adapters.AIMSICDDbAdapter; import com.SecUpwN.AIMSICD.constants.TinyDbKeys; -import com.SecUpwN.AIMSICD.service.AimsicdService; import com.SecUpwN.AIMSICD.service.CellTracker; -//import com.SecUpwN.AIMSICD.utils.Helpers; -import com.SecUpwN.AIMSICD.utils.TinyDB; + +import org.apache.http.HttpResponse; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.entity.mime.MultipartEntity; +import org.apache.http.entity.mime.content.InputStreamBody; +import org.apache.http.entity.mime.content.StringBody; +import org.apache.http.impl.client.DefaultHttpClient; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; @@ -33,14 +41,7 @@ import java.net.MalformedURLException; import java.net.URL; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.entity.mime.MultipartEntity; -import org.apache.http.entity.mime.content.InputStreamBody; -import org.apache.http.entity.mime.content.StringBody; -import org.apache.http.impl.client.DefaultHttpClient; +//import com.SecUpwN.AIMSICD.utils.Helpers; /** * @@ -82,6 +83,7 @@ * 2015-03-01 kairenken Fixed "DBE_UPLOAD_REQUEST" + button * 2015-03-02 kairenken remove OCID_UPLOAD_PREF: Upload is manual, so this is not needed anymore. * 2015-03-03 E:V:A Replaced dirty SharedPreferences code with TinyDB and Upload result Toast msg. + * 2015-06-15 SecUpwN Increased timeout of OCID data download to avoid further retrieval errors * * To Fix: * @@ -94,7 +96,7 @@ public class RequestTask extends BaseAsyncTask { //Calling from the menu more extensive(more difficult for sever), // we have to give more time for the server response - public static final int REQUEST_TIMEOUT_MAPS = 20000; // [ms] 20 s Calling from map + public static final int REQUEST_TIMEOUT_MAPS = 40000; // [ms] 40 s Calling from map public static final int REQUEST_TIMEOUT_MENU = 40000; // [ms] 40 s Calling from menu public static final char DBE_DOWNLOAD_REQUEST = 1; // OCID download request from "APPLICATION" drawer title @@ -191,16 +193,17 @@ protected String doInBackground(String... commandString) { try { int total; int progress = 0; - - File dir = new File((mAppContext.getExternalFilesDir(null) + File.separator) + "OpenCellID/"); + String dirName = getOCDBDownloadDirectoryPath(mAppContext); + File dir = new File(dirName); if (!dir.exists()) { dir.mkdirs(); } // need a try{} catch{} - File file = new File(dir, "opencellid.csv"); + File file = new File(dir, OCDB_File_Name); + Log.i(TAG, mTAG + ": DBE_DOWNLOAD_REQUEST write to: " + dirName + OCDB_File_Name); URL url = new URL(commandString[0]); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.setRequestMethod("GET"); urlConnection.setConnectTimeout(mTimeOut); - urlConnection.setReadTimeout(mTimeOut); // [ms] 20 s + urlConnection.setReadTimeout(mTimeOut); // [ms] 40 s urlConnection.setDoInput(true); urlConnection.connect(); @@ -418,4 +421,19 @@ private void showHideMapProgressBar(boolean pFlag) { ((MapViewerOsmDroid) lActivity).setRefreshActionButtonState(pFlag); } } + + public static final String OCDB_File_Name = "opencellid.csv"; + + /** + * The folder path to OCDB download. + * @param context + * @return + */ + public static String getOCDBDownloadDirectoryPath(Context context) { + return (context.getExternalFilesDir(null) + File.separator) + "OpenCellID/"; + } + + public static String getOCDBDownloadFilePath(Context context) { + return getOCDBDownloadDirectoryPath(context) + OCDB_File_Name; + } } \ No newline at end of file diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/StackOverflowXmlParser.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/StackOverflowXmlParser.java index a6f8c34aa..34e145427 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/StackOverflowXmlParser.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/StackOverflowXmlParser.java @@ -1,10 +1,15 @@ +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o + * ----------------------------------------------------------- + */ package com.SecUpwN.AIMSICD.utils; +import android.util.Xml; + import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; -import android.util.Xml; - import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Status.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Status.java index f622a108a..9f67f0149 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Status.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Status.java @@ -1,3 +1,8 @@ +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o + * ----------------------------------------------------------- + */ package com.SecUpwN.AIMSICD.utils; import android.content.Context; diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/TinyDB.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/TinyDB.java index 17f11c4c3..9bb8da286 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/TinyDB.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/TinyDB.java @@ -15,24 +15,23 @@ */ package com.SecUpwN.AIMSICD.utils; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Map; - import android.content.Context; import android.content.SharedPreferences; import android.graphics.Bitmap; import android.graphics.Bitmap.CompressFormat; import android.graphics.BitmapFactory; -import android.os.Environment; import android.preference.PreferenceManager; import android.text.TextUtils; import android.util.Log; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Map; + /** * Description: This class simplifies calls to SharedPreferences in a line of code. diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/atcmd/AtCommandTerminal.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/atcmd/AtCommandTerminal.java index 7a10940ff..d0c3785c3 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/atcmd/AtCommandTerminal.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/atcmd/AtCommandTerminal.java @@ -1,3 +1,8 @@ +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o + * ----------------------------------------------------------- + */ package com.SecUpwN.AIMSICD.utils.atcmd; import android.os.Message; diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/atcmd/TtyPrivFile.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/atcmd/TtyPrivFile.java index c50f2fc36..fc5f6c67f 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/atcmd/TtyPrivFile.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/atcmd/TtyPrivFile.java @@ -1,3 +1,8 @@ +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o + * ----------------------------------------------------------- + */ package com.SecUpwN.AIMSICD.utils.atcmd; import android.util.Log; diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/atcmd/TtyStream.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/atcmd/TtyStream.java index 226fb9fc5..d39f00345 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/atcmd/TtyStream.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/atcmd/TtyStream.java @@ -1,3 +1,8 @@ +/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project + * ----------------------------------------------------------- + * LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o + * ----------------------------------------------------------- + */ package com.SecUpwN.AIMSICD.utils.atcmd; import android.os.Message; diff --git a/app/src/main/res/layout/about_fragment.xml b/app/src/main/res/layout/about_fragment.xml index d18d40266..90d8b7cf0 100644 --- a/app/src/main/res/layout/about_fragment.xml +++ b/app/src/main/res/layout/about_fragment.xml @@ -48,7 +48,7 @@ android:textColor="@color/green_text" android:id="@+id/textView2" android:gravity="center_vertical|center_horizontal" - android:textSize="14dp" /> + android:textSize="14sp" /> -