From 247e2ed86d1212f78a80b421ca85647da2b32509 Mon Sep 17 00:00:00 2001 From: Nathan Freitas Date: Tue, 24 Jun 2014 10:06:11 -0400 Subject: [PATCH] don't kill Tor process and make sure service is sticky --- src/org/torproject/android/service/TorService.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java index 7830a685..35fbbc5d 100644 --- a/src/org/torproject/android/service/TorService.java +++ b/src/org/torproject/android/service/TorService.java @@ -268,7 +268,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst { new startTorOperation().execute(intent); - return Service.START_NOT_STICKY; + return Service.START_STICKY; } catch (Exception e) @@ -469,9 +469,9 @@ public class TorService extends Service implements TorServiceConstants, TorConst conn = null; } - killProcess(fileTor); + // killProcess(fileTor); killProcess(filePolipo); - killProcess(fileObfsclient); + // killProcess(fileObfsclient); } @@ -484,7 +484,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst while ((procId = TorServiceUtils.findProcessId(fileProcBin.getCanonicalPath())) != -1) { - logNotice("Found fileObfsclient PID=" + procId + " - killing now..."); + logNotice("Found " + fileProcBin.getName() + " PID=" + procId + " - killing now..."); SimpleCommand killCommand = new SimpleCommand("toolbox kill " + procId); shell.add(killCommand); @@ -582,8 +582,8 @@ public class TorService extends Service implements TorServiceConstants, TorConst if (!fileBin.canExecute()) { logNotice("(re)Setting permission on binary: " + fileBin.getCanonicalPath()); - Shell shell = Shell.startShell(new ArrayList(), appBinHome.getCanonicalPath()); - + //Shell shell = Shell.startShell(new ArrayList(), appBinHome.getCanonicalPath()); + Shell shell = Shell.startShell(); shell.add(new SimpleCommand("chmod " + CHMOD_EXE_VALUE + ' ' + fileBin.getCanonicalPath())).waitForFinish(); File fileTest = new File(fileBin.getCanonicalPath());