diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 0158d4c..50cb6a1 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -59,6 +59,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := libetpan LOCAL_SRC_FILES := ../build/libetpan-android-1/libs/$(TARGET_ARCH_ABI)/libetpan.a LOCAL_EXPORT_C_INCLUDES := build/libetpan-android-1/include +LOCAL_EXPORT_LDLIBS := -lz include $(PREBUILT_STATIC_LIBRARY) include $(CLEAR_VARS) @@ -70,7 +71,7 @@ include $(PREBUILT_STATIC_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := pEpJNIAdapter LOCAL_SHARED_LIBRARIES := libgpgme -LOCAL_STATIC_LIBRARIES := openssl cyrus-sasl libetpan pEpEngine +LOCAL_STATIC_LIBRARIES := pEpEngine libetpan openssl cyrus-sasl LOCAL_CPP_FEATURES += exceptions LOCAL_SRC_FILES := \ ../../src/org_pEp_jniadapter_Engine.cc \ diff --git a/src/gen_cpp_Message.ysl2 b/src/gen_cpp_Message.ysl2 index 1cd6c1b..645adf0 100644 --- a/src/gen_cpp_Message.ysl2 +++ b/src/gen_cpp_Message.ysl2 @@ -14,6 +14,7 @@ tstylesheet { #include #include #include + #include #include #include diff --git a/src/jniutils.cc b/src/jniutils.cc index 49abb8b..3f50b7b 100644 --- a/src/jniutils.cc +++ b/src/jniutils.cc @@ -2,9 +2,23 @@ #include #include +#include +#include #include #include +#ifdef ANDROID +#include +time_t timegm(struct tm* const t) { + static const time_t kTimeMax = ~(1L << (sizeof(time_t) * CHAR_BIT - 1)); + static const time_t kTimeMin = (1L << (sizeof(time_t) * CHAR_BIT - 1)); + time64_t result = timegm64(t); + if (result < kTimeMin || result > kTimeMax) + return -1; + return result; +} +#endif + namespace pEp { namespace JNIAdapter { jclass findClass(JNIEnv *env, const char *classname)