updates to properly support tor-tether mode
This commit is contained in:
parent
73265cec1d
commit
ef5c506fdd
|
@ -1,14 +1,14 @@
|
|||
SocksPort 9050
|
||||
SafeSocks 1
|
||||
Log notice stdout
|
||||
ControlListenAddress 127.0.0.1
|
||||
ControlPort 9051
|
||||
CookieAuthentication 1
|
||||
RelayBandwidthRate 20 KBytes
|
||||
RelayBandwidthBurst 20 KBytes
|
||||
UseBridges 0
|
||||
AutomapHostsOnResolve 1
|
||||
TransListenAddress 0.0.0.0
|
||||
TransListenAddress 127.0.0.1
|
||||
TransPort 9040
|
||||
DNSListenAddress 0.0.0.0
|
||||
DNSPort 5400
|
||||
|
||||
DNSListenAddress 127.0.0.1
|
||||
DNSPort 5400
|
|
@ -0,0 +1,14 @@
|
|||
SocksPort 9050
|
||||
SafeSocks 1
|
||||
Log notice stdout
|
||||
ControlListenAddress 127.0.0.1
|
||||
ControlPort 9051
|
||||
CookieAuthentication 1
|
||||
RelayBandwidthRate 20 KBytes
|
||||
RelayBandwidthBurst 20 KBytes
|
||||
UseBridges 0
|
||||
AutomapHostsOnResolve 1
|
||||
TransListenAddress 0.0.0.0
|
||||
TransPort 9040
|
||||
DNSListenAddress 0.0.0.0
|
||||
DNSPort 5400
|
|
@ -588,7 +588,10 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
|
|||
lblStatus.setText(lblMsg);
|
||||
|
||||
if (torServiceMsg != null && torServiceMsg.length() > 0)
|
||||
showAlert("Update", torServiceMsg, false);
|
||||
{
|
||||
// showAlert("Update", torServiceMsg, false);
|
||||
lblStatus.setText(torServiceMsg);
|
||||
}
|
||||
|
||||
boolean showFirstTime = prefs.getBoolean("connect_first_time",true);
|
||||
|
||||
|
|
|
@ -50,6 +50,9 @@ public class TorBinaryInstaller implements TorServiceConstants {
|
|||
is = context.getResources().openRawResource(R.raw.torrc);
|
||||
streamToFile(is,installFolder, TORRC_ASSET_KEY, false, false);
|
||||
|
||||
is = context.getResources().openRawResource(R.raw.torrctether);
|
||||
streamToFile(is,installFolder, TORRC_TETHER_KEY, false, false);
|
||||
|
||||
is = context.getResources().openRawResource(R.raw.privoxy);
|
||||
streamToFile(is,installFolder, PRIVOXY_ASSET_KEY, false, false);
|
||||
|
||||
|
|
|
@ -582,6 +582,10 @@ public class TorService extends Service implements TorServiceConstants, TorConst
|
|||
showAlert("Status", "TransProxy enabled for Tethering!");
|
||||
|
||||
TorTransProxy.enableTetheringRules(this);
|
||||
|
||||
// mBinder.updateConfiguration("TransListenAddress", "0.0.0.0", false);
|
||||
// mBinder.updateConfiguration("DNSListenAddress", "0.0.0.0", false);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -617,6 +621,14 @@ public class TorService extends Service implements TorServiceConstants, TorConst
|
|||
|
||||
String torrcPath = new File(appBinHome, TORRC_ASSET_KEY).getAbsolutePath();
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
boolean transProxyTethering = prefs.getBoolean("pref_transparent_tethering", false);
|
||||
|
||||
if (transProxyTethering)
|
||||
{
|
||||
torrcPath = new File(appBinHome, TORRC_TETHER_KEY).getAbsolutePath();
|
||||
}
|
||||
|
||||
String[] torCmd = {torBinaryPath + " DataDirectory " + appDataHome.getAbsolutePath() + " -f " + torrcPath + " || exit\n"};
|
||||
|
||||
boolean runAsRootFalse = false;
|
||||
|
@ -1430,7 +1442,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst
|
|||
mBinder.updateConfiguration("HiddenServiceDir","", false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
mBinder.saveConfiguration();
|
||||
|
||||
return true;
|
||||
|
|
|
@ -15,6 +15,8 @@ public interface TorServiceConstants {
|
|||
|
||||
//torrc (tor config file)
|
||||
public final static String TORRC_ASSET_KEY = "torrc";
|
||||
public final static String TORRC_TETHER_KEY = "torrctether";
|
||||
|
||||
public final static String TOR_CONTROL_COOKIE = "control_auth_cookie";
|
||||
|
||||
//how to launch tor
|
||||
|
|
|
@ -137,6 +137,18 @@ public class Permissions extends Activity implements TorConstants {
|
|||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean hasRoot = prefs.getBoolean("has_root",false);
|
||||
|
||||
|
||||
if (!hasRoot)
|
||||
{
|
||||
|
||||
hasRoot = TorServiceUtils.isRootPossible();
|
||||
|
||||
Editor pEdit = prefs.edit();
|
||||
pEdit.putBoolean(PREF_HAS_ROOT,hasRoot);
|
||||
pEdit.commit();
|
||||
|
||||
}
|
||||
|
||||
if (hasRoot)
|
||||
{
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue