summaryrefslogtreecommitdiff
path: root/app/src/insecure/java
diff options
context:
space:
mode:
authorFup Duck <fupduck@sacknagel.com>2017-12-07 12:52:29 +0100
committerFup Duck <fupduck@sacknagel.com>2017-12-07 12:52:29 +0100
commitf8c2f76971f5a7f26d18e5e669d5e0ce9c560f3f (patch)
treeedd56030c03b259e147eba3af8987461874aedca /app/src/insecure/java
parentda7293252f197e9b54c1abd8127b4abe45b95110 (diff)
Rename constants
* renamed last constants * remove unnecessary updates/ConstantUnification
Diffstat (limited to 'app/src/insecure/java')
-rw-r--r--app/src/insecure/java/se/leap/bitmaskclient/ProviderAPI.java8
-rw-r--r--app/src/insecure/java/se/leap/bitmaskclient/ProviderDetailFragment.java5
2 files changed, 6 insertions, 7 deletions
diff --git a/app/src/insecure/java/se/leap/bitmaskclient/ProviderAPI.java b/app/src/insecure/java/se/leap/bitmaskclient/ProviderAPI.java
index c6826a53..7689c343 100644
--- a/app/src/insecure/java/se/leap/bitmaskclient/ProviderAPI.java
+++ b/app/src/insecure/java/se/leap/bitmaskclient/ProviderAPI.java
@@ -137,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) {
@@ -167,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) {
@@ -190,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 f6ebfc4b..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.*;
@@ -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;
}
@@ -79,7 +78,7 @@ public class ProviderDetailFragment extends DialogFragment {
public void onCancel(DialogInterface dialog) {
super.onCancel(dialog);
SharedPreferences.Editor editor = getActivity().getSharedPreferences(Constants.SHARED_PREFERENCES, Activity.MODE_PRIVATE).edit();
- editor.remove(Provider.KEY).remove(ProviderItem.DANGER_ON).remove(Constants.ALLOWED_ANON).remove(Constants.KEY).commit();
+ editor.remove(Provider.KEY).remove(ProviderItem.DANGER_ON).remove(Constants.PROVIDER_ALLOW_ANONYMOUS).remove(Constants.PROVIDER_KEY).commit();
interface_with_configuration_wizard.cancelAndShowAllProviders();
}