diff --git a/lib/bin/build_libjson-c-android b/lib/bin/build_libjson-c-android new file mode 100755 index 00000000..faab07ee --- /dev/null +++ b/lib/bin/build_libjson-c-android @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +source "${BASH_SOURCE%/*}/build_lib" + +autoreconf() { + command autoreconf -Iautoconf-archive/m4 "$@" +} + +build libjson-c android diff --git a/platform-android/CMakeLists.txt b/platform-android/CMakeLists.txt new file mode 100644 index 00000000..5d224046 --- /dev/null +++ b/platform-android/CMakeLists.txt @@ -0,0 +1,23 @@ +project( mpw-core C ) +cmake_minimum_required( VERSION 3.0.0 ) + +add_library( mpw SHARED + "${PROJECT_SOURCE_DIR}/../platform-independent/c/core/src/base64.c" + "${PROJECT_SOURCE_DIR}/../platform-independent/c/core/src/aes.c" + "${PROJECT_SOURCE_DIR}/../platform-independent/c/core/src/mpw-algorithm.c" + "${PROJECT_SOURCE_DIR}/../platform-independent/c/core/src/mpw-types.c" + "${PROJECT_SOURCE_DIR}/../platform-independent/c/core/src/mpw-util.c" + "${PROJECT_SOURCE_DIR}/../platform-independent/c/core/src/mpw-marshal-util.c" + "${PROJECT_SOURCE_DIR}/../platform-independent/c/core/src/mpw-marshal.c" ) + +add_library( sodium SHARED IMPORTED ) +set_target_properties( sodium PROPERTIES IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../lib/libsodium/build-android~/out/lib/${ANDROID_ABI}/libsodium.so" ) +target_include_directories( mpw PRIVATE "${PROJECT_SOURCE_DIR}/../lib/libsodium/build-android~/out" ) +target_compile_definitions( mpw PRIVATE -DMPW_SODIUM=1 ) +target_link_libraries( mpw PRIVATE sodium ) + +add_library( json-c SHARED IMPORTED ) +set_target_properties( json-c PROPERTIES IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/../lib/libjson-c/build-android~/out/lib/${ANDROID_ABI}/libjson-c.so" ) +target_include_directories( mpw PRIVATE "${PROJECT_SOURCE_DIR}/../lib/libjson-c/build-android~/out" ) +target_compile_definitions( mpw PRIVATE -DMPW_JSON=1 ) +target_link_libraries( mpw PRIVATE json-c ) diff --git a/platform-independent/c/core/src/mpw-jni.c b/platform-independent/c/core/src/mpw-jni.c index 9e1017a8..100b52d0 100644 --- a/platform-independent/c/core/src/mpw-jni.c +++ b/platform-independent/c/core/src/mpw-jni.c @@ -8,7 +8,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { JNIEnv* env; - if (vm->GetEnv(&env, JNI_VERSION_1_6) != JNI_OK) + if ((*vm)->GetEnv( vm, (void **)&env, JNI_VERSION_1_6 ) != JNI_OK) return -1; return JNI_VERSION_1_6; diff --git a/platform-independent/java/algorithm/build.gradle b/platform-independent/java/algorithm/build.gradle index 2c4677ce..dcbb3923 100644 --- a/platform-independent/java/algorithm/build.gradle +++ b/platform-independent/java/algorithm/build.gradle @@ -16,7 +16,7 @@ dependencies { api group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2' api group: 'com.google.code.findbugs', name: 'findbugs-annotations', version: '3.0.1' - //lib project( path: ':masterpassword-core', configuration: 'default' ) + lib project( path: ':masterpassword-core', configuration: 'default' ) } processResources {