summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java38
1 files changed, 19 insertions, 19 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
index 063d2341..37360f81 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
@@ -166,35 +166,35 @@ public class GatewaysManager {
}
private TransportType[] determineTransportTypes() {
- if (getUseBridges() && !usesSpecificTunnel()) {
- return new TransportType[]{OBFS4, OBFS4_HOP};
- } else if (getUseBridges() && getUseObfs4()) {
- return new TransportType[]{OBFS4};
- } else if (getUseBridges() && getUseObfs4Kcp()) {
- return new TransportType[]{OBFS4};
- } else if (getUseBridges() && usesSpecificTunnel() && getUsePortHopping()) {
+ if (!getUseBridges()){
+ return new TransportType[]{OPENVPN};
+ }
+
+ if (getUsePortHopping()) {
return new TransportType[]{OBFS4_HOP};
+ } else if (getUseObfs4() || getUseObfs4Kcp()) {
+ return new TransportType[]{OBFS4};
} else {
- return new TransportType[]{OPENVPN};
+ return new TransportType[]{OBFS4, OBFS4_HOP};
}
}
@Nullable
private static Set<String> getObfuscationTransportLayerProtocols() {
- Set<String> transportProtocols = null;
-
- if (getUseBridges()) {
- if (getUseObfs4Kcp()) {
- transportProtocols = Set.of(KCP);
- } else if (getUseObfs4()) {
- transportProtocols = Set.of(TCP);
- } else {
- transportProtocols = Set.of(TCP, KCP);
- }
+ if (!getUseBridges()) {
+ return null;
}
- return transportProtocols;
+ if (getUseObfs4()) {
+ return Set.of(TCP);
+ } else if (getUseObfs4Kcp()) {
+ return Set.of(KCP);
+ } else {
+ // If neither Obf4 nor Obf4Kcp are used, and bridges are enabled,
+ // then use both TCP and KCP (based on the original logic).
+ return Set.of(TCP, KCP);
+ }
}
public void updateTransport(TransportType transportType) {