Skip to content

Commit 798c365

Browse files
NativeLibraryLoader: loadLibraryAndroid always uses OBJECTBOX_JNI name.
1 parent 9c5475c commit 798c365

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

objectbox-java/src/main/java/io/objectbox/internal/NativeLibraryLoader.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ public class NativeLibraryLoader {
8282
System.err.println("File not available: " + file.getAbsolutePath());
8383
}
8484
try {
85-
if (!android || !loadLibraryAndroid(libname)) { // if android && loadLibraryAndroid OK: done
85+
if (!android || !loadLibraryAndroid()) { // if android && loadLibraryAndroid OK: done
8686
System.loadLibrary(libname);
8787
}
8888
} catch (UnsatisfiedLinkError e) {
8989
if (!android && isLinux) {
9090
// maybe is Android, but check failed: try loading Android lib
91-
if (!loadLibraryAndroid(OBJECTBOX_JNI)) {
91+
if (!loadLibraryAndroid()) {
9292
System.loadLibrary(OBJECTBOX_JNI);
9393
}
9494
} else {
@@ -139,7 +139,7 @@ private static void checkUnpackLib(String filename) {
139139
}
140140

141141
@SuppressWarnings("BooleanMethodIsAlwaysInverted") // more readable
142-
private static boolean loadLibraryAndroid(String libname) {
142+
private static boolean loadLibraryAndroid() {
143143
if (BoxStore.context == null) {
144144
return false;
145145
}
@@ -151,11 +151,11 @@ private static boolean loadLibraryAndroid(String libname) {
151151
// use default ReLinker
152152
Class<?> relinker = Class.forName("com.getkeepsafe.relinker.ReLinker");
153153
Method loadLibrary = relinker.getMethod("loadLibrary", context, String.class, String.class);
154-
loadLibrary.invoke(null, BoxStore.context, libname, BoxStore.JNI_VERSION);
154+
loadLibrary.invoke(null, BoxStore.context, OBJECTBOX_JNI, BoxStore.JNI_VERSION);
155155
} else {
156156
// use custom ReLinkerInstance
157157
Method loadLibrary = BoxStore.relinker.getClass().getMethod("loadLibrary", context, String.class, String.class);
158-
loadLibrary.invoke(BoxStore.relinker, BoxStore.context, libname, BoxStore.JNI_VERSION);
158+
loadLibrary.invoke(BoxStore.relinker, BoxStore.context, OBJECTBOX_JNI, BoxStore.JNI_VERSION);
159159
}
160160
} catch (NoSuchMethodException e) {
161161
return false;

0 commit comments

Comments
 (0)