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

[tor-commits] [orbot/master] keep SOCKS port as default 9050 (instead of 'auto')



commit 451cfed0ac1ba204619e9a426a77001563ad21ff
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
Date:   Fri Jun 6 17:01:18 2014 -0400

    keep SOCKS port as default 9050 (instead of 'auto')
---
 res/xml/preferences.xml                                     |    2 +-
 src/org/torproject/android/service/TorService.java          |    4 +---
 src/org/torproject/android/service/TorServiceConstants.java |    2 +-
 src/org/torproject/android/service/TorTransProxy.java       |    2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml
index 8f0778b..e4984e2 100644
--- a/res/xml/preferences.xml
+++ b/res/xml/preferences.xml
@@ -201,7 +201,7 @@ android:dialogTitle="@string/pref_proxy_password_dialog"
 android:title="@string/pref_socks_title"
 android:summary="@string/pref_socks_summary"
 android:dialogTitle="@string/pref_socks_dialog"
-android:defaultValue="auto"
+android:defaultValue="9050"
 />
     
 <CheckBoxPreference
diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java
index 3c04d97..f1b80ed 100644
--- a/src/org/torproject/android/service/TorService.java
+++ b/src/org/torproject/android/service/TorService.java
@@ -19,7 +19,6 @@ import java.net.Socket;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
-import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.StringTokenizer;
 import java.util.Timer;
@@ -122,7 +121,6 @@ public class TorService extends Service implements TorServiceConstants, TorConst
     public void logMessage(String msg)
     {
     	if (ENABLE_DEBUG_LOG)  
-        
     	{
     		Log.d(TAG,msg);
     		sendCallbackLogMessage(msg);	
@@ -1702,7 +1700,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst
     	
 		SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext());
 
-        String socksConfig = prefs.getString(TorConstants.PREF_SOCKS, "auto");
+        String socksConfig = prefs.getString(TorConstants.PREF_SOCKS, TorServiceConstants.PORT_SOCKS_DEFAULT);
 
 		enableSocks (socksConfig,false);
 		
diff --git a/src/org/torproject/android/service/TorServiceConstants.java b/src/org/torproject/android/service/TorServiceConstants.java
index 3a0db5e..da67936 100644
--- a/src/org/torproject/android/service/TorServiceConstants.java
+++ b/src/org/torproject/android/service/TorServiceConstants.java
@@ -49,7 +49,7 @@ public interface TorServiceConstants {
 	public final static int PORT_HTTP = 8118; //just like Privoxy!
 	
 	//Socks port client connects to, server is the Tor binary
-	public final static int PORT_SOCKS = 9050;
+	public final static String PORT_SOCKS_DEFAULT = "9050";
 	
 	//what is says!
 	public final static String IP_LOCALHOST = "127.0.0.1";
diff --git a/src/org/torproject/android/service/TorTransProxy.java b/src/org/torproject/android/service/TorTransProxy.java
index 5722612..4999777 100644
--- a/src/org/torproject/android/service/TorTransProxy.java
+++ b/src/org/torproject/android/service/TorTransProxy.java
@@ -711,7 +711,7 @@ public class TorTransProxy implements TorServiceConstants {
 		script.append(" -A ").append(srcChainName);
 		script.append(" -p tcp");
 		script.append(" -m tcp");
-		script.append(" --dport ").append(PORT_SOCKS);
+		script.append(" --dport ").append(PORT_SOCKS_DEFAULT);
 		script.append(" -j ACCEPT");
 
 		executeCommand (shell, script.toString());



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