Skip to content

Commit

Permalink
more improvements for bridge wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Jan 3, 2018
1 parent df37b8c commit b4aa9d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 77 deletions.
52 changes: 2 additions & 50 deletions app/src/main/java/org/torproject/android/OrbotMainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
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;
Expand Down Expand Up @@ -969,56 +970,7 @@ public void promptSetupBridges ()

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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,32 +161,7 @@ private void sendGetBridgeEmail (String type)
*/
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)));
}


Expand Down Expand Up @@ -265,7 +240,7 @@ protected Boolean doInBackground(String... host) {
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;
}
Expand Down

0 comments on commit b4aa9d8

Please sign in to comment.