diff --git a/libsodiumjni/src/main/java/libsodiumjni/internal/LoadLibrary.java b/libsodiumjni/src/main/java/libsodiumjni/internal/LoadLibrary.java index 45b3dec..fa6be47 100644 --- a/libsodiumjni/src/main/java/libsodiumjni/internal/LoadLibrary.java +++ b/libsodiumjni/src/main/java/libsodiumjni/internal/LoadLibrary.java @@ -20,8 +20,11 @@ public static void initialize(String libraryPath) { } public static String resourcePath() { + Boolean isArmArch = System.getProperty("os.arch").toLowerCase(Locale.ROOT).contains("aarch64"); + String osName = System.getProperty("os.name").toLowerCase(Locale.ROOT); if (osName.contains("linux")) return "META-INF/native/linux64/libsodiumjni.so"; + else if (osName.contains("mac") && isArmArch) return "META-INF/native/arm-darwin/libsodiumjni.dylib"; else if (osName.contains("mac")) return "META-INF/native/darwin/libsodiumjni.dylib"; else if (osName.contains("windows")) return "META-INF/native/windows64/libsodiumjni.dll"; else