This commit is contained in:
HappyZ 2017-02-25 10:00:46 -08:00
parent f19c1ae093
commit 8163cc5ad7
1 changed files with 17 additions and 8 deletions

View File

@ -670,9 +670,14 @@ class MainActivity extends Activity {
txt_results.append("Starting.. will come back after 1min\n"); txt_results.append("Starting.. will come back after 1min\n");
} }
}); });
// disable tcpdump // // disable tcpdump
boolean isUsingTCPDump_backup = isUsingTCPDump; // boolean isUsingTCPDump_backup = isUsingTCPDump;
isUsingTCPDump = false; // isUsingTCPDump = false;
String[] commd = new String[3];
commd[0] = "su";
commd[1] = "&&";
commd[2] = "cd " + outFolderPath
+ " && rm *.cpu *.cpuRaw *.ss tcpdump*";
// change screen brightness to 0 // change screen brightness to 0
Utilities.switchScreenStatus(); Utilities.switchScreenStatus();
@ -700,18 +705,22 @@ class MainActivity extends Activity {
"yyyyMMdd_HHmmss", Locale.US) "yyyyMMdd_HHmmss", Locale.US)
.format(new Date())) .format(new Date()))
+ ".tar.gz"; + ".tar.gz";
String[] commd = new String[3];
commd[0] = "su";
commd[1] = "&&";
commd[2] = "cd " + outFolderPath commd[2] = "cd " + outFolderPath
+ " && busybox tar -czf " + " && busybox tar -czf "
+ tarName + " *.cpu *.cpuRaw *.ss"; + tarName + " *.cpu *.cpuRaw *.ss tcpdump*";
try { try {
Runtime.getRuntime().exec(commd).waitFor(); Runtime.getRuntime().exec(commd).waitFor();
} catch (InterruptedException | IOException e) { } catch (InterruptedException | IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
isUsingTCPDump = isUsingTCPDump_backup; commd[2] = "cd " + outFolderPath
+ " && rm *.cpu *.cpuRaw *.ss tcpdump*";
try {
Runtime.getRuntime().exec(commd).waitFor();
} catch (InterruptedException | IOException e) {
e.printStackTrace();
}
// isUsingTCPDump = isUsingTCPDump_backup;
// msg indicating all done // msg indicating all done
myHandler.post(new Runnable() { myHandler.post(new Runnable() {
@Override @Override