commit 3b9d6c8eaa95df6f8befb86e290a31619df9a858 Author: Nathan Freitas nathan@freitas.net Date: Wed Jan 15 00:33:51 2014 -0500
make sure Tor path link is cleanly setup and chmod'd --- src/org/torproject/android/service/TorService.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java index 345737c..fd02121 100644 --- a/src/org/torproject/android/service/TorService.java +++ b/src/org/torproject/android/service/TorService.java @@ -512,22 +512,18 @@ public class TorService extends Service implements TorServiceConstants, TorConst else { + StringBuilder log = new StringBuilder(); + String[] cmdDel = { SHELL_CMD_RM + ' ' + fileTorLink.getAbsolutePath() }; + int errCode = TorServiceUtils.doShellCommand(cmdDel,log, false, true); + logNotice("link RM err=" + errCode + " out: " + log.toString()); - if (fileTorLink.exists()) - { - StringBuilder log = new StringBuilder(); - String[] cmdDel = { "rm " + fileTorLink.getAbsolutePath() }; - int errCode = TorServiceUtils.doShellCommand(cmdDel,log, false, true); - logNotice("link RM err=" + errCode + " out: " + log.toString()); - } - - StringBuilder log = new StringBuilder(); + log = new StringBuilder(); String[] cmd = { SHELL_CMD_LINK + ' ' + fileTorOrig.getAbsolutePath() + ' ' + fileTorLink.getAbsolutePath() }; - int errCode = TorServiceUtils.doShellCommand(cmd,log, false, true); + errCode = TorServiceUtils.doShellCommand(cmd,log, false, true); logNotice("link LN err=" + errCode + " out: " + log.toString()); enableBinExec(fileTorOrig); - + enableBinExec(fileTorLink); enableBinExec(filePrivoxy); enableBinExec(fileObfsProxy); enableBinExec(fileXtables);