Page 1 of 1

Android 5.1.1: permission to write to the SD Card?

Posted: 2015-11-06, 23:58 UTC
by Hawaiianlungs
My phone tablet automatically updates.

How do I get permission to write to the SD Card with TC?

I am sure this has been discussed but I gave searched and cannot get the answer.

Posted: 2015-11-07, 00:25 UTC
by Hacker
[mod]Moved to the Android forum.

Hacker (Moderator)[/mod]

Posted: 2015-11-09, 09:32 UTC
by ghisler(Author)
If you don't get the correct Android dialog to grant write rights, you need to install this beta version:
http://ghisler.ch/board/viewtopic.php?t=43021

Posted: 2016-10-10, 19:37 UTC
by Leinad
Hi guys,

I'm using A 5.1.1, TC 2.72 and an external sdcard which has two partitions (both FAT32). The first partition can be fully used by TC (read, write, access) but the second one has an issue: I cannot create or modify files, although I can create folders (and subfolders) or copy data from PC, from the internal card or from the 1st partition.

When I try to create or modify a file, I get that "write protected!" message and no matter what I select ("yes" or "no") there will be no next dialog. I've attached a screenshot of the "write protected!" message, maybe some of you could guide me what to do to solve this issue.

Image: http://i284.photobucket.com/albums/ll35/Alexino7/Screenshot_zpsim1fxvsr.png

LE: phone is rooted

Posted: 2016-10-12, 14:56 UTC
by ghisler(Author)
Is that a Huawei phone? The write method TC tries to use is broken in MIUI on Huawei phones and will not work.

But since you are rooted, you can use an SDFix tool to fix the sdcard permissions for all applications.

Posted: 2016-10-12, 16:43 UTC
by Leinad
No, it's a Samsung S3 Mini. I've looked for an appropriate SD Fix tool but no one seems to deal with the 2nd partition issues. The 1st partition has all the necessary permissions but the 2nd one doesn't. I don't know either what permission file to modify or what info to add to platform.xml. Do you have a specific recommendation of a SD Fix tool for me to try to fix the 2nd partition permissions?

Below is what my platform.xml looks like in regard to the external storage:

<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
____<group gid="sdcard_r" />
____<group gid="sdcard_rw" />
____<group gid="media_rw" />
</permission>

LE: the phone has OmniROM 5.1.1

Posted: 2016-10-12, 21:08 UTC
by ghisler(Author)
I think this is for the internal storage under /user/emulated/0

I have an S4 mini with sdfix applied, and it has these additional sections:

Code: Select all

    <permission name="android.permission.ACCESS_ALL_EXTERNAL_STORAGE">
        <group gid="sdcard_r"/>
        <group gid="sdcard_rw"/>
        <group gid="sdcard_all"/>
    </permission>

    <permission name="android.permission.WRITE_MEDIA_STORAGE">
        <group gid="media_rw"/>
    </permission>
To my knowledge, the second one is for the secondary storage.

Posted: 2016-10-12, 21:53 UTC
by Leinad
My platform.xml file also has those pieces of code but I didn't quote them in my previous post.

Code: Select all

  <permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
        <group gid="sdcard_r" />
        <group gid="sdcard_rw" />
        <group gid="media_rw" />
    </permission>

    <permission name="android.permission.ACCESS_ALL_EXTERNAL_STORAGE" >
        <group gid="sdcard_r" />
        <group gid="sdcard_rw" />
        <group gid="sdcard_all" />
        <group gid="media_rw" />
    </permission>

    <permission name="android.permission.WRITE_MEDIA_STORAGE" >
        <group gid="media_rw" />
    </permission>
So, the issue of not being able to create or modify a file on the 2nd partition of the external sdcard is due to something else, maybe another permission is missing. Does your S4 mini runs on 5.1.1 also? What sdfix did you apply?

Posted: 2016-10-14, 16:14 UTC
by ghisler(Author)
No, my S4 mini runs on 4.4.4. Normally "media_rw" is restricted to the system. "sdcard_rw" and "sdcard_r" are the ones given to the user.

Try putting
<group gid="sdcard_r" />
<group gid="sdcard_rw" />
<group gid="sdcard_all" />
in the last section too, then restart.

Posted: 2016-10-14, 18:46 UTC
by Leinad
I've added those code lines you've mentioned, restarted the phone but still can't create or modify a file on the 2nd partition.

Code: Select all

    <permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
        <group gid="sdcard_r" />
        <group gid="sdcard_rw" />
        <group gid="media_rw" />
    </permission>

    <permission name="android.permission.ACCESS_ALL_EXTERNAL_STORAGE" >
        <group gid="sdcard_r" />
        <group gid="sdcard_rw" />
        <group gid="sdcard_all" />
        <group gid="media_rw" />
    </permission>

    <permission name="android.permission.WRITE_MEDIA_STORAGE" >
        <group gid="sdcard_r" />
        <group gid="sdcard_rw" />
        <group gid="sdcard_all" />
        <group gid="media_rw" />
    </permission>

Posted: 2016-10-17, 13:02 UTC
by ghisler(Author)
Unfortunately I don't know what else could be done. Maybe someone on http://forum.xda-developers.com could help you.

Posted: 2016-10-19, 13:09 UTC
by Leinad
Thanks for your reply. I believe it's a lollipop issue but I asked here thinking maybe someone bumped it before me and got an answer.

Off-topic: I wanted to give you a reply two days ago but i couldn't log in to the forum, neither with my home PC nor my android phone. Today I've deleted ghishler.ch cookies on my home PC and was able to log in. Afterwards, I've deleted those cookies on my phone and was able to log in using my phone, also. So, it might be a possibility that there is an issue with ghishler.ch cookies. :D