Skip to content

Commit

Permalink
Merge pull request #725 from SecUpwN/cleanup/javadoc
Browse files Browse the repository at this point in the history
First cleanup of Javadoc comments
  • Loading branch information
larsgrefer committed Dec 30, 2015
2 parents 7b5e73e + ca1c92c commit 4629f7e
Show file tree
Hide file tree
Showing 27 changed files with 83 additions and 260 deletions.
61 changes: 6 additions & 55 deletions AIMSICD/src/main/java/com/SecUpwN/AIMSICD/AIMSICD.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.IBinder;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
Expand Down Expand Up @@ -50,27 +49,20 @@
import com.SecUpwN.AIMSICD.utils.LocationServices;
import com.SecUpwN.AIMSICD.utils.RequestTask;
import com.SecUpwN.AIMSICD.utils.StackOverflowXmlParser;

import com.squareup.okhttp.Callback;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;

import org.xmlpull.v1.XmlPullParserException;

import java.io.File;
import java.io.IOException;
import java.util.List;

import io.freefair.android.injection.annotation.Inject;
import io.freefair.android.util.logging.Logger;

/**
* Description: TODO: Please add some comments about this class
* <p>
* Dependencies: TODO: Write a few words about where the content of this is used.
* <p>
* Issues:
*/
public class AIMSICD extends BaseActivity implements AsyncResponse {

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

moveData();

mNavConf = new DrawerMenuActivityConfiguration.Builder(this).build();

setContentView(mNavConf.getMainLayout());
Expand Down Expand Up @@ -232,14 +222,14 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
}

/**
* Description: Swaps fragments in the main content view
* Swaps fragments in the main content view
*/
void selectItem(int position) {
NavDrawerItem selectedItem = mNavConf.getNavItems().get(position);
String title = selectedItem.getLabel();

/**
* This is a work-around for Issue 42601
* This is a work-around for Android Issue 42601
* https://code.google.com/p/android/issues/detail?id=42601
*
* The method getChildFragmentManager() does not clear up
Expand Down Expand Up @@ -304,7 +294,7 @@ void selectItem(int position) {
} else if (selectedItem.getId() == DrawerMenu.ID.SETTINGS.RESET_DB) {
// WARNING! This deletes the entire database, thus any subsequent DB access will FC app.
// Therefore we need to either restart app or run AIMSICDDbAdapter, to rebuild DB.
// See: #581 and Helpers.java
// See: https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/issues/581 and Helpers.java
Helpers.askAndDeleteDb(this);


Expand Down Expand Up @@ -647,22 +637,14 @@ private void showMap() {
}

/**
* Description: Cell Information Tracking - Enable/Disable
* <p>
* TODO: Clarify usage and what functions we would like this to provide. - Are we toggling GPS
* location tracking? - Are we logging measurement data into DBi? - Are we locking phone to
* 2/3/4G operation?
* Cell Information Tracking - Enable/Disable
*/
private void trackCell() {
mAimsicdService.setCellTracking(mAimsicdService.isTrackingCell());
}

/**
* Description: Cell Information Monitoring - Enable/Disable
* <p>
* TODO: Clarify usage and what functions we would like this to provide. - Are we temporarily
* disabling AIMSICD monitoring? (IF yes, why not just Quit?) - Are we ignoring Detection
* alarms? - Are we logging something?
* Cell Information Monitoring - Enable/Disable
*/
private void monitorCell() {
mAimsicdService.setCellMonitoring(!mAimsicdService.isMonitoringCell());
Expand All @@ -685,35 +667,4 @@ public void onStart() {
super.onStart();
((AppAIMSICD) getApplication()).attach(this);
}

/**
* Moves file from user directory to app-dedicated directory.
* <p>
* TODO: Remove move in 2016. All people should have more than enough time to update their
* AIMSICD this method will be obsolete.
* <p>
*/
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");

//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 @@ -26,11 +26,8 @@
import io.freefair.android.util.logging.Logger;

/**
* Description: Popup toast messages asking if user wants to download new API key
* to access OpenCellId services and data.
*
* TODO:
* [ ] Add toast for every server response code/message
* Popup toast messages asking if user wants to download
* new API key to access OpenCellId services and data.
*/
@XmlLayout(R.layout.activity_open_cell_id)
public class OpenCellIdActivity extends BaseActivity {
Expand Down Expand Up @@ -128,22 +125,19 @@ private boolean isKeyValid(String key) {

/**
*
* Description: Get an API key for Open Cell ID. Do not call this from the UI/Main thread.
* For the various server responses, pleas refer to the OpenCellID API wiki:
* http://wiki.opencellid.org/wiki/API#Error_codes
* TODO: And the github issue #303:
* https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/issues/303
* Get an API key for Open Cell ID. Do not call this from the UI/Main thread.
* For the various server responses, pleas refer to the OpenCellID API wiki:
* See: http://wiki.opencellid.org/wiki/API#Error_codes
*
* TODO: [ ] Add handlers for other HTTP request and OCID Server error codes:
* OCID status codes http://wiki.opencellid.org/wiki/API#Error_codes
*
* OCID status codes http://wiki.opencellid.org/wiki/API#Error_codes
* 1 200 Cell not found
* 2 401 Invalid API key
* 3 400 Invalid input data
* 4 403 Your API key must be white listed in order to run this operation
* 5 500 Internal server error
* 6 503 Too many requests. Try later again
* 7 429 Daily limit 1000 requests exceeded for your API key.
* 1 200 Cell not found
* 2 401 Invalid API key
* 3 400 Invalid input data
* 4 403 Your API key must be white listed in order to run this operation
* 5 500 Internal server error
* 6 503 Too many requests. Try later again
* 7 429 Daily limit 1000 requests exceeded for your API key.
*
* @return null or newly generated key
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,9 @@


/**
* Brief: TODO: Please explain its use.
*
* Description:
*
* This class handle all the AMISICD DataBase ... TODO: Add info here !
*
*
*
* Issues: TODO: !! === I'm not sure this is the right place... == !! --E:V:A
* Notes:
*
* This class handles the AMISICD DataBase
*/

public class CellCardInflater implements IAdapterViewInflater<CardItemData> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@
import com.SecUpwN.AIMSICD.R;

/**
* Description: Contains the data and definitions of all the items of the XML layout
*
* Dependencies:
* DbViewerFragment.java: BuildTable()
* DbeImportItemData.java
* dbe_import_items.xml
*
* Issues:
* Contains the data and definitions of all the items of the XML layout
*/

public class DbeImportCardInflater implements IAdapterViewInflater<DbeImportItemData> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,9 @@
import com.SecUpwN.AIMSICD.R;

/**
* Brief: TODO: Please explain its use.
*
* Description:
*
* This class handle the EventLog DB table ... TODO: Add info here !
*
* Template: OpenCellIdCardInflater.java
*
* Dependencies: EventLogItemData.java
* eventlog_items.xml
*
* Issues:
* Notes:
*
* This class handles the EventLog DB table.
*/

public class EventLogCardInflater implements IAdapterViewInflater<EventLogItemData> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* Inflater class used in DB viewer (for Measured cell strength measurements)
*
* Template: SilentSmsCardInflater.java
* TODO: Fix variable names!!
*
* @author Tor Henning Ueland
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package com.SecUpwN.AIMSICD.constants;
/**
* Description: These are some static constants that represent the SQLite DB
* table names. These should normally NOT be used, as hardcoded strings
* make everything much more transparent...
*
* Note: Try keep the same order as in the aimsicd.sql tables
*
* These are some static constants that represent the SQLite DB table names.
* These should normally NOT be used, as hardcoded strings make everything
* much more transparent. Try keep the same order as in the aimsicd.sql tables.
*/
public class DBTableColumnIds {
//defaultlocation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@
package com.SecUpwN.AIMSICD.constants;

/**
* Description: This class add Constants for examples as used to pre-populate
* various tables used in the Database Viewer (DBV).
*
* Dependencies: DbViewerFragment.java
* This class add Constants for examples as used to pre-populate
* various tables used in the Database Viewer (DBV).
*/
public class Examples {

/**
* Description: Constants of examples for EventLogItemData
* Dependencies: EventLogItemData.java
* Constants of examples for EventLogItemData
*/
public static class EVENT_LOG_DATA {
public static final String LAC = "12345";
Expand All @@ -28,8 +25,7 @@ public static class EVENT_LOG_DATA {
}

/**
* Description: Constants of examples for SilentSmsCardData
* Dependencies: SilentSmsCardData.java
* Constants of examples for SilentSmsCardData
*/
public static class SILENT_SMS_CARD_DATA {
public static final String ADDRESS = "ADREZZ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import java.util.List;

/**
* Description: Overlay class for OSMDroid map to display multiple BTS pins
* as one numbered point, clustering multiple pins.
* Overlay class for OSMDroid map to display multiple BTS pins
* as one numbered point, clustering multiple pins.
*/
public class CellTowerGridMarkerClusterer extends RadiusMarkerClusterer {
protected Context mContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ public MarkerData getMarkerData() {
* more available items as explained in the related issue here:
* https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/issues/234
*
* Dependency:
* MarkerData.java
* marker_info_window.xml
*
*/
public View getInfoContents(MarkerData data) {

Expand All @@ -79,7 +75,6 @@ public View getInfoContents(MarkerData data) {
tv.setText(String.valueOf(data.lat));
tv = (TextView) v.findViewById(R.id.lng); // LON
tv.setText(String.valueOf(data.lng));
// TODO: add PSC and RAT
//tv = (TextView) v.findViewById(R.id.psc); // PSC
//tv.setText(data.getPSC());
//tv = (TextView) v.findViewById(R.id.rat); // RAT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@
package com.SecUpwN.AIMSICD.map;

/**
* Description: Class to hold data for displaying in BTS pin popup dialog
*
* Issues:
* [ ] clarify which GPS coordinates are used. Exact of from device?
* [ ] adding more details, similar as for the DB Viewer UI:
* see: https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/issues/234
*
* Class to hold data for displaying in BTS pin popup dialog
*
*/
public class MarkerData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ public void stop() {


/**
* Check the status of the Rill Executor
* Check the status of the RIL Executor
*
* @return DetectResult providing access status of the Ril Executor
* @return DetectResult providing access status of the RIL Executor
*/
public DetectResult getRilExecutorStatus() {
return mRilExecutorDetectResult;
Expand Down Expand Up @@ -157,9 +157,9 @@ private synchronized List<String> executeServiceModeCommand(int type, int subtyp

/**
* Executes and receives the Ciphering Information request using
* the Rill Executor
* the RIL Executor
*
* @return String list response from Rill Executor
* @return String list response from RIL Executor
*/
public List<String> getCipheringInfo() {
return executeServiceModeCommand(
Expand All @@ -171,9 +171,9 @@ public List<String> getCipheringInfo() {

/**
* Executes and receives the Neighbouring Cell request using
* the Rill Executor
* the RIL Executor
*
* @return String list response from Rill Executor
* @return String list response from RIL Executor
*/
public List<String> getNeighbours() {
KeyStep getNeighboursKeySeq[] = new KeyStep[]{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
import java.util.Random;
import java.util.concurrent.atomic.AtomicBoolean;

/**
* Description:
*/
public class SamsungMulticlientRilExecutor implements OemRilExecutor {

private final Logger log = AndroidLogger.forClass(SamsungMulticlientRilExecutor.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@
import io.freefair.android.util.logging.Logger;

/**
* Description: This starts the (background?) AIMSICD service to check for SMS and track
* cells with or without GPS enabled.
* TODO: better and more detailed explanation!
* This starts the (background?) AIMSICD service to check for SMS and track
* cells with or without GPS enabled.
*/
public class AimsicdService extends InjectionService {

Expand Down
Loading

0 comments on commit 4629f7e

Please sign in to comment.