From a4eb52d8175a5f8585409473ab23fa78f9d3f3ae Mon Sep 17 00:00:00 2001 From: Mats Jerratsch Date: Mon, 27 Apr 2020 11:26:44 +0100 Subject: [PATCH] Fix static library filename --- jni/build.gradle | 2 +- jni/java/wallet/core/java/AnySigner.java | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/jni/build.gradle b/jni/build.gradle index 62a9c28b4ae..8794f9a428c 100644 --- a/jni/build.gradle +++ b/jni/build.gradle @@ -15,7 +15,7 @@ plugins { } group 'com.blockchain' -version '1.0.1' +version '1.0.2' apply plugin: 'maven-publish' apply plugin: 'maven' diff --git a/jni/java/wallet/core/java/AnySigner.java b/jni/java/wallet/core/java/AnySigner.java index 7e193933f71..734225cff7a 100644 --- a/jni/java/wallet/core/java/AnySigner.java +++ b/jni/java/wallet/core/java/AnySigner.java @@ -8,7 +8,6 @@ import com.google.protobuf.Message; import com.google.protobuf.Parser; - import wallet.core.jni.CoinType; import java.io.File; @@ -16,9 +15,6 @@ import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; @@ -27,6 +23,7 @@ public class AnySigner { private static Path tempDirWithPrefix; private static boolean isInitialized = false; + public static void initialize() { // Load the static library from the resource path somehow... try { @@ -41,10 +38,10 @@ public static void initialize() { private static String getResourceName() { String os = System.getProperty("os.name").toLowerCase(); - if(os.contains("mac")) { - return "libTrustWalletCore.so"; + if (os.contains("mac")) { + return "libTrustWalletCore-osx.so"; } else { - return "libTrustWalletCore.a"; + return "libTrustWalletCore-linux.so"; } } @@ -63,6 +60,7 @@ public static T sign(Message input, CoinType coin, Parser outputData = null; return output; } + public static native byte[] nativeSign(byte[] data, int coin); public static byte[] encode(Message input, CoinType coin) throws Exception { @@ -89,5 +87,6 @@ public static T plan(Message input, CoinType coin, Parser outputData = null; return output; } + public static native byte[] nativePlan(byte[] data, int coin); }