简体   繁体   中英

Android external storage permission

Recently updated my honor 4c to the latest firware and link2sd stopped working. It gives every time Read only error. So I looked in some forums and found possible solution but can't use it. So the thing is to change android /etc/permissions/platfrom.xml file and change

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

to

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

But I tried that with adb pull and get error

failed to copy 'platform.xml' to '/etc/permissions/platform.xml': Read-only file system
734 KB/s (7390 bytes in 0.009s)

Phone is rooted.

How can I do that?? Please help.

For anyone using Stock ROMs, root is not sufficient to access the platform.xml file. You will need the added step to copy the file to the external storage, and then copy it out.

Here are the steps:

$ adb shell
$ su
$ mount -o rw,remount /system
$ cp /etc/permissions/platform.xml /sdcard/
# <replace 'sdcard' with your external directory path>

After this, you can use adb push and adb pull with the platform.xml in the external directory. If you logout of the shell, you will need to repeat the mount command everytime you need to read or write the platform.xml file.

Alternatively, you can install BusyBox and edit the file on device itself.

$ adb shell
$ su
$ mount -o rw,remount /system
$ busybox vi /etc/permissions/platform.xml

You have to use Read and Write run time permission for storage. check developers or click

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM