From 4f7200c55032d17c9bdbdb30cfd83dc757c63fe7 Mon Sep 17 00:00:00 2001 From: Fup Duck Date: Tue, 19 Dec 2017 17:37:57 +0100 Subject: adjust Fragments --- app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java') diff --git a/app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java b/app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java index df1a59ff..7466f90a 100644 --- a/app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java +++ b/app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java @@ -16,10 +16,10 @@ */ package se.leap.bitmaskclient; -import android.app.DialogFragment; -import android.app.FragmentTransaction; import android.content.Intent; import android.os.Bundle; +import android.support.v4.app.DialogFragment; +import android.support.v4.app.FragmentTransaction; import java.net.MalformedURLException; import java.net.URL; -- cgit v1.2.3 From deb8f0c1192a36c9aa66ab16bfd5e26357096821 Mon Sep 17 00:00:00 2001 From: Fup Duck Date: Sun, 14 Jan 2018 00:03:09 +0100 Subject: update insecure configuration wizard as well --- .../se/leap/bitmaskclient/ConfigurationWizard.java | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java') 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); -- cgit v1.2.3 From 4f536f457da8bb7ab0316f6de7703437ad0ce58f Mon Sep 17 00:00:00 2001 From: Fup Duck Date: Tue, 16 Jan 2018 17:41:47 +0100 Subject: resolve commented issues * recreate activity correctly after changing orientation * replace getApplicationActivity --- .../java/se/leap/bitmaskclient/ConfigurationWizard.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java') diff --git a/app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java b/app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java index 0131cb27..dc65665c 100644 --- a/app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java +++ b/app/src/insecure/java/se/leap/bitmaskclient/ConfigurationWizard.java @@ -103,7 +103,6 @@ public class ConfigurationWizard extends BaseConfigurationWizard { provider_API_command.setAction(ProviderAPI.SET_UP_PROVIDER); provider_API_command.putExtra(ProviderAPI.PARAMETERS, parameters); - provider_API_command.putExtra(ProviderAPI.RECEIVER_KEY, providerAPIResultReceiver); startService(provider_API_command); } @@ -120,15 +119,14 @@ public class ConfigurationWizard extends BaseConfigurationWizard { showProgressBar(); adapter.hideAllBut(adapter.indexOf(selectedProvider)); - Intent provider_API_command = new Intent(this, ProviderAPI.class); + Intent providerAPICommand = new Intent(this, ProviderAPI.class); - provider_API_command.setAction(ProviderAPI.SET_UP_PROVIDER); - provider_API_command.putExtra(ProviderAPI.RECEIVER_KEY, providerAPIResultReceiver); + providerAPICommand.setAction(ProviderAPI.SET_UP_PROVIDER); Bundle parameters = new Bundle(); parameters.putString(Provider.MAIN_URL, selectedProvider.getMainUrl().toString()); - provider_API_command.putExtra(ProviderAPI.PARAMETERS, parameters); + providerAPICommand.putExtra(ProviderAPI.PARAMETERS, parameters); - startService(provider_API_command); + startService(providerAPICommand); } } -- cgit v1.2.3