|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectActivity
com.wjholden.nmap.NmapMain
public class NmapMain
Nmap for Android! The original versions used Nmap binaries I got from Robert McCurdy (http://rmccurdy.com/stuff/G1/BINS/NMAP/). Around v0.3 or Vlatko Kosturjak build newer binaries based on Nmap 5.3 (http://ftp.linux.hr/android/nmap/).
Field Summary | |
---|---|
static java.lang.String |
bindir
this is where the nmap/nping/ncat compiled binaries should be stored. |
static boolean |
canGetRoot
tells us if "su" command is available |
static boolean |
debug
This variable is set by the user with the context menu. |
private boolean |
deletePreferences
After reinstalling binaries, wipe the preferences. |
static Handler |
handler
handler for inter-thread communication |
static boolean |
hasRunOneScan
tells us whether one or more scans have been executed |
static boolean |
installVerified
if "VerifyInstallation()" method has run this should be set to true |
private EditText |
mArguments
Input area where command-line arguments (other than target IP) |
private Spinner |
mCommandSpinner
Command spinner switches between Nmap, Nping, and Ncat |
private Button |
mHelp
Help button, shows result of [command] --help |
private Spinner |
mOutputSpinner
Switches between Nmap, XML, and Grepable Nmap output |
private TextView |
mResults
Text area where results are shown |
private Button |
mShare
Share button, launches Compose Email activity with message body of any data in mResults |
private Button |
mStart
Start button initiates scan |
private EditText |
mTarget
Input area where user supplies scan target |
static java.lang.String |
outputArgs
the command to be executed (nmap, nping, ncat) and optional (and mandatory) command line arguments from mArguments |
static ProgressDialog |
progressDialog
Static so that the other classes can turn it off after it runs. |
static int |
scanType
tells the scanning engine what command is to be executed (nmap, nping, ncat) |
private SharedPreferences |
settings
Store both user and application settings in here. |
static java.lang.String |
shellCmdLoc
location of the 'su' command, if present, otherwise 'sh'. |
private |
sTask
scanning engine thread |
private |
vTask
verify installation thread |
Fields inherited from interface com.wjholden.nmap.NmapConstants |
---|
BUFFER_SIZE, FORCE_RESTART, INSTALL_ERROR, INSTALL_FILENAMES, INSTALL_GOOD, INSTALL_NO_ROOT, INSTALL_RESOURCES, MG_DEBUG, MG_DEFAULT, MI_DEBUG_EMAIL, MI_DEBUG_ENABLE, MI_EXIT, MI_MORE_HELP, MI_REINSTALL, MI_SURVEY, RUN_COMPLETE, RUN_ERROR, RUN_LINE, SCANTYPE_NCAT, SCANTYPE_NDIFF, SCANTYPE_NMAP, SCANTYPE_NPING, TAG, THREAD_ERROR |
Constructor Summary | |
---|---|
NmapMain()
|
Method Summary | |
---|---|
private void |
forceRestart()
Added 0.4.7. |
private void |
initBindir()
|
private void |
initButtons()
AFTER initScreen() has been called, assign callbacks to buttons. |
private void |
initHandler()
Initializes the handler. |
private void |
initScreen()
Maps the buttons, text areas, and spinners to program variables. |
private void |
initVariables()
Use the Settings object to grab program variables from XML and set them appropriately. |
void |
onCreate(Bundle bundle)
|
protected void |
onDestroy()
|
boolean |
onMenuItemSelected(int featureId,
MenuItem item)
|
protected void |
onPause(Bundle outState)
|
boolean |
onPrepareOptionsMenu(Menu menu)
|
protected void |
onResume(Bundle bundle)
|
private void |
saveUserEntry()
Saves user preferences using the SharedPreferences.Editor object. |
private void |
showApkInfo()
Print program version and SDK version to log. |
private void |
showWifiInfo()
Try to get the SSID and IP. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String bindir
public static boolean canGetRoot
public static boolean debug
private boolean deletePreferences
public static Handler handler
public static boolean hasRunOneScan
public static boolean installVerified
private transient EditText mArguments
private transient Spinner mCommandSpinner
private transient Button mHelp
private transient Spinner mOutputSpinner
private transient TextView mResults
private transient Button mShare
private transient Button mStart
private transient EditText mTarget
public static java.lang.String outputArgs
public static ProgressDialog progressDialog
public static int scanType
private transient SharedPreferences settings
public static java.lang.String shellCmdLoc
private transientsTask
private transientvTask
Constructor Detail |
---|
public NmapMain()
Method Detail |
---|
private void forceRestart()
private void initBindir()
private void initButtons()
private void initHandler()
private void initScreen()
private void initVariables()
public void onCreate(Bundle bundle)
protected void onDestroy()
public boolean onMenuItemSelected(int featureId, MenuItem item)
protected void onPause(Bundle outState)
public boolean onPrepareOptionsMenu(Menu menu)
protected void onResume(Bundle bundle)
private void saveUserEntry()
private void showApkInfo()
private void showWifiInfo()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |