@@ -42,7 +42,9 @@ public class NativeLibraryLoader {
42
42
static {
43
43
String libname = OBJECTBOX_JNI ;
44
44
String filename = libname + ".so" ;
45
- boolean isLinux = false ;
45
+ // Some Android devices are detected as neither Android or Linux below,
46
+ // so assume Linux by default to always fallback to Android
47
+ boolean isLinux = true ;
46
48
// For Android, os.name is also "Linux", so we need an extra check
47
49
// Is not completely reliable (e.g. Vivo devices), see workaround on load failure
48
50
// Note: can not use check for Android classes as testing frameworks (Robolectric)
@@ -53,15 +55,16 @@ public class NativeLibraryLoader {
53
55
String sunArch = System .getProperty ("sun.arch.data.model" );
54
56
String cpuArchPostfix = "32" .equals (sunArch ) ? "-x86" : "-x64" ;
55
57
if (osName .contains ("windows" )) {
58
+ isLinux = false ;
56
59
libname += "-windows" + cpuArchPostfix ;
57
60
filename = libname + ".dll" ;
58
61
checkUnpackLib (filename );
59
62
} else if (osName .contains ("linux" )) {
60
- isLinux = true ;
61
63
libname += "-linux" + cpuArchPostfix ;
62
64
filename = "lib" + libname + ".so" ;
63
65
checkUnpackLib (filename );
64
66
} else if (osName .contains ("mac" )) {
67
+ isLinux = false ;
65
68
libname += "-macos" + cpuArchPostfix ;
66
69
filename = "lib" + libname + ".dylib" ;
67
70
checkUnpackLib (filename );
0 commit comments