add native libraries for aarch64

This commit is contained in:
Craig Raw 2022-05-06 17:34:00 +02:00
parent 9cb95f2f8c
commit ba86924503
4 changed files with 8 additions and 3 deletions

View file

@ -44,10 +44,12 @@ dependencies {
implementation ('org.bouncycastle:bcprov-jdk15on:1.64') {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
implementation ('de.mkammerer:argon2-jvm:2.7') {
implementation ('de.mkammerer:argon2-jvm:2.11') {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
exclude group: 'junit', module: 'junit'
exclude group: 'net.java.dev.jna', module: 'jna'
}
implementation ('net.java.dev.jna:jna:5.8.0')
implementation ('ch.qos.logback:logback-classic:1.2.8') {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
exclude group: 'org.slf4j'

View file

@ -1,6 +1,6 @@
open module com.sparrowwallet.drongo {
requires org.bouncycastle.provider;
requires de.mkammerer.argon2;
requires de.mkammerer.argon2.nolibs;
requires org.slf4j;
requires logback.core;
requires logback.classic;

View file

@ -35,7 +35,10 @@ public class Secp256k1Context {
private static boolean loadLibrary() {
try {
String osName = System.getProperty("os.name");
if(osName.startsWith("Mac")) {
String osArch = System.getProperty("os.arch");
if(osName.startsWith("Mac") && osArch.equals("aarch64")) {
NativeUtils.loadLibraryFromJar("/native/osx/aarch64/libsecp256k1.dylib");
} else if(osName.startsWith("Mac")) {
NativeUtils.loadLibraryFromJar("/native/osx/x64/libsecp256k1.dylib");
} else if(osName.startsWith("Windows")) {
NativeUtils.loadLibraryFromJar("/native/windows/x64/libsecp256k1-0.dll");

Binary file not shown.