From c01271f6afacddde68f18c73367323c2571a3a8e Mon Sep 17 00:00:00 2001 From: GameNative Support Bot Date: Sun, 25 Oct 2026 17:57:36 +0000 Subject: [PATCH] Fix Gamescope startup on Samsung Android 16 --- .../components/BionicProgramLauncherComponent.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/com/winlator/xenvironment/components/BionicProgramLauncherComponent.java b/app/src/main/java/com/winlator/xenvironment/components/BionicProgramLauncherComponent.java index 17e251d7fb..bfafeaefea 100644 --- a/app/src/main/java/com/winlator/xenvironment/components/BionicProgramLauncherComponent.java +++ b/app/src/main/java/com/winlator/xenvironment/components/BionicProgramLauncherComponent.java @@ -514,7 +514,17 @@ private void applyGamescopeEnv(Context context, EnvVars envVars, File rootDir) { envVars.put("LD_PRELOAD", preload.isEmpty() ? gsDir + "/lib/libgndrm_shim.so" : preload + ":" + gsDir + "/lib/libgndrm_shim.so"); + // The DRM shim pulls in Android's libandroid.so. On Samsung that reaches the + // system libsqlite.so, which must bind to the matching BoringSSL libcrypto + // instead of the OpenSSL copy in the imagefs. String gamescopeLibPath = gsDir + "/lib"; + File systemCrypto = new File("/system/lib64/libcrypto.so"); + if (systemCrypto.exists()) { + File systemLibDir = new File(context.getFilesDir(), "gamescope_system_libs"); + systemLibDir.mkdirs(); + FileUtils.symlink(systemCrypto, new File(systemLibDir, "libcrypto.so")); + gamescopeLibPath = systemLibDir.getPath() + ":" + gamescopeLibPath; + } String libPath = envVars.get("LD_LIBRARY_PATH"); envVars.put("LD_LIBRARY_PATH", libPath.isEmpty() ? gamescopeLibPath : gamescopeLibPath + ":" + libPath); // gamescope execvp's gamescopereaper and wlroots spawns xkbcomp.