mirror of
https://github.com/love2d/love-android.git
synced 2026-08-17 19:24:07 +02:00
Override getMainSharedObject()
This theoretically allows LOVE libs not to be extracted in Marshmallow and later by utilizing extractNativeLibs=false. However this is left to users (developer) to decide whetever to use this or not.
This commit is contained in:
@@ -45,14 +45,30 @@ public class GameActivity extends SDLActivity {
|
||||
@Override
|
||||
protected String[] getLibraries() {
|
||||
return new String[]{
|
||||
"c++_shared",
|
||||
"mpg123",
|
||||
"openal",
|
||||
"hidapi",
|
||||
"love",
|
||||
"c++_shared",
|
||||
"mpg123",
|
||||
"openal",
|
||||
"hidapi",
|
||||
"love",
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getMainSharedObject() {
|
||||
String[] libs = getLibraries();
|
||||
String libname = "lib" + libs[libs.length - 1] + ".so";
|
||||
|
||||
// Since Lollipop, you can simply pass "libname.so" to dlopen
|
||||
// and it will resolve correct paths and load correct library.
|
||||
// This is mandatory for extractNativeLibs=false support in
|
||||
// Marshmallow.
|
||||
if (android.os.Build.VERSION.SDK_INT >= 21) {
|
||||
return libname;
|
||||
} else {
|
||||
return getContext().getApplicationInfo().nativeLibraryDir + "/" + libname;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
Log.d("GameActivity", "started");
|
||||
|
||||
Reference in New Issue
Block a user