Compare commits

...

3 Commits

Author SHA1 Message Date
Evgeny Poberezkin
89b44729e2 Merge branch 'master' into av/android-older-than-9 2023-11-27 22:42:41 +00:00
Evgeny Poberezkin
df1ee62184 Merge branch 'master' into av/android-older-than-9 2023-11-27 18:36:34 +00:00
Avently
0d2f52469c android: prevent UnsatisfiedLinkError on Android <9 2023-11-08 04:07:04 +07:00
4 changed files with 32 additions and 2 deletions

View File

@@ -63,8 +63,11 @@ fun initHaskell() {
}
}
System.loadLibrary("app-lib")
try {
System.loadLibrary("app-lib")
} catch (e: UnsatisfiedLinkError) {
System.loadLibrary("apppatched-lib")
}
s.acquire()
pipeStdOutToSocket(socketName)

View File

@@ -23,6 +23,15 @@ add_library( # Sets the name of the library.
# Provides a relative path to your source file(s).
simplex-api.c)
add_library( # Sets the name of the library.
apppatched-lib
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
patch.c simplex-api.c)
# Searches for a specified prebuilt library and stores the path as a
# variable. Because CMake includes system libraries in the search path by
# default, you only need to specify the name of the public NDK library
@@ -65,3 +74,13 @@ target_link_libraries( # Specifies the target library.
# Links the target library to the log library
# included in the NDK.
${log-lib})
target_link_libraries( # Specifies the target library.
apppatched-lib
simplex support
# Links the target library to the log library
# included in the NDK.
${log-lib})

View File

@@ -0,0 +1,6 @@
#include <stdint.h>
extern int getentropy(void* __buffer, size_t __buffer_size)
{
return 1;
}

View File

@@ -19,6 +19,8 @@ extern void __strcat_chk_generic(void){};
extern void __libc_globals(void){};
extern void __rel_iplt_start(void){};
int getentropy(void* __buffer, size_t __buffer_size);
// Android 9 only, not 13
extern void reallocarray(void){};