From 92d19e3402874a9e77803e34f6d2779a780b7c5d Mon Sep 17 00:00:00 2001 From: Nathan Freitas Date: Sun, 12 Jan 2014 22:14:30 -0500 Subject: [PATCH] ensures binary permissions are set --- .../android/service/TorService.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java index b0529519..f27f8355 100644 --- a/src/org/torproject/android/service/TorService.java +++ b/src/org/torproject/android/service/TorService.java @@ -587,19 +587,30 @@ public class TorService extends Service implements TorServiceConstants, TorConst boolean success = installer.installResources(); } - + + try + { + setBinaryPerms(); + } + catch (Exception e) + { + logNotice("Error setting binary permissions: " + e.toString()); + } } - - /* private void setBinaryPerms () throws Exception { + + logNotice("Is Tor binary exec? " + fileTorOrig.canExecute()); + logNotice("Is Tor binary exec? " + filePrivoxy.canExecute()); + logNotice("Is Tor binary exec? " + fileObfsProxy.canExecute()); + StringBuilder log = new StringBuilder (); logNotice("(re)Setting permission on Tor binary"); - String[] cmd1 = {SHELL_CMD_CHMOD + ' ' + CHMOD_EXE_VALUE + ' ' + fileTor.getAbsolutePath()}; + String[] cmd1 = {SHELL_CMD_CHMOD + ' ' + CHMOD_EXE_VALUE + ' ' + fileTorOrig.getAbsolutePath()}; TorServiceUtils.doShellCommand(cmd1, log, false, true); logNotice("(re)Setting permission on Privoxy binary"); @@ -610,7 +621,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst String[] cmd3 = {SHELL_CMD_CHMOD + ' ' + CHMOD_EXE_VALUE + ' ' + fileObfsProxy.getAbsolutePath()}; TorServiceUtils.doShellCommand(cmd3, log, false, true); - }*/ + } private boolean mHasRoot = false; private boolean mEnableTransparentProxy = false;