ensure all iptables rules are always wiped

and reapply rules settings if modifed after settings menu accessed
This commit is contained in:
Nathan Freitas 2014-09-07 09:34:48 -04:00
parent 3d67ce58bb
commit b35a239e44
2 changed files with 38 additions and 12 deletions

View File

@ -815,8 +815,14 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic
e.printStackTrace(); e.printStackTrace();
} }
} }
else else if (torStatus == TorServiceConstants.STATUS_ON)
{ {
try {
mService.processSettings();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Toast.makeText(this, R.string.you_may_need_to_stop_and_start_orbot_for_settings_change_to_be_enabled_, Toast.LENGTH_SHORT).show(); Toast.makeText(this, R.string.you_may_need_to_stop_and_start_orbot_for_settings_change_to_be_enabled_, Toast.LENGTH_SHORT).show();
} }

View File

@ -898,13 +898,9 @@ public class TorService extends Service implements TorServiceConstants, TorConst
if (mTransProxy == null) if (mTransProxy == null)
mTransProxy = new TorTransProxy(this, fileXtables); mTransProxy = new TorTransProxy(this, fileXtables);
if (mTransProxyAll)
mTransProxy.setTransparentProxyingAll(this, false); mTransProxy.setTransparentProxyingAll(this, false);
else
{
ArrayList<TorifiedApp> apps = AppManager.getApps(this, TorServiceUtils.getSharedPrefs(getApplicationContext())); ArrayList<TorifiedApp> apps = AppManager.getApps(this, TorServiceUtils.getSharedPrefs(getApplicationContext()));
mTransProxy.setTransparentProxyingByApp(this, apps, false); mTransProxy.setTransparentProxyingByApp(this, apps, false);
}
return true; return true;
} }
@ -1730,7 +1726,31 @@ public class TorService extends Service implements TorServiceConstants, TorConst
public void processSettings () public void processSettings ()
{ {
/*
try {
boolean hadEnableTransparentProxy = mEnableTransparentProxy;
updateSettings ();
if (mHasRoot)
{
if (hadEnableTransparentProxy)
disableTransparentProxy();
if (mEnableTransparentProxy)
{
disableTransparentProxy();
enableTransparentProxy();
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Thread thread = new Thread() Thread thread = new Thread()
{ {
@ -1750,7 +1770,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst
}; };
thread.start(); thread.start();
*/
} }