mirror of
https://github.com/schwabe/ics-openvpn.git
synced 2024-09-19 19:42:29 +02:00
Fix compiling with Android NDK r9
This commit is contained in:
parent
98e81a0454
commit
89fbc2e73b
@ -10,7 +10,7 @@ svn co http://google-breakpad.googlecode.com/svn/trunk/ google-breakpad
|
||||
|
||||
|
||||
- Install sdk
|
||||
- Install ndk (Versions 8c+ give strange linker errors, use 8b for now)
|
||||
- Install ndk (Version r9 is tested and used by me)
|
||||
- Make sure that ndk-build is in your build path.
|
||||
|
||||
Do ./misc/build-native.(sh|bat) in the root directory of the project.
|
||||
|
@ -36,7 +36,7 @@ include $(BUILD_SHARED_LIBRARY)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_LDLIBS := -lz -lc
|
||||
LOCAL_SHARED_LIBRARIES := libssl libcrypto openvpn
|
||||
LOCAL_SRC_FILES:= minivpn.c
|
||||
LOCAL_SRC_FILES:= minivpn.c dummy.cpp
|
||||
LOCAL_MODULE = minivpn
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
APP_ABI := all
|
||||
NDK_TOOLCHAIN_VERSION=4.4.3
|
||||
#APP_PLATFORM := android-14
|
||||
APP_STL:=stlport_static
|
||||
APP_PLATFORM := android-14
|
||||
|
||||
APP_STL:=stlport_shared
|
||||
#APP_STL:=gnustl_shared
|
||||
|
||||
#APP_OPTIM := release
|
||||
|
||||
|
8
jni/dummy.cpp
Normal file
8
jni/dummy.cpp
Normal file
@ -0,0 +1,8 @@
|
||||
/*#include <string>
|
||||
#include <iostream>
|
||||
|
||||
void dummy()
|
||||
{
|
||||
std::cout << "I am a dummy function to help compile on Android NDK r9" << std::endl;
|
||||
}
|
||||
*/
|
@ -7,6 +7,7 @@ public class NativeUtils {
|
||||
static native void jniclose(int fdint);
|
||||
|
||||
static {
|
||||
System.loadLibrary("stlport_shared");
|
||||
System.loadLibrary("opvpnutil");
|
||||
}
|
||||
}
|
||||
|
@ -92,11 +92,6 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement {
|
||||
|
||||
}
|
||||
|
||||
|
||||
static {
|
||||
System.loadLibrary("opvpnutil");
|
||||
}
|
||||
|
||||
public void managmentCommand(String cmd) {
|
||||
if(mSocket!=null) {
|
||||
try {
|
||||
@ -162,7 +157,7 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement {
|
||||
private void protectFileDescriptor(FileDescriptor fd) {
|
||||
Exception exp;
|
||||
try {
|
||||
Method getInt = FileDescriptor.class.getDeclaredMethod("getInt$");
|
||||
Method getInt = FileDescriptor.class.getDeclaredMethod("getInt$");
|
||||
int fdint = (Integer) getInt.invoke(fd);
|
||||
|
||||
// You can even get more evil by parsing toString() and extract the int from that :)
|
||||
|
Loading…
Reference in New Issue
Block a user