From 325ca1f809e125760f58395d029df8ef2e6fadcb Mon Sep 17 00:00:00 2001 From: Nathan Freitas Date: Sun, 12 Apr 2015 22:56:16 -0400 Subject: [PATCH] only ARM chips can support the new Obfs4, Meek bridges so hide the UI options that promote them, and just request standard bridges --- .../torproject/android/OrbotMainActivity.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/org/torproject/android/OrbotMainActivity.java b/src/org/torproject/android/OrbotMainActivity.java index 0900178d..2ed81dae 100644 --- a/src/org/torproject/android/OrbotMainActivity.java +++ b/src/org/torproject/android/OrbotMainActivity.java @@ -274,19 +274,27 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon }); + mBtnBridges = (ToggleButton)findViewById(R.id.btnBridges); boolean useBridges = mPrefs.getBoolean("pref_bridges_enabled", false); mBtnBridges.setChecked(useBridges); + + mBtnBridges.setOnClickListener(new View.OnClickListener () { @Override public void onClick(View v) { - - promptSetupBridges (); - + if (Build.CPU_ABI.contains("arm")) + { + promptSetupBridges (); //if ARM processor, show all bridge options + } + else + { + showGetBridgePrompt(""); //if other chip ar, only stock bridges are supported + } } @@ -302,11 +310,9 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon @Override public boolean onTouch(View v, MotionEvent event) { return mGestureDetector.onTouchEvent(event); - } - /* * Create the UI Options Menu (non-Javadoc) * @see android.app.Activity#onCreateOptionsMenu(android.view.Menu) @@ -487,7 +493,7 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon private void doTorCheck () { - openBrowser(URL_TOR_CHECK); + openBrowser(URL_TOR_CHECK,false); } @@ -681,13 +687,12 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon /* * Launch the system activity for Uri viewing with the provided url */ - private void openBrowser(final String browserLaunchUrl) + private void openBrowser(final String browserLaunchUrl,boolean forceExternal) { boolean isOrwebInstalled = appInstalledOrNot("info.guardianproject.browser"); boolean isTransProxy = mPrefs.getBoolean("pref_transparent", false); - - if (mBtnVPN.isChecked()) + if (mBtnVPN.isChecked()||forceExternal) { //use the system browser since VPN is on Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(browserLaunchUrl)); @@ -964,7 +969,7 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon @Override public void onClick(DialogInterface dialog, int which) { - openBrowser(URL_TOR_BRIDGES + type); + openBrowser(URL_TOR_BRIDGES + type,true); }