From 56dd338abdd2d499e08b90230289d028b9624c8f Mon Sep 17 00:00:00 2001 From: Roman Tarasov Date: Sun, 28 Jun 2026 16:49:30 +0300 Subject: [PATCH] Prefer fakelib2 over fakelib for game overlays Check app0/fakelib2 before resolving the legacy per-game fakelib source. Fall back to app0/fakelib when fakelib2 is missing or is not a directory. --- README.md | 2 +- config.ini.example | 2 +- src/sm_fakelib.c | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ba11131..7ad384e 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ Backport overlay behavior: - The `backports` folder is ignored during normal game scanning. - A backport is applied automatically to the matching mounted game from any configured scan path. - If multiple scan paths provide the same title backport, the game's own scan path wins; otherwise scan path order is used. -- If `/mnt/sandbox/_XXX/app0/fakelib` exists while the game is running, ShadowMount+ mounts it into that game's sandbox `common/lib`. +- If `/mnt/sandbox/_XXX/app0/fakelib2` exists while the game is running, ShadowMount+ mounts it into that game's sandbox `common/lib`; otherwise it falls back to `app0/fakelib`. - If `global_fakelib=1` and `global_fakelib_path` exists as a directory, ShadowMount+ also mounts that folder into the same sandbox `common/lib`. - When both global and per-game fakelib exist, the default gives the game's own `fakelib` priority by mounting `/data/shadowmount/fakelib` first and then the game-specific fakelib. - `global_fakelib_priority=global` reverses that priority. diff --git a/config.ini.example b/config.ini.example index 9ba6b62..919b40a 100644 --- a/config.ini.example +++ b/config.ini.example @@ -67,7 +67,7 @@ # ufs_backend=lvd # Sandbox fakelib backport watcher: -# 1/true/yes/on -> mount /mnt/sandbox/_XXX/app0/fakelib into common/lib +# 1/true/yes/on -> mount app0/fakelib2 when present, otherwise app0/fakelib, into common/lib # 0/false/no/off -> disable fakelib watcher # Default: 1 # backport_fakelib=1 diff --git a/src/sm_fakelib.c b/src/sm_fakelib.c index 5509825..0680e33 100644 --- a/src/sm_fakelib.c +++ b/src/sm_fakelib.c @@ -125,11 +125,17 @@ static bool resolve_sandbox_context(const char *title_id, return false; char source_path[MAX_PATH]; - snprintf(source_path, sizeof(source_path), "/mnt/sandbox/%s/app0/fakelib", + snprintf(source_path, sizeof(source_path), "/mnt/sandbox/%s/app0/fakelib2", sandbox_id); struct stat st; - if (stat(source_path, &st) == 0 && S_ISDIR(st.st_mode)) + if (stat(source_path, &st) == 0 && S_ISDIR(st.st_mode)) { (void)strlcpy(game_source_path, source_path, MAX_PATH); + } else { + snprintf(source_path, sizeof(source_path), "/mnt/sandbox/%s/app0/fakelib", + sandbox_id); + if (stat(source_path, &st) == 0 && S_ISDIR(st.st_mode)) + (void)strlcpy(game_source_path, source_path, MAX_PATH); + } char sandbox_root[MAX_PATH]; snprintf(sandbox_root, sizeof(sandbox_root), "/mnt/sandbox/%s", sandbox_id);