diff --git a/android/external/Cargo.toml.tmp b/android/external/Cargo.toml.tmp new file mode 100644 index 0000000..133f77b --- /dev/null +++ b/android/external/Cargo.toml.tmp @@ -0,0 +1,44 @@ +[package] +name = "pep_engine_sequoia_backend" +description = "An implementation of the p≡p Engine's cryptotech interface using Sequoia." +version = "0.1.0" +authors = ["Neal H. Walfield "] +homepage = "https://sequoia-pgp.org/" +repository = "https://gitea.pep.foundation/neal/pEpEngineSequoiaBackend/" +readme = "README.md" +keywords = ["cryptography", "openpgp", "pgp", "encryption", "signing"] +categories = ["cryptography", "authentication", "email"] +license = "GPL-3.0-or-later" +edition = "2018" + +[badges] +maintenance = { status = "actively-developed" } + +[dependencies] +anyhow = "1" +backtrace = "0.3.61" +chrono = "0.4" +enumber = "0.3" +lazy_static = "1" +libc = "0.2" +lru = "0.6.6" +memmem = "0.1" +memoffset = "0.6" +# When bumping the version of Sequoia search the code for XXX to find +# spots where we can take advantage of new features. +sequoia-openpgp = { version = "1.0", default-features = false } +thiserror = "1" + +[dependencies.rusqlite] +version = "0.25" +features = ["bundled", "collation", "blob"] + +[lib] +crate-type = ["lib", "cdylib", "staticlib"] + +[features] +default = [ + "sequoia-openpgp/default", +] +crypto-nettle = ["sequoia-openpgp/crypto-nettle"] +crypto-cng = ["sequoia-openpgp/crypto-cng"] diff --git a/android/external/MakefileTemplate b/android/external/MakefileTemplate index e9e2d5b..4f30ab7 100644 --- a/android/external/MakefileTemplate +++ b/android/external/MakefileTemplate @@ -282,7 +282,7 @@ $(CARGO_TARGET_DIR)/$(SEQUOIA_ARCH)/release/libpep_engine_sequoia_backend.so: p ARMV7_LINUX_ANDROIDEABI_OPENSSL_INCLUDE_DIR="$(LOCAL)/include" \ ARMV7_LINUX_ANDROIDEABI_OPENSSL_DIR="$(LOCAL)/bin" \ CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) cargo build --target $(SEQUOIA_ARCH) -p pep_engine_sequoia_backend --release - +#TODO PEMA-103 we cna move seq to static (.a) $(LOCAL)/lib/libpep_engine_sequoia_backend.so: $(CARGO_TARGET_DIR)/$(SEQUOIA_ARCH)/release/libpep_engine_sequoia_backend.so cp $(CARGO_TARGET_DIR)/$(SEQUOIA_ARCH)/release/libpep_engine_sequoia_backend.* $(LOCAL)/lib/ diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 907e147..a28d3e4 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -13,8 +13,8 @@ include $(PREBUILT_STATIC_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := libpep_engine_sequoia_backend -LOCAL_SRC_FILES := $(GPGBUILD)/$(TARGET_ARCH_ABI)/lib/libpep_engine_sequoia_backend.so -include $(PREBUILT_SHARED_LIBRARY) +LOCAL_SRC_FILES := $(GPGBUILD)/$(TARGET_ARCH_ABI)/lib/libpep_engine_sequoia_backend.a +include $(PREBUILT_STATIC_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := libhogweed @@ -44,9 +44,9 @@ $(shell sh $(ENGINE_PATH)/build-android/takeOutHeaderFiles.sh $(ENGINE_PATH)) include $(CLEAR_VARS) LOCAL_MODULE := pEpJNI -LOCAL_SHARED_LIBRARIES := libnettle libhogweed libgmp libpep_engine_sequoia_backend -LOCAL_STATIC_LIBRARIES := pEpEngine libetpan libiconv pEpAdapter pEpCxx11 -LOCAL_WHOLE_STATIC_LIBRARIES := libuuid +#TODO PEMA-103 we cna move seq to static +LOCAL_SHARED_LIBRARIES := libnettle libhogweed libgmp +LOCAL_STATIC_LIBRARIES := pEpEngine libetpan libuuid libiconv pEpAdapter pEpCxx11 libpep_engine_sequoia_backend LOCAL_CPP_FEATURES += exceptions LOCAL_CPPFLAGS += -std=c++11 -DANDROID_STL=c++_shared -DHAVE_PTHREADS -DDISABLE_SYNC -fuse-ld=lld LOCAL_SRC_FILES := \ diff --git a/android/src/foundation/pEp/jniadapter/AndroidHelper.java b/android/src/foundation/pEp/jniadapter/AndroidHelper.java index e746075..36aa174 100644 --- a/android/src/foundation/pEp/jniadapter/AndroidHelper.java +++ b/android/src/foundation/pEp/jniadapter/AndroidHelper.java @@ -128,6 +128,8 @@ public class AndroidHelper { System.loadLibrary("gmp"); System.loadLibrary("nettle"); System.loadLibrary("hogweed"); + //TODO PEMA-103 Check if we are required to link the shared lib here +// System.loadLibrary("libpep_engine_sequoia_backend"); migrateFromGPGToSequoiaIfNeeded(c.getFilesDir());