Dolphin, the GameCube and Wii emulator - Forums

Full Version: Scoped storage issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
(11-03-2021, 12:57 AM)JosJuice Wrote: [ -> ]If that is in the CDD, that must be applying just to the Android directory itself and not its subdirectories, right? Because the vast majority of people that I've seen have been able to move files to Android/data/org.dolphinemu-dolphinemu/files using either USB or the X-plore app.

If it does apply to its subdirectories... Well, clearly that can't be universally true, because Dolphin is able to write to the subdirectory that's dedicated to it. Could you point me to the right section of the CDD?

In my specific case, I can move files/folders into Android/data/org.dolphinemu.dolphinemu/ through AOSP Files or USB, but not into Android/data/org.dolphinemu.dolphinemu/files/. Only Dolphin itself can write inside Android/data/org.dolphinemu.dolphinemu/files/, on my phone. Trying to move a "files" folder into Android/data/org.dolphinemu.dolphinemu/ to overwrite the one that's already there (or merge with it) doesn't work on my end. It creates a files(1) folder if done through AOSP Files or outright fails through USB.

EDIT: On another note, PPSSPP seemingly managed to implement scoped storage while maintaining compatibility with an external folder. Maybe hrydgard has some insight regarding this that could be adapted to Dolphin? https://github.com/hrydgard/ppsspp/pull/14619
(11-03-2021, 04:02 AM)Shady Guy Jose Wrote: [ -> ]In my specific case, I can move files/folders into Android/data/org.dolphinemu.dolphinemu/ through AOSP Files or USB, but not into Android/data/org.dolphinemu.dolphinemu/files/. Only Dolphin itself can write inside Android/data/org.dolphinemu.dolphinemu/files/, on my phone. Trying to move a "files" folder into Android/data/org.dolphinemu.dolphinemu/ to overwrite the one that's already there (or merge with it) doesn't work on my end. It creates a files(1) folder if done through AOSP Files or outright fails through USB.

So copying a folder into the files folder fails, and copying a files folder into org.dolphinemu.dolphinemu also fails? Or did you only test the latter?

(11-03-2021, 04:02 AM)Shady Guy Jose Wrote: [ -> ]EDIT: On another note, PPSSPP seemingly managed to implement scoped storage while maintaining compatibility with an external folder. Maybe hrydgard has some insight regarding this that could be adapted to Dolphin? https://github.com/hrydgard/ppsspp/pull/14619

It wouldn't be impossible to implement this for Dolphin, but it would take some effort, and most importantly: It would cause a big reduction in file I/O operations like listing the files in a folder. This would have a huge impact on certain Dolphin features such as loading custom textures (maybe you can do without this) or using the Wii NAND (this one you can't do without, since all Wii games use it for saving your progress!)
(11-03-2021, 05:40 AM)JosJuice Wrote: [ -> ]So copying a folder into the files folder fails, and copying a files folder into org.dolphinemu.dolphinemu also fails? Or did you only test the latter?


It wouldn't be impossible to implement this for Dolphin, but it would take some effort, and most importantly: It would cause a big reduction in file I/O operations like listing the files in a folder. This would have a huge impact on certain Dolphin features such as loading custom textures (maybe you can do without this) or using the Wii NAND (this one you can't do without, since all Wii games use it for saving your progress!)

Both of those failed
(11-03-2021, 12:57 AM)JosJuice Wrote: [ -> ]If that is in the CDD, that must be applying just to the Android directory itself and not its subdirectories, right? Because the vast majority of people that I've seen have been able to move files to Android/data/org.dolphinemu-dolphinemu/files using either USB or the X-plore app.

If it does apply to its subdirectories... Well, clearly that can't be universally true, because Dolphin is able to write to the subdirectory that's dedicated to it. Could you point me to the right section of the CDD?

https://source.android.com/devices/storage/scoped

Key bullet point “ No read or write access to other apps' external app data directories” which should refer to /sdcard as the “internal” location is under the /data directory instead. On my S10e for instance I cannot see into that directory. Tried the default file manager and FX explorer and get access denied.
(11-03-2021, 11:51 AM)Nintonito Wrote: [ -> ]https://source.android.com/devices/storage/scoped

Key bullet point “ No read or write access to other apps' external app data directories” which should refer to /sdcard as the “internal” location is under the /data directory instead. On my S10e for instance I cannot see into that directory. Tried the default file manager and FX explorer and get access denied.

But this only applies to "Apps using scoped storage". Connecting your device to a PC using USB is not an app.
(11-03-2021, 05:12 PM)JosJuice Wrote: [ -> ]But this only applies to "Apps using scoped storage". Connecting your device to a PC using USB is not an app.

Did some more testing. All of these are through USB (hence the backslashes, I'm using Windows):
  • Copying a single file into Android\data\org.dolphinemu.dolphinemu — SUCCESS
  • Copying a single file into Android\data\org.dolphinemu.dolphinemu\files or Android\data\org.dolphinemu.dolphinemu\cache — SUCCESS
  • Copying a single file into Android\data\org.dolphinemu.dolphinemu\cache\GameCovers or any existing subfolder of Android\data\org.dolphinemu.dolphinemu\files — FAIL
  • Merging a "cache" or "files" folder into Android\data\org.dolphinemu.dolphinemu — FAIL
  • Merging a "GameCovers" folder into Android\data\org.dolphinemu.dolphinemu\cache or an existing subfolder, say, "Shaders", into Android\data\org.dolphinemu.dolphinemu\files — FAIL
  • Creating a new folder (named "New") inside Android\data\org.dolphinemu.dolphinemu\cache or Android\data\org.dolphinemu.dolphinemu\files — SUCCESS
  • Copying a single file into Android\data\org.dolphinemu.dolphinemu\files\New — SUCCESS
  • Creating a new folder inside a higher-level directory, such as a "Card A" folder inside Android\data\org.dolphinemu.dolphinemu\files\GC\USA — FAIL
Apparently, only the existing contents of Android\data\org.dolphinemu.dolphinemu\cache or Android\data\org.dolphinemu.dolphinemu\files are write-protected.
Hmm, so it only affects existing files... This is starting to make more sense now.

Would it be possible for you to use adb shell on your PC to run the following two commands and report the results back to me?

cd /storage/emulated/0/Android/data/org.dolphinemu.dolphinemu/files/Config
ls -l
(11-04-2021, 07:16 AM)JosJuice Wrote: [ -> ]Hmm, so it only affects existing files... This is starting to make more sense now.

Would it be possible for you to use adb shell on your PC to run the following two commands and report the results back to me?

cd /storage/emulated/0/Android/data/org.dolphinemu.dolphinemu/files/Config
ls -l

Not only existing files. Existing folders are write-protected, regardless of whether I'm overwriting existing files or not (as in I can't copy a new file into, say, the GC/USA/Card A folder to restore savegames). As for the ADB command, I get this:

total 31

-rw-rw---- 1 u0_a449 ext_data_rw     0 2021-11-02 01:51 DSUClient.ini
-rw-rw---- 1 u0_a449 ext_data_rw     0 2021-11-02 01:51 Debugger.ini
-rw-rw---- 1 u0_a449 ext_data_rw    88 2021-11-02 01:51 Dolphin.ini
-rw-rw---- 1 u0_a449 ext_data_rw     0 2021-11-02 01:51 FreeLook.ini
-rw-rw---- 1 u0_a449 ext_data_rw     0 2021-11-02 01:51 GCKeyNew.ini
-rw-rw---- 1 u0_a449 ext_data_rw  2608 2021-11-02 01:51 GCPadNew.ini
-rw-rw---- 1 u0_a449 ext_data_rw     0 2021-11-02 01:51 GFX.ini
-rw-rw---- 1 u0_a449 ext_data_rw     0 2021-11-02 01:51 Logger.ini
drwxrws--- 3 u0_a449 ext_data_rw  3452 2021-11-01 19:31 Profiles
-rw-rw---- 1 u0_a449 ext_data_rw 18374 2021-11-02 01:51 WiimoteNew.ini

If I'm reading this correctly, it says all files should have both read and write permissions. But, when I try to overwrite GFX.ini with my own, it fails (I had a custom shader configuration since before the option was exposed, so I still have the custom ini, although I know I can probably recreate it with the GUI now as long as I can get my glsl file in files/Shaders).

In one of the file managers I use (Amaze), permissions are exposed, however, and this is what I get (note the difference between the contents of the /com.dolphinemu.dolphinemu folder and the /com.dolphinemu.dolphinemu/files folder):
[attachment=19881]
[attachment=19882]
So the permissions shown by ls -l don't explain why the files and folders would be read-only at all... I wonder how Amaze is determining those permissions it's showing.
(11-04-2021, 09:34 PM)JosJuice Wrote: [ -> ]So the permissions shown by ls -l don't explain why the files and folders would be read-only at all... I wonder how Amaze is determining those permissions it's showing.

It gets even weirder when we consider the fact that USB file transfers match what's shown by Amaze, and not the adb shell output
Pages: 1 2 3 4 5