# HG changeset patch # User akk0rd87 # Date 1564075960 -10800 # Thu Jul 25 20:32:40 2019 +0300 # Node ID b0f0a94ce33f8c6ad424b55e15ddc2be93c6efb2 # Parent bc90ce38f1e27ace54b83bebf987993002504f7f Fixed bug 4739 - Uncompressed native libs may not extract from apk to filesystem. Loading main lib directly from apk. diff -r bc90ce38f1e2 -r b0f0a94ce33f src/core/android/SDL_android.c --- a/src/core/android/SDL_android.c Tue Jul 23 14:41:00 2019 -0500 +++ b/src/core/android/SDL_android.c Thu Jul 25 20:32:40 2019 +0300 @@ -629,6 +629,19 @@ library_file = (*env)->GetStringUTFChars(env, library, NULL); library_handle = dlopen(library_file, RTLD_GLOBAL); + + if(!library_handle) { + /* When deploying android app bundle format uncompressed native libs may not extract from apk to filesystem. + In this case we should use lib name without path. + https://bugzilla.libsdl.org/show_bug.cgi?id=4739 + */ + const char* library_name = strrchr(library_file, '/'); + if(library_name && (*library_name) && (*(library_name + 1))) { + ++library_name; + library_handle = dlopen(library_name, RTLD_GLOBAL); + } + } + if (library_handle) { const char *function_name; SDL_main_func SDL_main;