summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn
diff options
context:
space:
mode:
authorArne Schwabe <arne@blinkt.de>2012-05-09 12:49:20 +0200
committerArne Schwabe <arne@blinkt.de>2012-05-09 12:49:20 +0200
commitf0e9663173a07bd9adf0819a1291ed0ef0ac2adc (patch)
tree99c3ec9c85cbc2c5f4cb93c3758584a3b16afdb2 /src/de/blinkt/openvpn
parente689637b7c3555c464f800f049fe4059b908ca27 (diff)
Add tiny minivpn executable which uses the libopenvpn.so so we don't have to copy a big executable from assets to cache directory
Diffstat (limited to 'src/de/blinkt/openvpn')
-rw-r--r--src/de/blinkt/openvpn/OpenVpnManagementThread.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/de/blinkt/openvpn/OpenVpnManagementThread.java b/src/de/blinkt/openvpn/OpenVpnManagementThread.java
index 31ea49e..fb08898 100644
--- a/src/de/blinkt/openvpn/OpenVpnManagementThread.java
+++ b/src/de/blinkt/openvpn/OpenVpnManagementThread.java
@@ -28,6 +28,9 @@ public class OpenVpnManagementThread implements Runnable {
mOpenVPNService = openVpnService;
}
+ static {
+ System.loadLibrary("opvpnutil");
+ }
public void managmentCommand(String cmd) {
Log.d("openvpn", "mgmt cmd" + mSocket + " " +cmd + " " );
@@ -100,10 +103,11 @@ public class OpenVpnManagementThread implements Runnable {
Log.d("Openvpn", "Got FD from socket: " + fd + " " + fdint);
- mOpenVPNService.protect(fdint);
+ //mOpenVPNService.protect(fdint);
//ParcelFileDescriptor pfd = ParcelFileDescriptor.fromFd(fdint);
//pfd.close();
+ jniclose(fdint);
return;
} catch (NoSuchMethodException e) {
e.printStackTrace();
@@ -237,7 +241,8 @@ public class OpenVpnManagementThread implements Runnable {
// Set the FileDescriptor to null to stop this mad behavior
mSocket.setFileDescriptorsForSend(null);
- pfd.close();
+
+ pfd.close();
return true;
} catch (NoSuchMethodException e) {
@@ -255,6 +260,10 @@ public class OpenVpnManagementThread implements Runnable {
}
+ private native void jniclose(int fdint);
+
+
+
private void processPWCommand(String argument) {
//argument has the form Need 'Private Key' password
int p1 =argument.indexOf('\'');