[Bug]: RetroArch launch fails (black screen) on non-default user profiles due to hardcoded user ID paths in cocoon_db and launcher URI expansion
#235
Replies: 2 comments 9 replies
|
Hi @f1nlay, thanks for reporting this here, I found out that my original report doesn't exist anymore. I've been using Daijishō as a fallback, but it would be great to have this fixed in Cocoon Shell. |
|
As this bug has been bothering me a bit, I've whipped up a patcher which fixes this issue by decompiling the APK and replacing the hard-coded paths with the correct, user-scoped paths: https://github.com/f1nlay/cocoonfe-multiuser. You can patch it yourself, or download a prebuilt APK from: https://github.com/f1nlay/cocoonfe-multiuser/releases Note that this is just a quick prototype and as such, the code is heavily AI assisted. Ideally this should still be fixed upstream with much better, human-written code. I've been testing it on my device and haven't noticed any issues thus far, but please beware that this may be unstable and that you should absolutely back up your existing Cocoon data using the settings menu before installing the patched APK. (Paging @DaniPhii as you may be interested in testing) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Cocoon version
Beta 3.06
Device and Android version
AYN Thor, Android 13
What does this relate to?
Crash or freeze, Emulator or game launching
What happened?
When running Cocoon within a non-default user profile (e.g., a work profile created via Shelter or native Android multi-user features), attempting to launch games through RetroArch fails, resulting in a black screen.
This issue is critical and severely limits Cocoon's usability for multi-user setups.
From what I can tell, the issue appears to be two-fold:
The default launcher arguments stored in the
amStartArgumentscolumn of the players table incocoon_dbexplicitly hardcode the default user profile ID (0) across multiple path arguments (e.g.,-e CONFIGFILE,-e SDCARD,-e EXTERNAL).Manually patching
cocoon_dbto replace/storage/emulated/0/with the correct profile path (e.g.,/storage/emulated/10/) does not resolve the issue. Cocoon’s launcher code appears to internally resolve/expand{file.path}from SAF-formatted URIs directly into/storage/emulated/0/at launch time regardless of the active profile context.Cocoon should dynamically detect the current Android user ID at runtime, replacing both template variables in
amStartArgumentsand SAF path resolutions with the active profile's storage directory (perhaps using something like/storage/emulated/{user_id}/).Steps to reproduce
Set up a secondary user profile (e.g., using Shelter on AYN Thor).
Install Cocoon into the secondary profile and set up a player (e.g., RetroArch).
Attempt to launch a game using RetroArch.
Observe that RetroArch launches to a black screen and fails to respond.
How often does it happen?
The issue occurs every time a secondary user profile attempts to launch a game through Cocoon that uses the RetroArch emulator.
Additional context
The same bug is currently present in iiSU, though in that case it can be resolved through modification of
emuladores.json: RetroArch launch fails (black screen) for non-default user profiles due to hardcoded user ID inCONFIGFILEpath iisu-network/iiSU#432This issue was previously reported a few months ago by a different user on https://feedback.cocoon-shell.com/p/launching-games-using-retro-arch-doesn-t-work-for-android-secondary-users.
Additionally, there appear to be separate issues with themes loading incorrectly on external profiles that require further investigation.
Before submitting
All reactions