summaryrefslogtreecommitdiff
path: root/app/src/release/java/se/leap
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-11-04 00:20:31 +0100
committerParménides GV <parmegv@sdf.org>2014-11-04 00:20:31 +0100
commite54f0cf39cce1c27b7baca77d777c7c271e4d108 (patch)
treee21fe315fb70dcee419bfbab6342a59440e9dcb9 /app/src/release/java/se/leap
parent43ac5ff987c67d61564f7b09ebacfa040f2b53b5 (diff)
Don't update eip service oncreate eip.
Reuse EipServiceFragment's stopEip and startEipFromScratch in Dashboard.
Diffstat (limited to 'app/src/release/java/se/leap')
-rw-r--r--app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java b/app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java
index 189289ec..749457e4 100644
--- a/app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java
+++ b/app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java
@@ -95,7 +95,7 @@ public class ProviderAPI extends IntentService {
ERRORS = "errors",
UPDATE_PROGRESSBAR = "update_progressbar",
CURRENT_PROGRESS = "current_progress",
- TAG = "provider_api_tag"
+ TAG = ProviderAPI.class.getSimpleName();
;
final public static int
@@ -897,7 +897,6 @@ public class ProviderAPI extends IntentService {
private boolean updateVpnCertificate() {
getNewCert();
- preferences.edit().putInt(EIP.PARSED_SERIAL, 0).commit();
Intent updateEIP = new Intent(getApplicationContext(), EIP.class);
updateEIP.setAction(EIP.ACTION_UPDATE_EIP_SERVICE);
startService(updateEIP);
@@ -919,7 +918,6 @@ public class ProviderAPI extends IntentService {
URL new_cert_string_url = new URL(provider_main_url + "/" + provider_json.getString(Provider.API_VERSION) + "/" + EIP.CERTIFICATE);
String cert_string = downloadWithProviderCA(new_cert_string_url.toString());
-
if(!cert_string.isEmpty()) {
if(ConfigHelper.checkErroneousDownload(cert_string)) {
String reason_to_fail = provider_json.getString(ERRORS);
@@ -940,12 +938,12 @@ public class ProviderAPI extends IntentService {
}
}
try {
- RSAPrivateKey keyCert = ConfigHelper.parseRsaKeyFromString(keyString);
- keyString = Base64.encodeToString( keyCert.getEncoded(), Base64.DEFAULT );
+ RSAPrivateKey key = ConfigHelper.parseRsaKeyFromString(keyString);
+ keyString = Base64.encodeToString(key.getEncoded(), Base64.DEFAULT);
preferences.edit().putString(EIP.PRIVATE_KEY, "-----BEGIN RSA PRIVATE KEY-----\n"+keyString+"-----END RSA PRIVATE KEY-----").commit();
- X509Certificate certCert = ConfigHelper.parseX509CertificateFromString(certificateString);
- certificateString = Base64.encodeToString( certCert.getEncoded(), Base64.DEFAULT);
+ X509Certificate certificate = ConfigHelper.parseX509CertificateFromString(certificateString);
+ certificateString = Base64.encodeToString(certificate.getEncoded(), Base64.DEFAULT);
preferences.edit().putString(EIP.CERTIFICATE, "-----BEGIN CERTIFICATE-----\n"+certificateString+"-----END CERTIFICATE-----").commit();
preferences.edit().putString(EIP.DATE_FROM_CERTIFICATE, EIP.certificate_date_format.format(Calendar.getInstance().getTime())).commit();
return true;