summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/build.gradle10
-rw-r--r--main/src/main/cpp/CMakeLists.txt14
-rw-r--r--main/src/main/java/de/blinkt/openvpn/VpnProfile.java2
-rw-r--r--main/src/main/java/de/blinkt/openvpn/fragments/GeneralSettings.java6
4 files changed, 23 insertions, 9 deletions
diff --git a/main/build.gradle b/main/build.gradle
index 87a36ef7..680bba69 100644
--- a/main/build.gradle
+++ b/main/build.gradle
@@ -37,8 +37,11 @@ task ("generateOpenVPN3Swig" ,type:Exec) {
doFirst {
mkdir openvpn3SwigFiles
}
- commandLine "swig", "-outdir", openvpn3SwigFiles, "-c++", "-java", "-package", "net.openvpn.ovpn3",
- "-Isrc/main/cpp/openvpn3/client", "-Isrc/main/cpp/openvpn3/", "src/main/cpp/openvpn3/javacli/ovpncli.i"
+ commandLine "swig", "-outdir", openvpn3SwigFiles, "-outcurrentdir", "-c++", "-java", "-package", "net.openvpn.ovpn3",
+ "-Isrc/main/cpp/openvpn3/client", "-Isrc/main/cpp/openvpn3/",
+ "-o", "${openvpn3SwigFiles}/ovpncli_wrap.cxx", "-oh", "${openvpn3SwigFiles}/ovpncli_wrap.h",
+ "src/main/cpp/openvpn3/javacli/ovpncli.i"
+
}
android {
@@ -108,10 +111,13 @@ android {
productFlavors {
noovpn3 {
dimension "implementation"
+ buildConfigField 'boolean', 'openvpn3', 'false'
}
normal {
dimension "implementation"
+ buildConfigField 'boolean', 'openvpn3', 'true'
+
}
}
diff --git a/main/src/main/cpp/CMakeLists.txt b/main/src/main/cpp/CMakeLists.txt
index c708f077..1aca0c36 100644
--- a/main/src/main/cpp/CMakeLists.txt
+++ b/main/src/main/cpp/CMakeLists.txt
@@ -22,13 +22,19 @@ include(openssl.cmake)
#-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/arne/software/icsopenvpn/main/build/intermediates/cmake/normal/debug/obj/arm64-v8a
if (NOT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} MATCHES "build/intermediates/cmake/.*noovpn3.*/")
add_subdirectory(mbedtls)
- add_custom_command(OUTPUT "openvpn3/javacli/ovpncli_wrap.cxx"
- COMMAND ${CMAKE_COMMAND} -E make_directory ovpn3/java/net/openvpn/ovpn3/
- COMMAND swig -outdir ovpn3/java/net/openvpn/ovpn3/ -c++ -java -package net.openvpn.ovpn3 -I${CMAKE_SOURCE_DIR}/openvpn3/client -I${CMAKE_SOURCE_DIR}/openvpn3 ${CMAKE_SOURCE_DIR}/openvpn3/javacli/ovpncli.i)
+ add_custom_command(OUTPUT "ovpncli_wrap.cxx"
+ COMMAND ${CMAKE_COMMAND} -E make_directory ovpn3
+ COMMAND swig -outdir ovpn3
+ -c++
+ -java -package net.openvpn.ovpn3
+ -outcurrentdir
+ -I${CMAKE_SOURCE_DIR}/openvpn3/client
+ -I${CMAKE_SOURCE_DIR}/openvpn3
+ ${CMAKE_SOURCE_DIR}/openvpn3/javacli/ovpncli.i)
set(ovpn3_SRCS
openvpn3/client/ovpncli.cpp
- openvpn3/javacli/ovpncli_wrap.cxx)
+ ovpncli_wrap.cxx)
add_library(ovpn3 SHARED ${ovpn3_SRCS})
diff --git a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java
index ce33b537..d5f07843 100644
--- a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java
+++ b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java
@@ -274,7 +274,7 @@ public class VpnProfile implements Serializable, Cloneable {
public static boolean doUseOpenVPN3(Context c) {
SharedPreferences prefs = Preferences.getDefaultSharedPreferences(c);
boolean useOpenVPN3 = prefs.getBoolean("ovpn3", false);
- if ("noovpn3".equals(BuildConfig.FLAVOR))
+ if (!BuildConfig.openvpn3)
useOpenVPN3 = false;
return useOpenVPN3;
}
diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/GeneralSettings.java b/main/src/main/java/de/blinkt/openvpn/fragments/GeneralSettings.java
index ef49c656..18e5f87f 100644
--- a/main/src/main/java/de/blinkt/openvpn/fragments/GeneralSettings.java
+++ b/main/src/main/java/de/blinkt/openvpn/fragments/GeneralSettings.java
@@ -73,9 +73,11 @@ public class GeneralSettings extends PreferenceFragment implements OnPreferenceC
if(devHacks.getPreferenceCount()==0)
getPreferenceScreen().removePreference(devHacks);
- if (!"ovpn3".equals(BuildConfig.FLAVOR)) {
+ if (!BuildConfig.openvpn3) {
PreferenceCategory appBehaviour = (PreferenceCategory) findPreference("app_behaviour");
- appBehaviour.removePreference(findPreference("ovpn3"));
+ CheckBoxPreference ovpn3 = (CheckBoxPreference) findPreference("ovpn3");
+ ovpn3.setEnabled(false);
+ ovpn3.setChecked(false);
}