[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r21825: {projects} Add FascistFirewall preference (projects/android/trunk/Orbot/src/org/torproject/android)



Author: ioerror
Date: 2010-03-06 02:06:00 +0000 (Sat, 06 Mar 2010)
New Revision: 21825

Modified:
   projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java
Log:
Add FascistFirewall preference

Modified: projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java
===================================================================
--- projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java	2010-03-06 01:27:51 UTC (rev 21824)
+++ projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java	2010-03-06 02:06:00 UTC (rev 21825)
@@ -460,6 +460,8 @@
 
         boolean becomeRelay = prefs.getBoolean(PREF_OR, false);
 
+        boolean fascistFirewall = prefs.getBoolean(PREF_FASCIST_FIREWALL,false);
+
 		enableTransparentProxy = prefs.getBoolean(PREF_TRANSPARENT, false);
 		
 		if (hasRoot)
@@ -514,8 +516,29 @@
 
         try
         {
-            if (becomeRelay && !useBridges)
+            if (fascistFirewall)
             {
+                String fascistFirewallPorts =
+                    prefs.getString(PREF_FASCIST_FIREWALL_PORTS, "80,443");
+
+                torrcText.append("FascistFirewall 1");
+                torrcText.append('\n');
+                torrcText.append("FirewallPorts ");
+                // We should verify this and someday, the Exception will matter :-)
+                torrcText.append(fascistFirewallPorts);
+                torrcText.append('\n');
+            }
+        }
+        catch (Exception e)
+        {
+            Toast.makeText(this,Â"Your FascistFirewall settings caused an exception!",
+                           Toast.LENGTH_LONG).show();
+        }
+
+        try
+        {
+            if (becomeRelay && !useBridges && !fascistFirewall)
+            {
                 int ORPort =  Integer.parseInt(prefs.getString(PREF_OR_PORT, "9001"));
                 String nickname = prefs.getString(PREF_OR_NICKNAME, "Orbot");