enable TransProxy and DNSPort by default without root

- some users run their own iptables transproxy scripts with AFWall and need Orbot to have these ports open by default. There is no risk to enable them by default, so we'll them on for now, and think about how to better make this a user option in the future.
This commit is contained in:
Nathan Freitas 2016-01-28 09:24:07 -05:00
parent b76a2504bb
commit fd45fa38f6
1 changed files with 11 additions and 17 deletions

View File

@ -637,26 +637,21 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
extraLines.append("SafeSocks 0").append('\n');
extraLines.append("TestSocks 0").append('\n');
extraLines.append("WarnUnsafeSocks 1").append('\n');
if (Prefs.useTransparentProxying())
{
String transPort = prefs.getString("pref_transport", TorServiceConstants.TOR_TRANSPROXY_PORT_DEFAULT+"");
String dnsPort = prefs.getString("pref_dnsport", TorServiceConstants.TOR_DNS_PORT_DEFAULT+"");
String transPort = prefs.getString("pref_transport", TorServiceConstants.TOR_TRANSPROXY_PORT_DEFAULT+"");
String dnsPort = prefs.getString("pref_dnsport", TorServiceConstants.TOR_DNS_PORT_DEFAULT+"");
extraLines.append("TransPort ").append(transPort).append('\n');
extraLines.append("DNSPort ").append(dnsPort).append("\n");
extraLines.append("TransPort ").append(transPort).append('\n');
extraLines.append("DNSPort ").append(dnsPort).append("\n");
if (Prefs.transparentTethering())
{
extraLines.append("TransListenAddress 0.0.0.0").append('\n');
extraLines.append("DNSListenAddress 0.0.0.0").append('\n');
}
extraLines.append("VirtualAddrNetwork 10.192.0.0/10").append('\n');
extraLines.append("AutomapHostsOnResolve 1").append('\n');
if (Prefs.transparentTethering())
{
extraLines.append("TransListenAddress 0.0.0.0").append('\n');
extraLines.append("DNSListenAddress 0.0.0.0").append('\n');
}
extraLines.append("VirtualAddrNetwork 10.192.0.0/10").append('\n');
extraLines.append("AutomapHostsOnResolve 1").append('\n');
extraLines.append("DisableNetwork 0").append('\n');
@ -830,7 +825,6 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
}
SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext());
String transProxy = prefs.getString("pref_transport", TorServiceConstants.TOR_TRANSPROXY_PORT_DEFAULT+"");
String dnsPort = prefs.getString("pref_dnsport", TorServiceConstants.TOR_TRANSPROXY_PORT_DEFAULT+"");