Solve the problem of Android 5.1 restricting the write permission of external SD card

  • 2021-09-24 23:39:14
  • OfStack

It is described in the "External Storage Technology Information" document on the Android developer website:

WRITE_EXTERNAL_STORAGE grants write permission only to the primary external storage on the device, and the application cannot write data to the Level 2 external storage device unless the comprehensive permission specifies the package directory of the application. At present, this only affects dual storage devices. If your device has internal storage space, which is commonly called body storage, then your SD card is a Level 2 external storage device.

In Android 4.4, if you use both body storage and an SD card, applications will not be able to create, modify, or delete data in an SD card. For example, you can't download and save Mp3 to an external memory card using Cool Me Music Box, and you can't download and save TXT novels to an external memory card using Fast Read Free Novels. But should

The program can still write data to any directory in the main storage (body storage) without any restriction. Google states that the purpose of this is that by limiting in this way, the system can clear legacy files after the application is uninstalled.

The cracking method is actually very simple, that is, to add the write permission of the external memory card. The premise is that the mobile phone must be Root.

Steps:

1. The R. E manager is mounted to read and write. Open the/system/etc/permissions directory, find the platform. xml file, check it, and then select "Open in Text Editor" in the menu

2. Find the code:


<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
     <group gid="sdcard_r" />        ( This line of code has some models or rom No ,  What is not is negligible )
     <group gid="sdcard_rw" />
    </permission>

Replace it with:


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

(Note: paragraph header alignment, "media_rw" and/ > There is a space between. Or you can copy the last 1 lines of code for modification. ) Then save to exit.

3. Restart the mobile phone after completing the above two steps, and you will find that you can create, modify and delete data from the external memory card (SD card).


Related articles: