-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChromeHandler.java
executable file
·29 lines (22 loc) · 991 Bytes
/
ChromeHandler.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import java.io.OutputStream;
class ChromeHandler implements ApplicationHandler{
String guChromeCommand = "cmd /c \"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome_proxy.exe\" --profile-directory=Default --app-id=mhjfjjkadhogdhjmnhijeaigeecldjfi";
@Override
public boolean runApp() throws java.io.IOException{
Process dos = Runtime.getRuntime().exec(guChromeCommand);
return true;
}
@Override
public boolean closeApp() throws java.io.IOException{
Process dos = Runtime.getRuntime().exec("cmd /c TASKKILL /IM chrome.exe");
return true;
}
@Override
public boolean killProcess() throws java.io.IOException{
Process dos = Runtime.getRuntime().exec("cmd /c start cmd.exe");
OutputStream out = dos.getOutputStream();
out.write("TSKILL chrome/r/n".getBytes());
out.flush();
return true;
}
}