summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2023-04-13 13:42:44 +0200
committercyBerta <cyberta@riseup.net>2023-04-13 16:47:13 +0200
commit6dd7821cd38c69b9fdc3172762744f32dcbf9606 (patch)
treede5271679abdcd17b19c4096830634696c415b19 /app/src/main
parent6aafd792efa3501dfe5e203c7587cd7089df888a (diff)
obfs4-hop enum value - improve handling of disallowed dashes in enums
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/connection/Connection.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/connection/Connection.java b/app/src/main/java/de/blinkt/openvpn/core/connection/Connection.java
index 6dc78a30..0b28cbca 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/connection/Connection.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/connection/Connection.java
@@ -55,8 +55,11 @@ public abstract class Connection implements Serializable, Cloneable {
return protocol;
}
}
+
+ // !! Never use valueOf() to instantiate this enum, use fromString() !!
public enum TransportType {
OBFS4("obfs4"),
+ // dashes are not allowed in enums, so obfs4-hop becomes obfs4Hop -.-
OBFS4_HOP("obfs4Hop"),
OPENVPN("openvpn"),
@@ -70,6 +73,9 @@ public abstract class Connection implements Serializable, Cloneable {
@Override
public String toString() {
+ if (this == OBFS4_HOP) {
+ return "obfs4-hop";
+ }
return transport;
}