Kevin Gilbert
Kevin Gilbert

Reputation: 725

Android Marshmallow (rooted): How to read / write any file

I recently updated to Marshmallow (Cyanogmod CM13) and, due to the new permissions regime, a lot of my apps no longer work.

Note that these apps are not on the Play Store and are for my own personal use. So security is not much of a problem - I'll let my apps access whatever I want them to access.

The problem is how to achieve that.

I've tried doing a "su -c chmod" to modify the permissions but that does not work.

Other apps (eg Jota+) can browse to and write to a file. How do they do that? (Yes, I've tried searching but have not hit on the right search terms - if the answer is "out there".)

EDIT: The sdcard has been "adopted" and all relevant files transferred to it.

Upvotes: 2

Views: 3778

Answers (1)

David Heisnam
David Heisnam

Reputation: 2491

Edit platform.xml at /system/etc/permissions/platform.xml.

Find these lines

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

Change to

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

Now you'll be able to write to sdcard like in earlier Android versions.

You can also learn about the regular way to access external storage on lollipop and above How to use the new SD card access API presented for Android 5.0 (Lollipop)?

Upvotes: 2

Related Questions