summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/build.gradle.kts14
-rw-r--r--main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java13
2 files changed, 13 insertions, 14 deletions
diff --git a/main/build.gradle.kts b/main/build.gradle.kts
index 35af282a..3c438bc4 100644
--- a/main/build.gradle.kts
+++ b/main/build.gradle.kts
@@ -42,7 +42,6 @@ dependencies {
val openvpn3SwigFiles = File(buildDir, "generated/source/ovpn3swig/ovpn3")
-//task ("generateOpenVPN3Swig" , Exec.class) {
tasks.register<Exec>("generateOpenVPN3Swig")
{
var swigcmd = "swig"
@@ -90,10 +89,7 @@ android {
}
create("normal") {
-// java.srcDir(listOf(File("src/ovpn3/java/"), openvpn3SwigFiles))
- }
-
- create("noovpn3") {
+ java.srcDirs("src/ovpn3/java/", openvpn3SwigFiles)
}
getByName("debug") {
@@ -124,10 +120,10 @@ android {
flavorDimensions("implementation")
productFlavors {
- create("noovpn3") {
+ /*create("noovpn3") {
setDimension("implementation")
buildConfigField ("boolean", "openvpn3", "false")
- }
+ }*/
create("normal") {
setDimension("implementation")
buildConfigField ("boolean", "openvpn3", "true")
@@ -160,9 +156,13 @@ if (project.hasProperty("keystoreFile") &&
/* Hack-o-rama but it works good enough and documentation is surprisingly sparse */
val swigTask = tasks.named("generateOpenVPN3Swig")
+val preBuildTask = tasks.getByName("preBuild")
val assembleTask = tasks.getByName("assemble")
+println(tasks.names)
+
assembleTask.dependsOn(swigTask)
+preBuildTask.dependsOn(swigTask)
// Ensure native build is run before assets, so assets are ready to be merged into the apk
/*android.applicationVariants.all { variant ->
diff --git a/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java b/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
index fab090b7..0384985e 100644
--- a/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
+++ b/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
@@ -5,6 +5,8 @@ import de.blinkt.openvpn.R;
import de.blinkt.openvpn.VpnProfile;
import net.openvpn.ovpn3.*;
+import net.openvpn.ovpn3.ClientAPI_OpenVPNClient;
+
import static net.openvpn.ovpn3.ClientAPI_OpenVPNClient.copyright;
import static net.openvpn.ovpn3.ClientAPI_OpenVPNClient.init_process;
import static net.openvpn.ovpn3.ClientAPI_OpenVPNClient.platform;
@@ -12,9 +14,6 @@ import static net.openvpn.ovpn3.ClientAPI_OpenVPNClient.platform;
public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable, OpenVPNManagement {
static {
- /*System.loadLibrary("crypto");
- System.loadLibrary("ssl");*/
- //System.loadLibrary("polarssl-dynamic");
System.loadLibrary("ovpn3");
}
@@ -223,14 +222,14 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
@Override
public void external_pki_sign_request(ClientAPI_ExternalPKISignRequest signreq) {
- VpnStatus.logDebug("Got external PKI signing request from OpenVPN core for algorithm " + signreq.getAlgorithm());
+ VpnStatus.logDebug("Got external PKI signing request from OpenVPN core for algorithm " + signreq.getPadding());
boolean pkcs1padding;
- if (signreq.getAlgorithm().equals("RSA_PKCS1_PADDING"))
+ if (signreq.getPadding().equals("RSA_PKCS1_PADDING"))
pkcs1padding = true;
- else if (signreq.getAlgorithm().equals("RSA_NO_PADDING"))
+ else if (signreq.getPadding().equals("RSA_NO_PADDING"))
pkcs1padding = false;
else
- throw new IllegalArgumentException("Illegal padding in sign request" + signreq.getAlgorithm());
+ throw new IllegalArgumentException("Illegal padding in sign request" + signreq.getPadding());
signreq.setSig(mVp.getSignedData(mService, signreq.getData(), pkcs1padding));
}