change how we look for processes to kill. fixes tor trac #18502
This commit is contained in:
parent
cec82ec0de
commit
2973eaccd8
|
@ -488,15 +488,6 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
|
|||
cannotKillFile = OrbotApp.fileObfsclient;
|
||||
}
|
||||
|
||||
/**
|
||||
try {
|
||||
TorServiceUtils.killProcess(OrbotApp.fileMeekclient);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
cannotKillFile = OrbotApp.fileMeekclient;
|
||||
}
|
||||
*/
|
||||
|
||||
try {
|
||||
TorServiceUtils.killProcess(OrbotApp.filePolipo);
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -85,9 +85,7 @@ public class TorServiceUtils implements TorServiceConstants {
|
|||
|
||||
Process procPs = null;
|
||||
|
||||
String processKey = new File(command).getName();
|
||||
|
||||
procPs = r.exec(SHELL_CMD_PS + ' ' + processKey); // this is the android ps <name> command
|
||||
procPs = r.exec(SHELL_CMD_PS); // this is the android ps <name> command
|
||||
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(procPs.getInputStream()));
|
||||
String line = null;
|
||||
|
@ -97,7 +95,7 @@ public class TorServiceUtils implements TorServiceConstants {
|
|||
if (line.contains("PID"))
|
||||
continue;
|
||||
|
||||
if (line.contains('/' + processKey))
|
||||
if (line.contains(command))
|
||||
{
|
||||
|
||||
String[] lineParts = line.split("\\s+");
|
||||
|
|
|
@ -384,12 +384,13 @@ public class OrbotVpnService extends VpnService implements Handler.Callback {
|
|||
@Override
|
||||
public void onRevoke() {
|
||||
|
||||
Log.w(TAG,"VPNService REVOKED!");
|
||||
|
||||
if (!isRestart)
|
||||
{
|
||||
SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext());
|
||||
prefs.edit().putBoolean("pref_vpn", false).commit();
|
||||
stopVPN();
|
||||
|
||||
}
|
||||
|
||||
isRestart = false;
|
||||
|
|
Loading…
Reference in New Issue