From a2edc50aa4b0e939170147986df3877e375beb80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Zolnai?= Date: Fri, 7 Jun 2024 14:48:47 +0200 Subject: [PATCH 1/2] Update OpenVPN library to v0.7.5.1 --- ics-openvpn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ics-openvpn b/ics-openvpn index 9563cc8e..3520bde9 160000 --- a/ics-openvpn +++ b/ics-openvpn @@ -1 +1 @@ -Subproject commit 9563cc8ee33521d7dd00149a2c1de87748b08b80 +Subproject commit 3520bde975dede6d3cd5a65278312b0ecf1014c1 From 3cbaebf72710f6a556ef80aa49056886ab50bb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Zolnai?= Date: Wed, 19 Jun 2024 11:42:01 +0200 Subject: [PATCH 2/2] Crash fixes --- app/proguard-rules.pro | 10 ++++++++++ .../eduvpn/app/viewmodel/ServerSelectionViewModel.kt | 2 +- common/src/main/cpp/jni.cpp | 7 +++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 959f4c42..0f58fdd5 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -6,3 +6,13 @@ -dontwarn org.conscrypt.* -dontwarn org.openjsse.javax.net.ssl.* -dontwarn org.openjsse.net.ssl.* + +-keepclassmembers class com.wireguard.android.backend.GoBackend { + ; +} +-keepclassmembers class com.wireguard.android.backend.GoBackend$GhettoCompletableFuture { + ; +} +-keepclassmembers class android.net.VpnService { + ; +} \ No newline at end of file diff --git a/app/src/main/java/nl/eduvpn/app/viewmodel/ServerSelectionViewModel.kt b/app/src/main/java/nl/eduvpn/app/viewmodel/ServerSelectionViewModel.kt index d813bea4..e5e86b23 100644 --- a/app/src/main/java/nl/eduvpn/app/viewmodel/ServerSelectionViewModel.kt +++ b/app/src/main/java/nl/eduvpn/app/viewmodel/ServerSelectionViewModel.kt @@ -75,7 +75,7 @@ class ServerSelectionViewModel @Inject constructor( viewModelScope.launch { var retryCount = 0 while (hasNoMoreServers() && retryCount < 5) { - delay(5_00L) + delay(500L) Log.i(TAG, "No servers found, retrying once more just in case. [$retryCount]") refresh() retryCount++ diff --git a/common/src/main/cpp/jni.cpp b/common/src/main/cpp/jni.cpp index b2826e03..55d79428 100644 --- a/common/src/main/cpp/jni.cpp +++ b/common/src/main/cpp/jni.cpp @@ -107,7 +107,7 @@ void proxyReady() { return; } JNIEnv *env; - __android_log_print(ANDROID_LOG_WARN, "Common-JNI", "ProxyGuard is READY!"); + __android_log_print(ANDROID_LOG_WARN, "Common-JNI", "ProxyGuard is ready!"); bool didAttach = GetJniEnv(globalVM, &env); jfieldID callbackFieldId = env->GetStaticFieldID(globalBackendClass, "callbackFunction","Lorg/eduvpn/common/GoBackend$Callback;"); jobject callbackField = env->GetStaticObjectField(globalBackendClass, callbackFieldId); @@ -222,7 +222,10 @@ extern "C" JNIEXPORT jstring JNICALL Java_org_eduvpn_common_GoBackend_addServer(JNIEnv *env, jobject /* this */, jint serverType, jstring id) { uintptr_t cookie = CookieNew(); const char *id_str = env->GetStringUTFChars(id, nullptr); - SetState(1); // Change first to main state to make sure we are not in a previous state. + if (InState(11).r0 != 0) { + // If we just disconnected, we need to manually set the state back to main + SetState(1); + } char *error = AddServer(cookie, (int)serverType, (char *)id_str, nullptr); CookieDelete(cookie); // Do not delete the cookie, because it might be reused later in the flow