summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorGrant Limberg <grant.limberg@zerotier.com>2019-04-22 11:35:35 -0700
committerGrant Limberg <grant.limberg@zerotier.com>2019-04-22 11:35:35 -0700
commit71ae6789300858760df8115c48cc034bb86d0144 (patch)
tree3b573df9b9dd718aaad2275b2797d54f941b5051 /java
parent6a027c9c0abaf8dd46403ed94f4cce3378c0f826 (diff)
downloadinfinitytier-71ae6789300858760df8115c48cc034bb86d0144.tar.gz
infinitytier-71ae6789300858760df8115c48cc034bb86d0144.zip
Make things compile with Android NDK again
Diffstat (limited to 'java')
-rw-r--r--java/jni/Android.mk27
-rw-r--r--java/jni/Application.mk2
-rw-r--r--java/jni/com_zerotierone_sdk_Node.cpp13
3 files changed, 4 insertions, 38 deletions
diff --git a/java/jni/Android.mk b/java/jni/Android.mk
index 8cda2474..f018950d 100644
--- a/java/jni/Android.mk
+++ b/java/jni/Android.mk
@@ -6,11 +6,9 @@ LOCAL_MODULE := ZeroTierOneJNI
LOCAL_C_INCLUDES := \
$(ZT1)/include \
$(ZT1)/node \
- $(ZT1)/osdep \
- $(ZT1)/ext/miniupnpc \
- $(ZT1)/ext/libnatpmp
+ $(ZT1)/osdep
-LOCAL_LDLIBS := -llog -latomic
+LOCAL_LDLIBS := -llog
# LOCAL_CFLAGS := -g
LOCAL_CFLAGS := -DZT_USE_MINIUPNPC
@@ -43,26 +41,7 @@ LOCAL_SRC_FILES := \
$(ZT1)/node/Topology.cpp \
$(ZT1)/node/Trace.cpp \
$(ZT1)/node/Utils.cpp \
- $(ZT1)/osdep/OSUtils.cpp \
- $(ZT1)/osdep/PortMapper.cpp
-
-# libminiupnpc and libnatpmp files
-LOCAL_SRC_FILES += \
- $(ZT1)/ext/miniupnpc/connecthostport.c \
- $(ZT1)/ext/miniupnpc/igd_desc_parse.c \
- $(ZT1)/ext/miniupnpc/minisoap.c \
- $(ZT1)/ext/miniupnpc/minissdpc.c \
- $(ZT1)/ext/miniupnpc/miniupnpc.c \
- $(ZT1)/ext/miniupnpc/miniwget.c \
- $(ZT1)/ext/miniupnpc/minixml.c \
- $(ZT1)/ext/miniupnpc/portlistingparse.c \
- $(ZT1)/ext/miniupnpc/receivedata.c \
- $(ZT1)/ext/miniupnpc/upnpcommands.c \
- $(ZT1)/ext/miniupnpc/upnpdev.c \
- $(ZT1)/ext/miniupnpc/upnperrors.c \
- $(ZT1)/ext/miniupnpc/upnpreplyparse.c \
- $(ZT1)/ext/libnatpmp/natpmp.c \
- $(ZT1)/ext/libnatpmp/getgateway.c
+ $(ZT1)/osdep/OSUtils.cpp
# JNI Files
LOCAL_SRC_FILES += \
diff --git a/java/jni/Application.mk b/java/jni/Application.mk
index f5a87ac7..4fc50f73 100644
--- a/java/jni/Application.mk
+++ b/java/jni/Application.mk
@@ -1,5 +1,5 @@
# NDK_TOOLCHAIN_VERSION := clang3.5
APP_STL := c++_static
-APP_CPPFLAGS := -Wall -fstack-protector -fexceptions -fno-strict-aliasing -Wno-deprecated-register -DZT_NO_TYPE_PUNNING=1
+APP_CPPFLAGS := -Wall -fstack-protector -fexceptions -fno-strict-aliasing -frtti -Wno-deprecated-register -DZT_NO_TYPE_PUNNING=1
APP_PLATFORM := android-14
APP_ABI := all
diff --git a/java/jni/com_zerotierone_sdk_Node.cpp b/java/jni/com_zerotierone_sdk_Node.cpp
index 9a36e99b..6fca220b 100644
--- a/java/jni/com_zerotierone_sdk_Node.cpp
+++ b/java/jni/com_zerotierone_sdk_Node.cpp
@@ -32,8 +32,6 @@
#include <ZeroTierOne.h>
#include "Mutex.hpp"
-#include "PortMapper.hpp"
-
#include <map>
#include <string>
#include <assert.h>
@@ -60,7 +58,6 @@ namespace {
, configListener(NULL)
, pathChecker(NULL)
, callbacks(NULL)
- , portMapper(NULL)
{
callbacks = (ZT_Node_Callbacks*)malloc(sizeof(ZT_Node_Callbacks));
memset(callbacks, 0, sizeof(ZT_Node_Callbacks));
@@ -81,9 +78,6 @@ namespace {
free(callbacks);
callbacks = NULL;
-
- delete portMapper;
- portMapper = NULL;
}
int64_t id;
@@ -101,8 +95,6 @@ namespace {
jobject pathChecker;
ZT_Node_Callbacks *callbacks;
-
- ZeroTier::PortMapper *portMapper;
};
@@ -881,11 +873,6 @@ JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_node_1init(
}
uint64_t nodeId = ZT_Node_address(node);
- if (nodeId != 0) {
- char uniqueName[64];
- snprintf(uniqueName, sizeof(uniqueName), "ZeroTier Android/%.10llx@%u", (unsigned long long)nodeId, 9993);
- ref->portMapper = new ZeroTier::PortMapper(9993, uniqueName);
- }
ZeroTier::Mutex::Lock lock(nodeMapMutex);
ref->node = node;