|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wjholden.nmap.NmapInstall
public class NmapInstall
Verifies the installation of Nmap binaries asynchronously.
Checks whether root permissions are available or not (Nmap.canGetRoot).
Creates the binary directory (Nmap.bindir).
TODO: Use md5 sums of files to ensure integrity.
Field Summary | |
---|---|
private java.lang.String |
bindir
|
private Context |
context
|
private boolean |
forceRestart
If the second parameter sent to new NmapInstall(Context, String) is "restart" then NmapInstall will send a message to NmapMain.handler telling it to restart the app after install completes. |
private Resources |
resources
Once you have the application Context, use that to establish a Resources object that can be used to open the R.raw.* files. |
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, MG_SUBNET, MI_BIN, MI_DEBUG_EMAIL, MI_DEBUG_ENABLE, MI_DEC, MI_EMAIL_SUBNET, MI_EXIT, MI_HEX, MI_MORE_HELP, MI_REINSTALL, MI_SUBNET, MI_SURVEY, RUN_COMPLETE, RUN_ERROR, RUN_SUCCESS_NO_FILE, SCANTYPE_NCAT, SCANTYPE_NDIFF, SCANTYPE_NMAP_5_30, SCANTYPE_NMAP_5_50, SCANTYPE_NPING, SET_TITLE, SUBNET_CONNECTED, SUBNET_DISCONNECTED, SUBNET_POLL_INTERVAL, TAG, THREAD_ERROR |
Constructor Summary | |
---|---|
NmapInstall()
|
Method Summary | |
---|---|
private void |
createNewFileAndDeleteExisting(java.lang.String path)
Simple method for deleting a file if it does not exist. |
protected java.lang.Void |
doInBackground(java.lang.Object... params)
|
protected void |
onPostExecute(java.lang.Void myVoid)
|
private void |
setPermissions()
Uses CHMOD and CHOWN to set permissions based on NmapMain.canGetRoot. |
private void |
writeNcat()
Write the Ncat file to disk. |
private void |
writeNmap_5_30BETA1()
Writes the Nmap binary to filesystem as provided in the R.raw.nmap_a-c resources. Uses whatever Nmap.bindir as the location to write nmap. |
private boolean |
writeNmap_5_50()
|
private void |
writeOthers(java.lang.String filename,
int resource)
Write the other files to disk. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private transient java.lang.String bindir
private transient Context context
private transient boolean forceRestart
private transient Resources resources
Constructor Detail |
---|
public NmapInstall()
Method Detail |
---|
private void createNewFileAndDeleteExisting(java.lang.String path)
path
- protected java.lang.Void doInBackground(java.lang.Object... params)
protected void onPostExecute(java.lang.Void myVoid)
private void setPermissions() throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
private void writeNcat() throws java.io.IOException
java.io.IOException
private void writeNmap_5_30BETA1() throws java.io.IOException
java.io.IOException
private boolean writeNmap_5_50() throws java.io.IOException
java.io.IOException
private void writeOthers(java.lang.String filename, int resource) throws java.io.IOException
filename
- Filename that corresponds with the resource.resource
- Resource in R.raw.*.
java.io.IOException
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |