From c7e55cac6210e71404d68d7cdaf8c63624fb5984 Mon Sep 17 00:00:00 2001 From: Adrian-Ken Rueegsegger Date: Fri, 10 Feb 2012 23:08:37 +0100 Subject: [PATCH 1/3] Add strings and prefs related to obfuscated bridges --- res/values/strings.xml | 2 ++ res/xml/preferences.xml | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 9da8b985..f519a91d 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -209,7 +209,9 @@ Use *only* these specified nodes Bridges Use Bridges +Obfuscated Bridges Enable alternate entrance nodes into the Tor Network +Enable if configured bridges are obfuscated bridges IP address and port of bridges Enter Bridge Addresses Relays diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index 15f3abc4..683208c2 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -94,19 +94,21 @@ android:summary="@string/use_only_these_specified_nodes"/> +android:summary="@string/enable_alternate_entrance_nodes_into_the_tor_network"/> + + - + - - Date: Fri, 10 Feb 2012 23:10:00 +0100 Subject: [PATCH 2/3] Add constants related to obfuscated bridges --- src/org/torproject/android/TorConstants.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/org/torproject/android/TorConstants.java b/src/org/torproject/android/TorConstants.java index 8b44281d..2574c6a5 100644 --- a/src/org/torproject/android/TorConstants.java +++ b/src/org/torproject/android/TorConstants.java @@ -32,6 +32,7 @@ public interface TorConstants { public final static String PREF_BRIDGES_ENABLED = "pref_bridges_enabled"; public final static String PREF_BRIDGES_UPDATED = "pref_bridges_enabled"; public final static String PREF_BRIDGES_LIST = "pref_bridges_list"; + public final static String PREF_BRIDGES_OBFUSCATED = "pref_bridges_obfuscated"; public final static String PREF_OR = "pref_or"; public final static String PREF_OR_PORT = "pref_or_port"; public final static String PREF_OR_NICKNAME = "pref_or_nickname"; From ab4f789eff85ab148ea6f3ba19c8aaa576864fe7 Mon Sep 17 00:00:00 2001 From: Adrian-Ken Rueegsegger Date: Fri, 10 Feb 2012 23:12:54 +0100 Subject: [PATCH 3/3] Add correct torrc entries for obfuscated bridges The lines have the following form: Bridge obfs2 ${IP address of bridge} ... ClientTransportPlugin obfs2 exec ${/path/to/obfsproxy} --managed --- .../torproject/android/service/TorService.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java index 80daaab3..70f29a1c 100644 --- a/src/org/torproject/android/service/TorService.java +++ b/src/org/torproject/android/service/TorService.java @@ -1462,16 +1462,28 @@ public class TorService extends Service implements TorServiceConstants, TorConst showToolbarNotification(getString(R.string.notification_using_bridges) + ": " + bridgeList, TRANSPROXY_NOTIFY_ID, R.drawable.tornotification, -1); + boolean obfsBridges = prefs.getBoolean(TorConstants.PREF_BRIDGES_OBFUSCATED, false); + String bridgeCfgKey = "bridge"; + + if (obfsBridges) + { + bridgeCfgKey = bridgeCfgKey + " obfs2"; + } + StringTokenizer st = new StringTokenizer(bridgeList,bridgeDelim); while (st.hasMoreTokens()) { - mBinder.updateConfiguration("bridge", st.nextToken(), false); + mBinder.updateConfiguration(bridgeCfgKey, st.nextToken(), false); } - + + if (obfsBridges) + { + mBinder.updateConfiguration("ClientTransportPlugin","obfs2 exec " + fileObfsProxy.getAbsolutePath() + " --managed", false); + } + mBinder.updateConfiguration("UpdateBridgesFromAuthority", "0", false); - } else {