diff --git a/res/layout/layout_diag.xml b/res/layout/layout_diag.xml
index 56cd8bbb..c19a5b14 100644
--- a/res/layout/layout_diag.xml
+++ b/res/layout/layout_diag.xml
@@ -4,12 +4,11 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
-
-
+
+
\ No newline at end of file
diff --git a/res/layout/layout_vpn_setup.xml b/res/layout/layout_vpn_setup.xml
new file mode 100644
index 00000000..5d2c6dc3
--- /dev/null
+++ b/res/layout/layout_vpn_setup.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f5a1fe71..3aeb0679 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -318,4 +318,16 @@
"Restart Orbot to use these bridges: "
QR Codes
+
+ If your mobile network actively blocks Tor, you can use a Tor Bridge to access the network.\n\nYou can get a bridge address from https://bridges.torproject.org or scan a bridge QR code from a friend.\n\nAnother way to get bridges is to send an email to bridges@torproject.org. Please note that you must send the email using an address from one of the following email providers: Riseup, Gmail or Yahoo.
+
+ Bridge Mode
+
+ Get Bridges
+
+ Activate
+
+ Apps Mode
+
+ You can enable all apps on your device to run through the Tor network using the VPN feature of Android.
diff --git a/src/org/torproject/android/OrbotConstants.java b/src/org/torproject/android/OrbotConstants.java
index e400851e..745ace44 100644
--- a/src/org/torproject/android/OrbotConstants.java
+++ b/src/org/torproject/android/OrbotConstants.java
@@ -16,6 +16,7 @@ public interface OrbotConstants {
//path to check Tor against
public final static String URL_TOR_CHECK = "https://check.torproject.org";
+ public final static String URL_TOR_BRIDGES = "https://bridges.torproject.org";
public final static String NEWLINE = "\n";
diff --git a/src/org/torproject/android/OrbotMainActivity.java b/src/org/torproject/android/OrbotMainActivity.java
index 886c2220..62e666ee 100644
--- a/src/org/torproject/android/OrbotMainActivity.java
+++ b/src/org/torproject/android/OrbotMainActivity.java
@@ -15,7 +15,6 @@ import org.torproject.android.service.TorServiceUtils;
import org.torproject.android.settings.SettingsPreferences;
import org.torproject.android.ui.ImageProgressView;
import org.torproject.android.ui.Rotate3dAnimation;
-import org.torproject.android.ui.wizard.ChooseLocaleWizardActivity;
import org.torproject.android.ui.wizard.PromoAppsActivity;
import android.annotation.TargetApi;
@@ -267,7 +266,7 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon
public void onClick(View v) {
if (mBtnVPN.isChecked())
- startVpnService();
+ promptStartVpnService();
else
stopVpnService();
@@ -286,11 +285,8 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon
@Override
public void onClick(View v) {
- Editor edit = mPrefs.edit();
- edit.putBoolean("pref_bridges_enabled", mBtnBridges.isChecked());
- edit.commit();
+ promptSetupBridges ();
- updateSettings();
}
@@ -842,10 +838,8 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon
setNewBridges(results);
-
} catch (UnsupportedEncodingException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Log.e(TAG,"unsupported",e);
}
}
@@ -853,6 +847,109 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon
}
+ public void promptSetupBridges ()
+ {
+ LayoutInflater li = LayoutInflater.from(this);
+ View view = li.inflate(R.layout.layout_diag, null);
+
+ TextView versionName = (TextView)view.findViewById(R.id.diaglog);
+ versionName.setText(R.string.if_your_mobile_network_actively_blocks_tor_you_can_use_a_tor_bridge_to_access_the_network_another_way_to_get_bridges_is_to_send_an_email_to_bridges_torproject_org_please_note_that_you_must_send_the_email_using_an_address_from_one_of_the_following_email_providers_riseup_gmail_or_yahoo_);
+
+ if (mBtnBridges.isChecked())
+ {
+ new AlertDialog.Builder(this)
+ .setTitle(R.string.bridge_mode)
+ .setView(view)
+ .setNeutralButton(R.string.get_bridges, new Dialog.OnClickListener ()
+ {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+
+ openBrowser(URL_TOR_BRIDGES);
+
+ }
+
+
+ })
+ .setPositiveButton(R.string.activate, new Dialog.OnClickListener ()
+ {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+
+ enableBridges (true);
+
+ }
+
+
+ })
+ .setNegativeButton(android.R.string.cancel, new Dialog.OnClickListener()
+ {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+
+ mBtnBridges.setChecked(false);
+
+ }
+ })
+ .show();
+ }
+ else
+ {
+ enableBridges(false);
+ }
+
+ }
+
+ private void enableBridges (boolean enable)
+ {
+
+ Editor edit = mPrefs.edit();
+ edit.putBoolean("pref_bridges_enabled", enable);
+ edit.commit();
+
+ updateSettings();
+ }
+
+ public void promptStartVpnService ()
+ {
+ LayoutInflater li = LayoutInflater.from(this);
+ View view = li.inflate(R.layout.layout_diag, null);
+
+ TextView versionName = (TextView)view.findViewById(R.id.diaglog);
+ versionName.setText(R.string.you_can_enable_all_apps_on_your_device_to_run_through_the_tor_network_using_the_vpn_feature_of_android_);
+
+ new AlertDialog.Builder(this)
+ .setTitle(R.string.apps_mode)
+ .setView(view)
+ .setPositiveButton(R.string.activate, new Dialog.OnClickListener ()
+ {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+
+ startVpnService();
+
+ }
+
+
+ })
+ .setNegativeButton(android.R.string.cancel, new Dialog.OnClickListener ()
+ {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+
+ mBtnVPN.setChecked(false);
+
+ }
+
+
+ })
+ .show();
+ }
+
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public void startVpnService ()
{
diff --git a/src/org/torproject/android/ui/BridgeSetupActivity.java b/src/org/torproject/android/ui/BridgeSetupActivity.java
new file mode 100644
index 00000000..7cabe356
--- /dev/null
+++ b/src/org/torproject/android/ui/BridgeSetupActivity.java
@@ -0,0 +1,5 @@
+package org.torproject.android.ui;
+
+public class BridgeSetupActivity {
+
+}
diff --git a/src/org/torproject/android/ui/VPNSetupActivity.java b/src/org/torproject/android/ui/VPNSetupActivity.java
new file mode 100644
index 00000000..d8674c00
--- /dev/null
+++ b/src/org/torproject/android/ui/VPNSetupActivity.java
@@ -0,0 +1,5 @@
+package org.torproject.android.ui;
+
+public class VPNSetupActivity {
+
+}