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

[tor-commits] [orbot/master] Expose IsolateDestAddr



commit 18dd53d4194269f1082b82d8b216bbb62e4c80f4
Author: Tad <tad@xxxxxxxxx>
Date:   Thu Aug 3 11:22:42 2017 -0400

    Expose IsolateDestAddr
---
 app/src/main/res/values/strings.xml                              | 3 +++
 app/src/main/res/xml/preferences.xml                             | 9 +++++++++
 .../main/java/org/torproject/android/service/OrbotConstants.java | 4 +++-
 .../src/main/java/org/torproject/android/service/TorService.java | 8 +++++++-
 4 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 41b9e816..5bb7d909 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -380,4 +380,7 @@
     <string name="enable">Enable</string>
     <string name="consider_disable_battery_optimizations">Consider disable battery optimizations</string>
     <string name="consider_enable_battery_optimizations">Consider enable battery optimizations</string>
+
+  <string name="pref_isolate_dest">Isolate destination addresses</string>
+  <string name="pref_isolate_dest_summary">Use a different circuit for each destination address</string>
 </resources>
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index c20dc4fa..c3f07a8d 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -157,6 +157,15 @@ android:dialogTitle="@string/enter_ports"
 />
 </PreferenceCategory>
 
+<PreferenceCategory android:title="Isolation">
+<CheckBoxPreference
+android:key="pref_isolate_dest"
+android:defaultValue="false"
+android:title="@string/pref_isolate_dest"
+android:summary="@string/pref_isolate_dest_summary"
+android:enabled="true"></CheckBoxPreference>
+</PreferenceCategory>
+
 <PreferenceCategory android:title="@string/pref_proxy_title">
 <EditTextPreference android:key="pref_proxy_type"
 android:title="@string/pref_proxy_type_title"
diff --git a/orbotservice/src/main/java/org/torproject/android/service/OrbotConstants.java b/orbotservice/src/main/java/org/torproject/android/service/OrbotConstants.java
index 665cf0c6..175ebf81 100644
--- a/orbotservice/src/main/java/org/torproject/android/service/OrbotConstants.java
+++ b/orbotservice/src/main/java/org/torproject/android/service/OrbotConstants.java
@@ -33,5 +33,7 @@ public interface OrbotConstants {
 	public final static int MAX_LOG_LENGTH = 10000;
 	
 	public final static String PREF_SOCKS = "pref_socks";
-	
+
+	public final static String PREF_ISOLATE_DEST = "pref_isolate_dest";
+
 }
diff --git a/orbotservice/src/main/java/org/torproject/android/service/TorService.java b/orbotservice/src/main/java/org/torproject/android/service/TorService.java
index 17000a9d..ce47799d 100644
--- a/orbotservice/src/main/java/org/torproject/android/service/TorService.java
+++ b/orbotservice/src/main/java/org/torproject/android/service/TorService.java
@@ -675,8 +675,14 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
 	        if (isPortUsed) //the specified port is not available, so let Tor find one instead
 	        	socksPortPref = "auto";
         }
+
+        String isolate = " ";
+        if(prefs.getBoolean(OrbotConstants.PREF_ISOLATE_DEST, false))
+        {
+            isolate += "IsolateDestAddr";
+        }
         
-        extraLines.append("SOCKSPort ").append(socksPortPref).append('\n');
+        extraLines.append("SOCKSPort ").append(socksPortPref).append(isolate).append('\n');
         extraLines.append("SafeSocks 0").append('\n');
         extraLines.append("TestSocks 0").append('\n');
         extraLines.append("WarnUnsafeSocks 1").append('\n');



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