fix bug with wrong apps being transproxied (typo!)

This commit is contained in:
Nathan Freitas 2014-06-27 13:02:21 -04:00
parent 312c6da2c7
commit e13d228dfc
1 changed files with 8 additions and 7 deletions

View File

@ -344,8 +344,6 @@ public class TorTransProxy implements TorServiceConstants {
String srcChainName = "OUTPUT";
int torUid = context.getApplicationInfo().uid;
//run the delete commands in a separate process as it might error out
//String[] cmdExecClear = {script.toString()};
//code = TorServiceUtils.doShellCommand(cmdExecClear, res, runRoot, waitFor);
@ -407,7 +405,7 @@ public class TorTransProxy implements TorServiceConstants {
script.append(" -t nat");
script.append(" -A ").append(srcChainName);
script.append(" -p udp");
script.append(" -m owner ! --uid-owner ");
script.append(" -m owner --uid-owner ");
script.append(tApp.getUid());
script.append(" -m udp --dport ");
script.append(STANDARD_DNS_PORT);
@ -441,9 +439,12 @@ public class TorTransProxy implements TorServiceConstants {
{
SimpleCommand cmd = new SimpleCommand(cmdString + "|| exit");
shell.add(cmd);
logMessage(cmdString);// + "; exit=" + cmd.getExitCode() + ";output=" + cmd.getOutput());
int exitCode = cmd.getExitCode();
String output = cmd.getOutput();
return cmd.getExitCode();
logMessage(cmdString + "; exit=" + exitCode + ";output=" + output);
return exitCode;
}