summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-07-04 16:44:35 +0200
committercyBerta <cyberta@riseup.net>2019-08-02 01:49:37 +0200
commit283e7531d551521dc48efa9b010127ff54316326 (patch)
tree79682df8fae07b85a583d059a6c7a4f82fb8afe6 /app/src/main/java/se/leap/bitmaskclient/eip/EIP.java
parent2a8bb775183dd08388460c711dc650d3110ca76c (diff)
create one vpnprofile per transport per gateway. implement basis to switch between obfs4 and plain openvpn connections
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/eip/EIP.java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/EIP.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java
index a5434871..1d702ec1 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java
@@ -53,6 +53,8 @@ import se.leap.bitmaskclient.R;
import static android.app.Activity.RESULT_CANCELED;
import static android.app.Activity.RESULT_OK;
import static android.content.Intent.CATEGORY_DEFAULT;
+import static de.blinkt.openvpn.core.connection.Connection.TransportType.OBFS4;
+import static de.blinkt.openvpn.core.connection.Connection.TransportType.OPENVPN;
import static se.leap.bitmaskclient.Constants.BROADCAST_EIP_EVENT;
import static se.leap.bitmaskclient.Constants.BROADCAST_GATEWAY_SETUP_OBSERVER_EVENT;
import static se.leap.bitmaskclient.Constants.BROADCAST_RESULT_CODE;
@@ -203,7 +205,7 @@ public final class EIP extends JobIntentService implements Observer {
GatewaysManager gatewaysManager = gatewaysFromPreferences();
Gateway gateway = gatewaysManager.select(nClosestGateway);
- if (gateway != null && gateway.getProfile() != null) {
+ if (gateway != null && !gateway.getProfiles().isEmpty()) {
launchActiveGateway(gateway, nClosestGateway);
tellToReceiverOrBroadcast(EIP_ACTION_START, RESULT_OK);
} else
@@ -218,7 +220,7 @@ public final class EIP extends JobIntentService implements Observer {
GatewaysManager gatewaysManager = gatewaysFromPreferences();
Gateway gateway = gatewaysManager.select(0);
- if (gateway != null && gateway.getProfile() != null) {
+ if (gateway != null && !gateway.getProfiles().isEmpty()) {
launchActiveGateway(gateway, 0);
} else {
Log.d(TAG, "startEIPAlwaysOnVpn no active profile available!");
@@ -242,7 +244,7 @@ public final class EIP extends JobIntentService implements Observer {
*/
private void launchActiveGateway(@NonNull Gateway gateway, int nClosestGateway) {
Intent intent = new Intent(BROADCAST_GATEWAY_SETUP_OBSERVER_EVENT);
- intent.putExtra(PROVIDER_PROFILE, gateway.getProfile());
+ intent.putExtra(PROVIDER_PROFILE, gateway.getProfile(OPENVPN));
intent.putExtra(Gateway.KEY_N_CLOSEST_GATEWAY, nClosestGateway);
LocalBroadcastManager.getInstance(this).sendBroadcast(intent);