From 4c6df2ad3684061f80cf00136847d2ae88f139bb Mon Sep 17 00:00:00 2001 From: Nathan Freitas Date: Tue, 17 May 2011 02:02:36 +0000 Subject: [PATCH] last modification for StrictNodes, exit node support svn:r24758 --- res/xml/preferences.xml | 19 ++++++++++++++----- .../android/service/TorService.java | 15 +++++++-------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index 5173779b..067cd740 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -42,17 +42,26 @@ android:enabled="true"/> - - + + + +android:title="Strict Nodes" android:key="pref_strict_nodes" +android:summary="Use *only* these specified nodes"/> diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java index a3af8e4c..fba41e1d 100644 --- a/src/org/torproject/android/service/TorService.java +++ b/src/org/torproject/android/service/TorService.java @@ -1288,8 +1288,10 @@ public class TorService extends Service implements TorServiceConstants, Runnable boolean enableHiddenServices = prefs.getBoolean("pref_hs_enable", false); - boolean enableStrictExitNodes = prefs.getBoolean("pref_strict_exit_nodes", false); + boolean enableStrictNodes = prefs.getBoolean("pref_strict_nodes", false); + String entranceNodes = prefs.getString("pref_entrance_nodes", ""); String exitNodes = prefs.getString("pref_exit_nodes", ""); + String excludeNodes = prefs.getString("pref_exclude_nodes", ""); //boolean enableTransparentProxy = prefs.getBoolean(TorConstants.PREF_TRANSPARENT, false); @@ -1308,13 +1310,10 @@ public class TorService extends Service implements TorServiceConstants, Runnable } } - if (exitNodes.length() > 0) - { - - mBinder.updateConfiguration("ExitNodes", exitNodes, false); - mBinder.updateConfiguration("StrictExitNodes", enableStrictExitNodes ? "1" : "0", false); - - } + mBinder.updateConfiguration("EntranceNodes", entranceNodes, false); + mBinder.updateConfiguration("ExitNodes", exitNodes, false); + mBinder.updateConfiguration("ExcludeNodes", excludeNodes, false); + mBinder.updateConfiguration("StrictExitNodes", enableStrictNodes ? "1" : "0", false); if (useBridges) {