From 14ba6c81a5ec60732481e84eb02d62d6490c27f8 Mon Sep 17 00:00:00 2001 From: Fup Duck Date: Thu, 23 Nov 2017 11:34:52 +0100 Subject: Add Splash StartActivity * added Splash StartActivity to handle updates and initialization * created global Constants * move EIPConstants to Constants * create update possibility * use VectorDrawable as background for StartActivity --- app/src/insecure/java/se/leap/bitmaskclient/ProviderAPI.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'app/src/insecure/java/se/leap/bitmaskclient/ProviderAPI.java') 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); -- cgit v1.2.3