summaryrefslogtreecommitdiff
path: root/app/src/main/java/se
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-11-22 11:44:05 +0100
committerParménides GV <parmegv@sdf.org>2014-11-22 11:44:05 +0100
commit809c95e41458de62cee3752dd695588ef2039a5f (patch)
tree72787ff54b2e435ed960e801069adf63efe669bc /app/src/main/java/se
parent8f37e6f940ae4034458a1d9d39dc5ffe4ff70848 (diff)
Ask to log in to update certificate if needed.
ProviderAPI from debug build uses an invalid certificate the first time it tries to download a new cert, just to test this.
Diffstat (limited to 'app/src/main/java/se')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/Dashboard.java2
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/EIP.java2
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java31
3 files changed, 20 insertions, 15 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
index 49614a6f..7d00ca77 100644
--- a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
+++ b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
@@ -225,7 +225,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
if(provider_json_string.isEmpty() == false) {
provider_json = new JSONObject(provider_json_string);
JSONObject service_description = provider_json.getJSONObject(Provider.SERVICE);
- boolean authed_eip = preferences.getBoolean(EIP.AUTHED_EIP, false);
+ boolean authed_eip = !LeapSRPSession.getToken().isEmpty();
boolean allow_registered_eip = service_description.getBoolean(Provider.ALLOW_REGISTRATION);
preferences.edit().putBoolean(EIP.ALLOWED_REGISTERED, allow_registered_eip);
diff --git a/app/src/main/java/se/leap/bitmaskclient/EIP.java b/app/src/main/java/se/leap/bitmaskclient/EIP.java
index 0d11847e..2ce3c20f 100644
--- a/app/src/main/java/se/leap/bitmaskclient/EIP.java
+++ b/app/src/main/java/se/leap/bitmaskclient/EIP.java
@@ -156,7 +156,7 @@ public final class EIP extends IntentService {
mReceiver = EipServiceFragment.getReceiver();
launchActiveGateway();
}
- earlyRoutes();
+ //earlyRoutes();
}
/**
diff --git a/app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java b/app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java
index a7d68198..6d223dd6 100644
--- a/app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java
+++ b/app/src/main/java/se/leap/bitmaskclient/EipServiceFragment.java
@@ -85,8 +85,8 @@ public class EipServiceFragment extends Fragment implements StateListener, OnChe
super.onResume();
VpnStatus.addStateListener(this);
-
- eipCommand(EIP.ACTION_CHECK_CERT_VALIDITY);
+
+ eipCommand(EIP.ACTION_CHECK_CERT_VALIDITY);
}
@Override
@@ -146,7 +146,7 @@ public class EipServiceFragment extends Fragment implements StateListener, OnChe
private boolean canLogInToStartEIP() {
boolean isAllowedRegistered = Dashboard.preferences.getBoolean(EIP.ALLOWED_REGISTERED, false);
- boolean isLoggedIn = Dashboard.preferences.getBoolean(EIP.AUTHED_EIP, false);
+ boolean isLoggedIn = !LeapSRPSession.getToken().isEmpty();
Log.d(TAG, "Allow registered? " + isAllowedRegistered);
Log.d(TAG, "Is logged in? " + isLoggedIn);
return isAllowedRegistered && !isLoggedIn && !EIP.mIsStarting && !EIP.isConnected();
@@ -386,16 +386,21 @@ public class EipServiceFragment extends Fragment implements StateListener, OnChe
dashboard.showProgressBar();
String status = getResources().getString(R.string.updating_certificate_message);
setEipStatus(status);
-
- Intent provider_API_command = new Intent(getActivity(), ProviderAPI.class);
- if(dashboard.providerAPI_result_receiver == null) {
- dashboard.providerAPI_result_receiver = new ProviderAPIResultReceiver(new Handler());
- dashboard.providerAPI_result_receiver.setReceiver(dashboard);
- }
-
- provider_API_command.setAction(ProviderAPI.DOWNLOAD_CERTIFICATE);
- provider_API_command.putExtra(ProviderAPI.RECEIVER_KEY, dashboard.providerAPI_result_receiver);
- getActivity().startService(provider_API_command);
+
+ if(LeapSRPSession.getToken().isEmpty() && !Dashboard.preferences.getBoolean(EIP.ALLOWED_ANON, false)) {
+ dashboard.logInDialog(Bundle.EMPTY);
+ } else {
+
+ Intent provider_API_command = new Intent(getActivity(), ProviderAPI.class);
+ if (dashboard.providerAPI_result_receiver == null) {
+ dashboard.providerAPI_result_receiver = new ProviderAPIResultReceiver(new Handler());
+ dashboard.providerAPI_result_receiver.setReceiver(dashboard);
+ }
+
+ provider_API_command.setAction(ProviderAPI.DOWNLOAD_CERTIFICATE);
+ provider_API_command.putExtra(ProviderAPI.RECEIVER_KEY, dashboard.providerAPI_result_receiver);
+ getActivity().startService(provider_API_command);
+ }
break;
}
}