summaryrefslogtreecommitdiff
path: root/app/src/debug/java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-08-18 18:22:54 +0200
committerParménides GV <parmegv@sdf.org>2014-08-18 18:22:54 +0200
commit31f6eab32a26a658cbfb2db0d457cc1f87d23f0f (patch)
tree75f372ff22a94102ef2f9bd163febf54ac45e9d6 /app/src/debug/java
parent6057466bc8b4475bf4564b9143c60753c90f9aaa (diff)
parent7d8cde4f7ae769a3b6a25483d8bd0bb6c1551af9 (diff)
Merge branch 'develop'
Diffstat (limited to 'app/src/debug/java')
-rw-r--r--app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java6
-rw-r--r--app/src/debug/java/se/leap/bitmaskclient/ProviderDetailFragment.java2
2 files changed, 7 insertions, 1 deletions
diff --git a/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java b/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
index b17d6bb4..e729d0bc 100644
--- a/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
+++ b/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
@@ -49,10 +49,12 @@ import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.security.interfaces.RSAPrivateKey;
+import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Scanner;
+import java.util.NoSuchElementException;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.KeyManager;
@@ -615,6 +617,7 @@ public class ProviderAPI extends IntentService {
getSharedPreferences(Dashboard.SHARED_PREFERENCES, MODE_PRIVATE).edit().putString(Provider.KEY, provider_json.toString()).commit();
getSharedPreferences(Dashboard.SHARED_PREFERENCES, MODE_PRIVATE).edit().putBoolean(EIP.ALLOWED_ANON, provider_json.getJSONObject(Provider.SERVICE).getBoolean(EIP.ALLOWED_ANON)).commit();
+ getSharedPreferences(Dashboard.SHARED_PREFERENCES, MODE_PRIVATE).edit().putBoolean(EIP.ALLOWED_REGISTERED, provider_json.getJSONObject(Provider.SERVICE).getBoolean(EIP.ALLOWED_REGISTERED)).commit();
result.putBoolean(RESULT_KEY, true);
} catch (JSONException e) {
@@ -762,6 +765,8 @@ public class ProviderAPI extends IntentService {
} catch (KeyManagementException e) {
// TODO Auto-generated catch block
e.printStackTrace();
+ } catch (NoSuchElementException e) {
+ json_file_content = formatErrorMessage(R.string.server_unreachable_message);
}
return json_file_content;
}
@@ -943,6 +948,7 @@ public class ProviderAPI extends IntentService {
X509Certificate certCert = ConfigHelper.parseX509CertificateFromString(certificateString);
certificateString = Base64.encodeToString( certCert.getEncoded(), Base64.DEFAULT);
getSharedPreferences(Dashboard.SHARED_PREFERENCES, MODE_PRIVATE).edit().putString(EIP.CERTIFICATE, "-----BEGIN CERTIFICATE-----\n"+certificateString+"-----END CERTIFICATE-----").commit();
+ getSharedPreferences(Dashboard.SHARED_PREFERENCES, MODE_PRIVATE).edit().putString(EIP.DATE_FROM_CERTIFICATE, EIP.certificate_date_format.format(Calendar.getInstance().getTime())).commit();
return true;
} catch (CertificateException e) {
diff --git a/app/src/debug/java/se/leap/bitmaskclient/ProviderDetailFragment.java b/app/src/debug/java/se/leap/bitmaskclient/ProviderDetailFragment.java
index c067ce2b..3ca003a0 100644
--- a/app/src/debug/java/se/leap/bitmaskclient/ProviderDetailFragment.java
+++ b/app/src/debug/java/se/leap/bitmaskclient/ProviderDetailFragment.java
@@ -50,7 +50,7 @@ public class ProviderDetailFragment extends DialogFragment {
}
if(registration_allowed(provider_json)) {
- builder.setNegativeButton(R.string.login_button, new DialogInterface.OnClickListener() {
+ builder.setNegativeButton(R.string.signup_or_login_button, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
interface_with_configuration_wizard.login();
}