summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-10-19 01:31:45 +0200
committercyBerta <cyberta@riseup.net>2019-10-19 01:31:45 +0200
commit1c57a692843218179d421f2473789ad3c9efe977 (patch)
treed520e687291436fd7e4106ac7b59533ba9cc02f1
parent561eb26edf5e23aaa4da1770d69c04a7614eb3ab (diff)
introduce error types in VpnStatus to distinguish between Shapeshifter based errors and others
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/LogItem.java10
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/VpnStatus.java9
2 files changed, 19 insertions, 0 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/LogItem.java b/app/src/main/java/de/blinkt/openvpn/core/LogItem.java
index 178906c3..8a0a528a 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/LogItem.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/LogItem.java
@@ -39,6 +39,7 @@ public class LogItem implements Parcelable {
private int mRessourceId;
// Default log priority
VpnStatus.LogLevel mLevel = VpnStatus.LogLevel.INFO;
+ private VpnStatus.ErrorType errorType = VpnStatus.ErrorType.UNKNOWN;
private long logtime = System.currentTimeMillis();
private int mVerbosityLevel = -1;
@@ -246,6 +247,11 @@ public class LogItem implements Parcelable {
mLevel = loglevel;
}
+ public LogItem(VpnStatus.ErrorType errorType) {
+ mLevel = VpnStatus.LogLevel.ERROR;
+ this.errorType = errorType;
+ }
+
public String getString(Context c) {
try {
if (mMessage != null) {
@@ -306,6 +312,10 @@ public class LogItem implements Parcelable {
return mLevel;
}
+ public VpnStatus.ErrorType getErrorType() {
+ return errorType;
+ }
+
@Override
public String toString() {
diff --git a/app/src/main/java/de/blinkt/openvpn/core/VpnStatus.java b/app/src/main/java/de/blinkt/openvpn/core/VpnStatus.java
index c362e299..737b8b42 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/VpnStatus.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/VpnStatus.java
@@ -216,6 +216,11 @@ public class VpnStatus {
}
}
+ public enum ErrorType {
+ UNKNOWN,
+ SHAPESHIFTER
+ }
+
// keytool -printcert -jarfile de.blinkt.openvpn_85.apk
static final byte[] officalkey = {-58, -42, -44, -106, 90, -88, -87, -88, -52, -124, 84, 117, 66, 79, -112, -111, -46, 86, -37, 109};
static final byte[] officaldebugkey = {-99, -69, 45, 71, 114, -116, 82, 66, -99, -122, 50, -70, -56, -111, 98, -35, -65, 105, 82, 43};
@@ -502,6 +507,10 @@ public class VpnStatus {
newLogItem(new LogItem(LogLevel.ERROR, resourceId, args));
}
+ public static void logError(ErrorType errorType) {
+ newLogItem(new LogItem(errorType));
+ }
+
public static void logMessageOpenVPN(LogLevel level, int ovpnlevel, String message) {
newLogItem(new LogItem(level, ovpnlevel, message));