From fdd6b29f31adeeb2e59bc04c85f06c684b8705ed Mon Sep 17 00:00:00 2001 From: tomikun <60690056+alexytomi@users.noreply.github.com> Date: Fri, 31 Jul 2026 15:09:50 +0800 Subject: [PATCH] change: Print out all SDL_Init errors to log --- app_pojavlauncher/src/main/jni/native_hooks/sdl_hook.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app_pojavlauncher/src/main/jni/native_hooks/sdl_hook.c b/app_pojavlauncher/src/main/jni/native_hooks/sdl_hook.c index 42a09ced3..db3b5eb81 100644 --- a/app_pojavlauncher/src/main/jni/native_hooks/sdl_hook.c +++ b/app_pojavlauncher/src/main/jni/native_hooks/sdl_hook.c @@ -14,6 +14,7 @@ DECL_DLSYM(SDL_InitSubSystem) DECL_DLSYM(SDL_SetHint); DECL_DLSYM(SDL_SetTextInputArea); DECL_DLSYM(SDL_SetError); +DECL_DLSYM(SDL_GetError); static bool custom_SDL_InitSubSystem_Func(SDL_InitFlags flags) { @@ -43,6 +44,10 @@ static bool custom_SDL_InitSubSystem_Func(SDL_InitFlags flags) { // Call original func after doing all the needed setup bool r = BYTEHOOK_CALL_PREV(custom_SDL_InitSubSystem_Func, SDL_InitSubSystem_t, flags); + if (!r){ + SET_DLSYM_PTR(dlopen("libSDL3.so", RTLD_NOLOAD), SDL_GetError); + LOGI("Amethyst-Android: SDL_InitSubsystem Error: %s", SDL_GetError_p()) + } BYTEHOOK_POP_STACK(); return r; }