|
||||||
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 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, 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 | |
---|---|
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()
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 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 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() 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 |