Storage permissions problems

This topic contains 5 replies, has 3 voices, and was last updated by admin admin 4 months, 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #5387

    xarx
    Participant

    I’ve added an SD-card to my Samsung T580 tablet (Android 7.0), and re-installed MagicBox. I’ve moved the MagicBox directory and the DOS-games files to the SD-card, and now I have a problem – I am unable to make DosBox work with the SD-card.

    In the General Settings, when I set DataDirectory to “/storage/ABCD-EFGH/Games/MagicBox/”, DosBox wants to be restarted, and after restart, the DataDirectory is reset to “/storage/emulated/0/.MagicBox/”.

    In the ManualStorageSetup, I have set a games directory to “/storage/ABCD-EFGH/Games/DOS”. I am unable to make DosBox to detect this directory as read-write.
    When I press RequestPermissions for “/storage/ABCD-EFGH”, DetectStorages shows:

    • /storage/ABCD-EFGH/ – full access
    • /storage/emulated/0 – full access
    • /storage/ABCD-EFGH/Games/DOS – read-only access

    When I press RequestPermissions for “/storage/ABCD-EFGH/Games”, DetectStorages shows:

    • /storage/ABCD-EFGH/Games – full access
    • /storage/emulated/0 – full access
    • /storage/ABCD-EFGH/Games/DOS – read-only access
    • /storage/ABCD-EFGH – read-only access

    I don’t even know whether the RequestPermissions does do anything, because it doesn’t show the usual Android dialog for requesting write permissions to the SD-card. Ideally, I want MagicBox to have read-write permissions for “/storage/ABCD-EFGH/Games/”, and read-only permissions to “/storage/ABCD-EFGH/”.

    Do I do anything wrong?

    Edit: The MagicDosboxConfiguration.xml contains this:

    <?xml version='1.0' encoding='utf-8' standalone='yes' ?>
    <map>
        <string name="datadirectoryprivate">0</string>
        <string name="datadirectory">/storage/emulated/0/.MagicBox/</string>
        <string name="sdcarduri">content://com.android.externalstorage.documents/tree/ABCD-EFGH%3AGames</string>
        <string name="welcomeScreen">3</string>
    </map>
    #5388
    admin
    admin
    Keymaster

    You are right, there is one bug. You must leave .MagicBox on storage which is read-write for all apps (for example internal storage or sdcard after applying sdcard fix on rooted device).

    I fixed sdcard write access only for running game, no for data directory.

    Now you can place dos games to sdcard, for example to games/dos and request permissions. This will work.

    #5947

    xarx
    Participant

    Hello, any progress in this issue?

    I’ve bought a new mobile phone, installed an SD-card and moved MagicBox directories to the SD-card. Then – in General Settings – I requested permissions to the whole SD-card. At last, I set Data Directory to “/storage/ABCD-EFGH/Games/MagicBox/”, DosBox wants to be restarted, and after restart, the DataDirectory is reset to “/storage/emulated/0/.MagicBox/”.

    #5948
    admin
    admin
    Keymaster

    Hello,

    I dont like to say it, but no 🙁 I am busy with other things. But thesw settings are small, they should not take so much space. I know that better is to store them on sdcard, but I still did not find time for that…

    #6044

    Larrynho
    Participant

    Ive just updated my s7 exynos to Android 8.0… so if I understand well , I can move my DOS folder from the internal memory to my 200gb SD card, so in the end I have a folder in the internal memory thats /storage/emulated/0/DOS/.MagicBox that has the MDB configs and backups; and one folder in my external SD thats /storage/9016-4EF8/DOS that has all my dos programs and games, and it will have full Reading/writing permissions , so my programs wont crash and MDB can write on that folder and subfolders right?

    My dos folder is growing a lot and Id rather have it on external SD :p

    #6045
    admin
    admin
    Keymaster

    Shortly : yes

    But, best is if you can temporarily root device and apply sdcard fix from google play store. Then unroot.

    Another best way is to store iso, img, bin and cue files on sdcard and installation files on internal storage. These files dont need write access.

    Since Kitkat google blocks writing to sdcard. In lollipop they added support (SAF – Storage access framework) for writing to sdcard, but honestly…this the worst, slowest, buggiest and incomplete framework for working with files what I ever seen. Files are not accessed directly, but each write attempt is verified against security. Several standard c++ function were not implemented in SAF and was necessary to write slow emulated version.

    Edit : And to original question of previous author. I work on feature which allows to save mDosbox configs to sdcard. Now I am stuck on saving save states to sdcard. But I think this year it can be done 🙂

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.