From bb2a944265da15eeba35106f2e2bcda288855527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 19 Mar 2015 15:07:55 +0100 Subject: Show browser warning on disconnect. Also reindent some code. --- app/src/main/java/se/leap/bitmaskclient/Dashboard.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/src/main/java/se/leap/bitmaskclient/Dashboard.java') diff --git a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java index face6ced..a8f6e110 100644 --- a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java +++ b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java @@ -407,7 +407,7 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn } private void switchProvider() { - if (provider.hasEIP()) eip_fragment.askToStopEIP(); + if (provider.hasEIP()) eip_fragment.stopEipIfPossible(); preferences.edit().clear().apply(); switching_provider = false; -- cgit v1.2.3 From 6dfae9951be275ccf33a05f4980a977b5b634e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 19 Mar 2015 15:27:28 +0100 Subject: Don't show user session progress in the eip fragment --- app/src/main/java/se/leap/bitmaskclient/Dashboard.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/src/main/java/se/leap/bitmaskclient/Dashboard.java') diff --git a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java index a8f6e110..c043821f 100644 --- a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java +++ b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java @@ -291,18 +291,18 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn public void signUp(String username, String password) { User.setUserName(username); Bundle parameters = bundlePassword(password); - providerApiCommand(parameters, R.string.signingup_message, ProviderAPI.SIGN_UP); + providerApiCommand(parameters, 0, ProviderAPI.SIGN_UP); } @Override public void logIn(String username, String password) { User.setUserName(username); Bundle parameters = bundlePassword(password); - providerApiCommand(parameters, R.string.authenticating_message, ProviderAPI.LOG_IN); + providerApiCommand(parameters, 0, ProviderAPI.LOG_IN); } public void logOut() { - providerApiCommand(Bundle.EMPTY, R.string.logout_message, ProviderAPI.LOG_OUT); + providerApiCommand(Bundle.EMPTY, 0, ProviderAPI.LOG_OUT); } @Override -- cgit v1.2.3 From 2c44ba2678c6b3367a119d1e857dd5d5723f7681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 19 Mar 2015 15:56:30 +0100 Subject: Warn riseup users about credentials, as an error in the username field. I haven't still decided how to show that warning, I'm talking to gus about it. This is just the first idea, but the core mechanism is implemented at least. --- app/src/main/java/se/leap/bitmaskclient/Dashboard.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/src/main/java/se/leap/bitmaskclient/Dashboard.java') diff --git a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java index c043821f..14d79bc0 100644 --- a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java +++ b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java @@ -426,6 +426,8 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn } else if(resultCode == ProviderAPI.SUCCESSFUL_LOGIN) { downloadVpnCertificate(); } else if(resultCode == ProviderAPI.FAILED_LOGIN) { + if(provider.getName().equalsIgnoreCase("riseup")) + resultData.putBoolean(SessionDialog.ERRORS.CONFUSING_CREDENTIALS.toString(), true); sessionDialog(resultData); } else if(resultCode == ProviderAPI.SUCCESSFUL_LOGOUT) { if(switching_provider) switchProvider(); -- cgit v1.2.3 From d18be7ed1dfc645bd378c2eb0c152f7e0eda42e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 19 Mar 2015 16:56:32 +0100 Subject: Show gus message just for riseup login. --- .../main/java/se/leap/bitmaskclient/Dashboard.java | 34 ++++++++++++---------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'app/src/main/java/se/leap/bitmaskclient/Dashboard.java') diff --git a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java index 14d79bc0..7c5e5421 100644 --- a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java +++ b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java @@ -1,6 +1,6 @@ /** * Copyright (c) 2013 LEAP Encryption Access Project and contributers - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -37,7 +37,7 @@ import se.leap.bitmaskclient.eip.*; /** * The main user facing Activity of Bitmask Android, consisting of status, controls, * and access to preferences. - * + * * @author Sean Leonard * @author parmegv */ @@ -202,7 +202,7 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn }) .show(); } - + /** * Inflates permanent UI elements of the View and contains logic for what * service dependent UI elements to include. @@ -248,7 +248,7 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn getMenuInflater().inflate(R.menu.client_dashboard, menu); return true; } - + @Override public boolean onOptionsItemSelected(MenuItem item){ switch (item.getItemId()){ @@ -279,7 +279,7 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn public void showAbout() { Intent intent = new Intent(this, AboutActivity.class); - startActivity(intent); + startActivity(intent); } public void showLog() { @@ -300,11 +300,11 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn Bundle parameters = bundlePassword(password); providerApiCommand(parameters, 0, ProviderAPI.LOG_IN); } - + public void logOut() { providerApiCommand(Bundle.EMPTY, 0, ProviderAPI.LOG_OUT); } - + @Override public void update (Observable observable, Object data) { if(observable instanceof UserSessionStatus) { @@ -374,7 +374,7 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn eip_fragment.progress_bar.setVisibility(ProgressBar.VISIBLE); setStatusMessage(progressbar_message_resId); } - + Intent command = prepareProviderAPICommand(parameters, providerApi_action); startService(command); } @@ -382,9 +382,9 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn private Intent prepareProviderAPICommand(Bundle parameters, String action) { providerAPI_result_receiver = new ProviderAPIResultReceiver(new Handler()); providerAPI_result_receiver.setReceiver(this); - + Intent command = new Intent(this, ProviderAPI.class); - + command.putExtra(ProviderAPI.PARAMETERS, parameters); command.putExtra(ProviderAPI.RECEIVER_KEY, providerAPI_result_receiver); command.setAction(action); @@ -394,12 +394,16 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn public void cancelLoginOrSignup() { EipStatus.getInstance().setConnectedOrDisconnected(); } - + public void sessionDialog(Bundle resultData) { - + FragmentTransaction transaction = fragment_manager.removePreviousFragment(SessionDialog.TAG); DialogFragment newFragment = new SessionDialog(); + if(provider.getName().equalsIgnoreCase("riseup")) { + resultData = resultData == Bundle.EMPTY ? new Bundle() : resultData; + resultData.putBoolean(SessionDialog.ERRORS.RISEUP_WARNING.toString(), true); + } if(resultData != null && !resultData.isEmpty()) { newFragment.setArguments(resultData); } @@ -408,7 +412,7 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn private void switchProvider() { if (provider.hasEIP()) eip_fragment.stopEipIfPossible(); - + preferences.edit().clear().apply(); switching_provider = false; startActivityForResult(new Intent(this, ConfigurationWizard.class), SWITCH_PROVIDER); @@ -426,8 +430,6 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn } else if(resultCode == ProviderAPI.SUCCESSFUL_LOGIN) { downloadVpnCertificate(); } else if(resultCode == ProviderAPI.FAILED_LOGIN) { - if(provider.getName().equalsIgnoreCase("riseup")) - resultData.putBoolean(SessionDialog.ERRORS.CONFUSING_CREDENTIALS.toString(), true); sessionDialog(resultData); } else if(resultCode == ProviderAPI.SUCCESSFUL_LOGOUT) { if(switching_provider) switchProvider(); @@ -456,7 +458,7 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn public static Context getContext() { return app; } - + @Override public void startActivityForResult(Intent intent, int requestCode) { intent.putExtra(Dashboard.REQUEST_CODE, requestCode); -- cgit v1.2.3