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

[tor-commits] [orbot/master] more improvements for bridge wizard



commit b4aa9d83f0819d2214935d6b22b4f36b2357de65
Author: n8fr8 <nathan@xxxxxxxxxxx>
Date:   Wed Jan 3 12:57:21 2018 -0500

    more improvements for bridge wizard
---
 .../org/torproject/android/OrbotMainActivity.java  | 52 +---------------------
 .../ui/onboarding/BridgeWizardActivity.java        | 29 +-----------
 2 files changed, 4 insertions(+), 77 deletions(-)

diff --git a/app/src/main/java/org/torproject/android/OrbotMainActivity.java b/app/src/main/java/org/torproject/android/OrbotMainActivity.java
index efe34620..baeb1ad6 100644
--- a/app/src/main/java/org/torproject/android/OrbotMainActivity.java
+++ b/app/src/main/java/org/torproject/android/OrbotMainActivity.java
@@ -23,6 +23,7 @@ import org.torproject.android.service.TorServiceConstants;
 import org.torproject.android.service.util.TorServiceUtils;
 import org.torproject.android.settings.SettingsPreferences;
 import org.torproject.android.ui.AppManagerActivity;
+import org.torproject.android.ui.onboarding.BridgeWizardActivity;
 import org.torproject.android.ui.onboarding.OnboardingActivity;
 import org.torproject.android.ui.hiddenservices.ClientCookiesActivity;
 import org.torproject.android.ui.hiddenservices.HiddenServicesActivity;
@@ -969,56 +970,7 @@ public class OrbotMainActivity extends AppCompatActivity
 
         if (mBtnBridges.isChecked())
         {
-
-            startActivity(new Intent(this, OnboardingActivity.class));
-
-            /**
-            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_);
-
-            new AlertDialog.Builder(this)
-	        .setTitle(R.string.bridge_mode)
-	        .setView(view)
-	        .setItems(R.array.bridge_options, new DialogInterface.OnClickListener() {
-               public void onClick(DialogInterface dialog, int which) {
-               // The 'which' argument contains the index position
-               // of the selected item
-            	   
-            	   switch (which)
-            	   {
-            	   case 0: //obfs 4;
-                       Prefs.setBridgesList("obfs4");
-            		   enableBridges(true);
-
-            		   break;
-            	   case 1: //amazon & azure
-                       Prefs.setBridgesList("meek");
-            		   enableBridges(true);
-            		   
-            		   break;
-            	   case 2:
-            		   showGetBridgePrompt("obfs4");
-            		   
-            		   break;
-            		  
-            	   }
-            	   
-               }
-           }).setNegativeButton(R.string.btn_cancel, new Dialog.OnClickListener()
-	        {
-	        	@Override
-				public void onClick(DialogInterface dialog, int which) {
-					
-	            	//mBtnBridges.setChecked(false);
-					
-				}
-	              })
-	        .show();
-	        **/
-
+            startActivity(new Intent(this, BridgeWizardActivity.class));
         }
         else
         {
diff --git a/app/src/main/java/org/torproject/android/ui/onboarding/BridgeWizardActivity.java b/app/src/main/java/org/torproject/android/ui/onboarding/BridgeWizardActivity.java
index 40b7177c..b26ab6ba 100644
--- a/app/src/main/java/org/torproject/android/ui/onboarding/BridgeWizardActivity.java
+++ b/app/src/main/java/org/torproject/android/ui/onboarding/BridgeWizardActivity.java
@@ -161,32 +161,7 @@ public class BridgeWizardActivity extends AppCompatActivity {
      */
     private void openBrowser(final String browserLaunchUrl,boolean forceExternal, String pkgId)
     {
-        boolean isBrowserInstalled = appInstalledOrNot(TorServiceConstants.BROWSER_APP_USERNAME);
-
-        if (pkgId != null)
-        {
-            if (pkgId.equals(TorServiceConstants.BROWSER_APP_USERNAME))
-                startIntent(pkgId,Intent.ACTION_VIEW, Uri.parse(browserLaunchUrl));
-            else
-            {
-                if (!Prefs.useVpn())
-                {
-                    Toast.makeText(this, R.string.please_enable_vpn, Toast.LENGTH_LONG).show();
-                }
-                else
-                {
-                    startIntent(pkgId,Intent.ACTION_VIEW,Uri.parse(browserLaunchUrl));
-                }
-            }
-        }
-        else if (isBrowserInstalled)
-        {
-            startIntent(TorServiceConstants.BROWSER_APP_USERNAME,Intent.ACTION_VIEW,Uri.parse(browserLaunchUrl));
-        }
-        else
-        {
-            startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(browserLaunchUrl)));
-        }
+        startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(browserLaunchUrl)));
     }
 
 
@@ -265,7 +240,7 @@ public class BridgeWizardActivity extends AppCompatActivity {
             String testHost = host[i];
             i++; //move to the port
             int testPort = Integer.parseInt(host[i]);
-            result = isHostReachable(testHost, testPort, 5000);
+            result = isHostReachable(testHost, testPort, 10000);
             if (result)
                 return result;
         }



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