diff options
author | cyBerta <cyberta@riseup.net> | 2017-12-14 19:01:28 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2017-12-14 19:01:28 +0100 |
commit | 25d215400d500bdb7537e604ed91ced586821ef2 (patch) | |
tree | cb29df26bec196f8628947897a5fe9977b00a229 /app/src/insecure/java/se | |
parent | b84f9942a3f87f9d1e589221ed2eb3900518d8d9 (diff) | |
parent | 18e24819eed388d349dbf6d7cd21534d7074bf5d (diff) |
Update constants renaming
Diffstat (limited to 'app/src/insecure/java/se')
-rw-r--r-- | app/src/insecure/java/se/leap/bitmaskclient/ProviderAPI.java | 9 | ||||
-rw-r--r-- | app/src/insecure/java/se/leap/bitmaskclient/ProviderDetailFragment.java | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/app/src/insecure/java/se/leap/bitmaskclient/ProviderAPI.java b/app/src/insecure/java/se/leap/bitmaskclient/ProviderAPI.java index 87fff283..7689c343 100644 --- a/app/src/insecure/java/se/leap/bitmaskclient/ProviderAPI.java +++ b/app/src/insecure/java/se/leap/bitmaskclient/ProviderAPI.java @@ -45,7 +45,6 @@ import javax.net.ssl.X509TrustManager; import okhttp3.OkHttpClient; import se.leap.bitmaskclient.ProviderListContent.ProviderItem; -import se.leap.bitmaskclient.eip.Constants; import se.leap.bitmaskclient.eip.EIP; import static se.leap.bitmaskclient.R.string.certificate_error; @@ -138,8 +137,8 @@ public class ProviderAPI extends ProviderApiBase { //TODO setProviderName(name); preferences.edit().putString(Provider.KEY, provider_json.toString()).commit(); - preferences.edit().putBoolean(Constants.ALLOWED_ANON, provider_json.getJSONObject(Provider.SERVICE).getBoolean(Constants.ALLOWED_ANON)).commit(); - preferences.edit().putBoolean(Constants.ALLOWED_REGISTERED, provider_json.getJSONObject(Provider.SERVICE).getBoolean(Constants.ALLOWED_REGISTERED)).commit(); + preferences.edit().putBoolean(Constants.PROVIDER_ALLOW_ANONYMOUS, provider_json.getJSONObject(Provider.SERVICE).getBoolean(Constants.PROVIDER_ALLOW_ANONYMOUS)).commit(); + preferences.edit().putBoolean(Constants.PROVIDER_ALLOWED_REGISTERED, provider_json.getJSONObject(Provider.SERVICE).getBoolean(Constants.PROVIDER_ALLOWED_REGISTERED)).commit(); result.putBoolean(RESULT_KEY, true); } catch (JSONException e) { @@ -168,7 +167,7 @@ public class ProviderAPI extends ProviderApiBase { JSONObject eip_service_json = new JSONObject(eip_service_json_string); eip_service_json.getInt(Provider.API_RETURN_SERIAL); - preferences.edit().putString(Constants.KEY, eip_service_json.toString()).commit(); + preferences.edit().putString(Constants.PROVIDER_KEY, eip_service_json.toString()).commit(); result.putBoolean(RESULT_KEY, true); } catch (NullPointerException | JSONException e) { @@ -191,7 +190,7 @@ public class ProviderAPI extends ProviderApiBase { JSONObject provider_json = new JSONObject(preferences.getString(Provider.KEY, "")); String provider_main_url = provider_json.getString(Provider.API_URL); - URL new_cert_string_url = new URL(provider_main_url + "/" + provider_json.getString(Provider.API_VERSION) + "/" + Constants.VPN_CERTIFICATE); + URL new_cert_string_url = new URL(provider_main_url + "/" + provider_json.getString(Provider.API_VERSION) + "/" + Constants.PROVIDER_VPN_CERTIFICATE); String cert_string = downloadWithProviderCA(new_cert_string_url.toString(), last_danger_on); diff --git a/app/src/insecure/java/se/leap/bitmaskclient/ProviderDetailFragment.java b/app/src/insecure/java/se/leap/bitmaskclient/ProviderDetailFragment.java index 629867e6..390d4aeb 100644 --- a/app/src/insecure/java/se/leap/bitmaskclient/ProviderDetailFragment.java +++ b/app/src/insecure/java/se/leap/bitmaskclient/ProviderDetailFragment.java @@ -2,7 +2,6 @@ package se.leap.bitmaskclient; import org.json.*; -import se.leap.bitmaskclient.eip.*; import se.leap.bitmaskclient.ProviderListContent.ProviderItem; import android.app.*; @@ -23,7 +22,7 @@ public class ProviderDetailFragment extends DialogFragment { LayoutInflater inflater = getActivity().getLayoutInflater(); View provider_detail_view = inflater.inflate(R.layout.provider_detail_fragment, null); - JSONObject provider_json = new JSONObject(getActivity().getSharedPreferences(Dashboard.SHARED_PREFERENCES, getActivity().MODE_PRIVATE).getString(Provider.KEY, "")); + JSONObject provider_json = new JSONObject(getActivity().getSharedPreferences(Constants.SHARED_PREFERENCES, getActivity().MODE_PRIVATE).getString(Provider.KEY, "")); final TextView domain = (TextView) provider_detail_view.findViewById(R.id.provider_detail_domain); domain.setText(provider_json.getString(Provider.DOMAIN)); @@ -60,7 +59,7 @@ public class ProviderDetailFragment extends DialogFragment { private boolean anon_allowed(JSONObject provider_json) { try { JSONObject service_description = provider_json.getJSONObject(Provider.SERVICE); - return service_description.has(Constants.ALLOWED_ANON) && service_description.getBoolean(Constants.ALLOWED_ANON); + return service_description.has(Constants.PROVIDER_ALLOW_ANONYMOUS) && service_description.getBoolean(Constants.PROVIDER_ALLOW_ANONYMOUS); } catch (JSONException e) { return false; } @@ -78,8 +77,8 @@ public class ProviderDetailFragment extends DialogFragment { @Override public void onCancel(DialogInterface dialog) { super.onCancel(dialog); - SharedPreferences.Editor editor = getActivity().getSharedPreferences(Dashboard.SHARED_PREFERENCES, Activity.MODE_PRIVATE).edit(); - editor.remove(Provider.KEY).remove(ProviderItem.DANGER_ON).remove(Constants.ALLOWED_ANON).remove(Constants.KEY).commit(); + SharedPreferences.Editor editor = getActivity().getSharedPreferences(Constants.SHARED_PREFERENCES, Activity.MODE_PRIVATE).edit(); + editor.remove(Provider.KEY).remove(ProviderItem.DANGER_ON).remove(Constants.PROVIDER_ALLOW_ANONYMOUS).remove(Constants.PROVIDER_KEY).commit(); interface_with_configuration_wizard.cancelAndShowAllProviders(); } |