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

[tor-commits] r24753: {projects} added exit node option to preferences (in projects/android/trunk/Orbot/src/org/torproject/android: . service)



Author: n8fr8
Date: 2011-05-16 03:50:10 +0000 (Mon, 16 May 2011)
New Revision: 24753

Modified:
   projects/android/trunk/Orbot/src/org/torproject/android/SettingsPreferences.java
   projects/android/trunk/Orbot/src/org/torproject/android/service/TorService.java
   projects/android/trunk/Orbot/src/org/torproject/android/service/TorTransProxy.java
Log:
added exit node option to preferences


Modified: projects/android/trunk/Orbot/src/org/torproject/android/SettingsPreferences.java
===================================================================
--- projects/android/trunk/Orbot/src/org/torproject/android/SettingsPreferences.java	2011-05-16 03:49:54 UTC (rev 24752)
+++ projects/android/trunk/Orbot/src/org/torproject/android/SettingsPreferences.java	2011-05-16 03:50:10 UTC (rev 24753)
@@ -77,7 +77,7 @@
 			
 		}
 		
-		int hiddenGroupIdx = 5;
+		int hiddenGroupIdx = 6;
 		
 		prefHiddenServices = ((CheckBoxPreference)((PreferenceCategory)this.getPreferenceScreen().getPreference(hiddenGroupIdx)).getPreference(0));
 		prefHiddenServices.setOnPreferenceClickListener(this);

Modified: projects/android/trunk/Orbot/src/org/torproject/android/service/TorService.java
===================================================================
--- projects/android/trunk/Orbot/src/org/torproject/android/service/TorService.java	2011-05-16 03:49:54 UTC (rev 24752)
+++ projects/android/trunk/Orbot/src/org/torproject/android/service/TorService.java	2011-05-16 03:50:10 UTC (rev 24753)
@@ -1288,6 +1288,10 @@
 
         boolean enableHiddenServices = prefs.getBoolean("pref_hs_enable", false);
 
+        boolean enableStrictExitNodes = prefs.getBoolean("pref_strict_exit_nodes", false);
+        String exitNodes = prefs.getString("pref_exit_nodes", "");
+        
+        
 		//boolean enableTransparentProxy = prefs.getBoolean(TorConstants.PREF_TRANSPARENT, false);
 		
         if (currentStatus == STATUS_ON)
@@ -1303,6 +1307,14 @@
 				logException("unable to setup transproxy",e);
 			}
         }
+        
+        if (exitNodes.length() > 0)
+        {
+        	
+			mBinder.updateConfiguration("ExitNodes", exitNodes, false);
+			mBinder.updateConfiguration("StrictExitNodes", enableStrictExitNodes ? "1" : "0", false);
+			
+        }
 		
 		if (useBridges)
 		{

Modified: projects/android/trunk/Orbot/src/org/torproject/android/service/TorTransProxy.java
===================================================================
--- projects/android/trunk/Orbot/src/org/torproject/android/service/TorTransProxy.java	2011-05-16 03:49:54 UTC (rev 24752)
+++ projects/android/trunk/Orbot/src/org/torproject/android/service/TorTransProxy.java	2011-05-16 03:50:10 UTC (rev 24753)
@@ -335,15 +335,17 @@
 		
 		script.append(ipTablesPath);
 		script.append(" -I FORWARD");
-		script.append(" -s 192.168.43.0/24 -j ACCEPT");
+		script.append(" -j ACCEPT");
 		script.append(" || exit\n");
 		
+		/*
 		script.append(ipTablesPath);
 		script.append(" -P FORWARD DROP");
 		script.append(" || exit\n");
+		*/
 		
 		script.append(ipTablesPath);
-		script.append(" -t nat -I POSTROUTING -s 192.168.43.0/24 -j MASQUERADE");
+		script.append(" -t nat -I POSTROUTING -j MASQUERADE");
 		script.append(" || exit\n");
 		
 		String[] cmdAdd = {script.toString()};    	
@@ -372,8 +374,8 @@
     	
     	purgeIptables(context);
     	
-    	//enableWifiHotspotRules(context);
-    	
+    	enableWifiHotspotRules(context);
+		
     	int torUid = context.getApplicationInfo().uid;
 
     	// Set up port redirection
@@ -472,6 +474,8 @@
 		String msg = res.toString();
 		TorService.logMessage(cmdAdd[0] + ";errCode=" + code + ";resp=" + msg);
 		
+    	
+    	
     	return code;
 	}	
 	

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits