fixes for transparent proxy tethering

This commit is contained in:
Nathan Freitas 2014-08-02 01:15:01 -04:00
parent 0709b0e486
commit 803620957a
2 changed files with 8 additions and 12 deletions

View File

@ -78,11 +78,6 @@ public class TorResourceInstaller implements TorServiceConstants {
shell.add(new SimpleCommand(COMMAND_RM_FORCE + outFile.getAbsolutePath())).waitForFinish();
streamToFile(is,outFile, false, false);
is = context.getResources().openRawResource(R.raw.torrctether);
outFile = new File(installFolder, TORRC_TETHER_KEY);
shell.add(new SimpleCommand(COMMAND_RM_FORCE + outFile.getAbsolutePath())).waitForFinish();
streamToFile(is, outFile, false, false);
is = context.getResources().openRawResource(R.raw.torpolipo);
outFile = new File(installFolder, POLIPOCONFIG_ASSET_KEY);
shell.add(new SimpleCommand(COMMAND_RM_FORCE + outFile.getAbsolutePath())).waitForFinish();

View File

@ -642,6 +642,14 @@ public class TorService extends Service implements TorServiceConstants, TorConst
String transPort = prefs.getString("pref_transport", TorServiceConstants.TOR_TRANSPROXY_PORT_DEFAULT+"");
String dnsPort = prefs.getString("pref_dnsport", TorServiceConstants.TOR_DNS_PORT_DEFAULT+"");
if (mTransProxyTethering)
{
extraLines.append("TransListenAddress 0.0.0.0").append('\n');
extraLines.append("DNSListenAddress 0.0.0.0").append('\n');
}
extraLines.append("RunAsDaemon 1").append('\n');
extraLines.append("AvoidDiskWrites 1").append('\n');
@ -850,13 +858,6 @@ public class TorService extends Service implements TorServiceConstants, TorConst
SharedPreferences prefs =TorServiceUtils.getSharedPrefs(getApplicationContext());
String torrcPath = new File(appBinHome, TORRC_ASSET_KEY).getCanonicalPath();
boolean transProxyTethering = prefs.getBoolean("pref_transparent_tethering", false);
if (transProxyTethering)
{
torrcPath = new File(appBinHome, TORRC_TETHER_KEY).getCanonicalPath();
}
int torRetryWaitTimeMS = 1000;