Updated android build script

Makefiles for android need to point towards backend, not old sequoia with all that implies, such as changing .mk, makefiles and includes.

Added libCxx11 to the task list with the same logic as libPEpTransport as they work the same.

Added header link to identity_api.cc this is purely for the sake of android studio and not required, but android studio complains about missing headers without it.

Updated Engine_version_code, will move it to a gradle variable later.
Todo: 
Investigate why JNI dislikes using identity without a global variable during handshakes.
pull/35/head
Sascha Bacardit 1 month ago
parent e560fcc246
commit c3b4363d8a

@ -2,6 +2,7 @@
def pEpEngineSrc = hasProperty('pEpEngineSrc') ? pEpEngineSrc : "../../pEpEngine"
def libpEpTransportSrc = hasProperty('libpEpTransportSrc') ? libpEpTransportSrc : "../../libpEpTransport"
def libCxx11Src = hasProperty('libCxx11Src') ? libCxx11Src : "../../libpEpCxx11"
def buildAutomatic = hasProperty('buildAutomatic') ? buildAutomatic : "true"
//CHeck M1 answers the correct thing off .avaialableprocessors here
//def threadsToUse = hasProperty('threadsToUse') ?
@ -34,7 +35,6 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion 31
defaultConfig {
minSdkVersion 21
targetSdkVersion 31
@ -96,9 +96,13 @@ android {
path 'jni/Android.mk'
}
}
task genlibCxx11Sources(type:Exec) {
workingDir "${libCxx11Src}"
commandLine 'make', "-j${threadsToUse}", 'install'
}
// call source generation makefile target
task genSources(type:Exec, dependsOn: 'genpEpEngineAsn1Sources') {
task genSources(type:Exec, dependsOn: ['genlibCxx11Sources', 'genpEpEngineAsn1Sources']) {
workingDir '../src'
commandLine 'make', 'lib-java'
}
@ -162,6 +166,10 @@ android {
into 'assets'
}
ndkVersion '25.1.8937393'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
if(buildAutomatic == "true") {
buildpEpEngineSystemDB.dependsOn(buildExternal)

@ -42,7 +42,7 @@ LDFLAGS += $(MYLDFLAGS)
# GNU Tools trickery
# point pkg-config to the .pc files generated from these builds
export PKG_CONFIG_PATH=$(LOCAL)/lib/pkgconfig
export PKG_CONFIG_PATH=$(LOCAL)/lib/src/pEpEngineSequoiaBackend/target/release
# workaround for cross-compiling bug in autoconf
export ac_cv_func_malloc_0_nonnull=yes

@ -59,10 +59,8 @@ LOCAL_SRC_FILES := \
../../src/cxx/jniutils.cc
LOCAL_C_INCLUDES += $(GPGBUILD)/$(TARGET_ARCH_ABI)/include
#LOCAL_C_INCLUDES += $(ENGINE_PATH)/build-android/include/pEp
LOCAL_C_INCLUDES += $(LIB_PEP_ADAPTER_PATH)/build-android/include $(SRC_PATH)/libpEpAdapter
LOCAL_C_INCLUDES += $(LIB_PEP_CXX11_PATH)/build-android/include $(SRC_PATH)/libpEpCxx11
#LOCAL_C_INCLUDES += $(LIB_PEP_TRANSPORT_PATH)/build-android/include $(SRC_PATH)/libpEpTransport
LOCAL_C_INCLUDES += $(ENGINE_PATH)/asn.1
LOCAL_LDFLAGS = -Wl,--allow-multiple-definition

@ -31,7 +31,8 @@ public class AndroidHelper {
// TODO : Increment when needed.
// TODO : Check if this version tracking is really needed and Automatize it
public static String ENGINE_VERSION_CODE = "Release_2.1.56";
// TODO : This could be automatically generated as the version is tied to git tag && other files in the JNI part.
public static String ENGINE_VERSION_CODE = "v3.2.0-RC3";
private static File shareDir;
@ -141,12 +142,14 @@ public class AndroidHelper {
byte[] pubringBytes = new byte[(int) pubring.length()];
pubring.readFully(pubringBytes);
Engine pEpEngine = new Engine();
pEpEngine.importKey(pubringBytes);
Log.d("boss", "init engine objc at "+Thread.currentThread().getId());
try (Engine pEpEngine = new Engine()) {
pEpEngine.importKey(pubringBytes);
byte[] secringBytes = new byte[(int) secring.length()];
secring.readFully(secringBytes);
pEpEngine.importKey(secringBytes);
byte[] secringBytes = new byte[(int) secring.length()];
secring.readFully(secringBytes);
pEpEngine.importKey(secringBytes);
}
//TODO: MARK KEYRING AS IMPORTED

@ -1,5 +1,6 @@
#include <pEp/message_api.h>
#include <pEp/pEpLog.hh>
#include "foundation_pEp_jniadapter_Identity.h"
#include "jniutils.hh"

Loading…
Cancel
Save