diff options
author | Fup Duck <fupduck@sacknagel.com> | 2018-01-14 00:03:09 +0100 |
---|---|---|
committer | Fup Duck <fupduck@sacknagel.com> | 2018-01-14 00:03:09 +0100 |
commit | deb8f0c1192a36c9aa66ab16bfd5e26357096821 (patch) | |
tree | 7ebc94c90aad13f7e5917b9f17bf39d82310ce61 | |
parent | 7331f55bb789840fc0fc9e162a0f2d538146fd1e (diff) |
update insecure configuration wizard as well
-rw-r--r-- | app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java | 32 | ||||
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/BaseConfigurationWizard.java | 7 |
2 files changed, 23 insertions, 16 deletions
diff --git a/app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java b/app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java index b14a239a..0131cb27 100644 --- a/app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java +++ b/app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java @@ -52,7 +52,7 @@ public class ConfigurationWizard extends BaseConfigurationWizard { * Open the new provider dialog with data */ public void addAndSelectNewProvider(String main_url, boolean danger_on) { - FragmentTransaction fragment_transaction = fragment_manager.removePreviousFragment(NewProviderDialog.TAG); + FragmentTransaction fragment_transaction = fragmentManager.removePreviousFragment(NewProviderDialog.TAG); DialogFragment newFragment = new NewProviderDialog(); Bundle data = new Bundle(); @@ -64,10 +64,10 @@ public class ConfigurationWizard extends BaseConfigurationWizard { public void showAndSelectProvider(String provider_main_url, boolean danger_on) { try { - selected_provider = new Provider(new URL((provider_main_url))); - adapter.add(selected_provider); + selectedProvider = new Provider(new URL((provider_main_url))); + adapter.add(selectedProvider); adapter.saveProviders(); - autoSelectProvider(selected_provider, danger_on); + autoSelectProvider(selectedProvider, danger_on); } catch (MalformedURLException e) { e.printStackTrace(); } @@ -75,7 +75,7 @@ public class ConfigurationWizard extends BaseConfigurationWizard { private void autoSelectProvider(Provider provider, boolean danger_on) { preferences.edit().putBoolean(ProviderItem.DANGER_ON, danger_on).apply(); - selected_provider = provider; + selectedProvider = provider; onItemSelectedLogic(); onItemSelectedUi(); } @@ -89,21 +89,21 @@ public class ConfigurationWizard extends BaseConfigurationWizard { mConfigState.setAction(SETTING_UP_PROVIDER); Intent provider_API_command = new Intent(this, ProviderAPI.class); Bundle parameters = new Bundle(); - parameters.putString(Provider.MAIN_URL, selected_provider.getMainUrl().toString()); + parameters.putString(Provider.MAIN_URL, selectedProvider.getMainUrl().toString()); parameters.putBoolean(ProviderItem.DANGER_ON, danger_on); - if (selected_provider.hasCertificatePin()){ - parameters.putString(Provider.CA_CERT_FINGERPRINT, selected_provider.certificatePin()); + if (selectedProvider.hasCertificatePin()){ + parameters.putString(Provider.CA_CERT_FINGERPRINT, selectedProvider.certificatePin()); } - if (selected_provider.hasCaCert()) { - parameters.putString(Provider.CA_CERT, selected_provider.getCaCert()); + if (selectedProvider.hasCaCert()) { + parameters.putString(Provider.CA_CERT, selectedProvider.getCaCert()); } - if (selected_provider.hasDefinition()) { - parameters.putString(Provider.KEY, selected_provider.getDefinition().toString()); + if (selectedProvider.hasDefinition()) { + parameters.putString(Provider.KEY, selectedProvider.getDefinition().toString()); } provider_API_command.setAction(ProviderAPI.SET_UP_PROVIDER); provider_API_command.putExtra(ProviderAPI.PARAMETERS, parameters); - provider_API_command.putExtra(ProviderAPI.RECEIVER_KEY, providerAPI_result_receiver); + provider_API_command.putExtra(ProviderAPI.RECEIVER_KEY, providerAPIResultReceiver); startService(provider_API_command); } @@ -118,14 +118,14 @@ public class ConfigurationWizard extends BaseConfigurationWizard { addAndSelectNewProvider(ProviderAPI.lastProviderMainUrl(), ProviderAPI.lastDangerOn()); } else { showProgressBar(); - adapter.hideAllBut(adapter.indexOf(selected_provider)); + adapter.hideAllBut(adapter.indexOf(selectedProvider)); Intent provider_API_command = new Intent(this, ProviderAPI.class); provider_API_command.setAction(ProviderAPI.SET_UP_PROVIDER); - provider_API_command.putExtra(ProviderAPI.RECEIVER_KEY, providerAPI_result_receiver); + provider_API_command.putExtra(ProviderAPI.RECEIVER_KEY, providerAPIResultReceiver); Bundle parameters = new Bundle(); - parameters.putString(Provider.MAIN_URL, selected_provider.getMainUrl().toString()); + parameters.putString(Provider.MAIN_URL, selectedProvider.getMainUrl().toString()); provider_API_command.putExtra(ProviderAPI.PARAMETERS, parameters); startService(provider_API_command); diff --git a/app/src/main/java/se/leap/bitmaskclient/BaseConfigurationWizard.java b/app/src/main/java/se/leap/bitmaskclient/BaseConfigurationWizard.java index 35cc23fd..f30c962c 100644 --- a/app/src/main/java/se/leap/bitmaskclient/BaseConfigurationWizard.java +++ b/app/src/main/java/se/leap/bitmaskclient/BaseConfigurationWizard.java @@ -158,6 +158,13 @@ public abstract class BaseConfigurationWizard extends ButterKnifeActivity progressbarText = savedInstanceState.getString(PROGRESSBAR_TEXT, ""); selectedProvider = savedInstanceState.getParcelable(Provider.KEY); mConfigState.setAction(savedInstanceState.getString(ACTIVITY_STATE, PROVIDER_NOT_SET)); + + if (SETTING_UP_PROVIDER.equals(mConfigState.getAction()) || + PENDING_SHOW_PROVIDER_DETAILS.equals(mConfigState.getAction()) || + PENDING_SHOW_FAILED_DIALOG.equals(mConfigState.getAction()) + ) { + onItemSelectedUi(); + } } @Override |