2013年12月23日 星期一

Android 3.2+ Code (Inadvertently?) Preventing Write Access to External Storage


In the past, an app would request the “WRITE_EXTERNAL_STORAGE” permission, which would grant write access to all external storages (user/group “sdcard_rw“). This has apparently been changed to only grant write access to the primary external storage. A second permission has been introduced called “WRITE_MEDIA_STORAGE“, which would grant access to the other external storages (user/group “media_rw“).
The problem is, a third party will not actually be granted this permission, only system apps and apps provided by the device manufacturer will normally be granted this permission. There are exceptions, apparently on some devices third party apps will be granted this permission, but according to the AOSP sources, they’re certainly not supposed to.

Solution:
find /system/etc/permissions/platform.xml, and modify


<permission name=”android.permission.WRITE_EXTERNAL_STORAGE” >

     <group gid=”sdcard_rw” />

     <group gid=”media_rw” />

 </permission>
     

http://www.xda-developers.com/android/android-3-2-code-inadvertently-preventing-write-access-to-external-storage/

http://www.chainfire.eu/articles/113/Is_Google_blocking_apps_writing_to_SD_cards_/


platform.xml 在 frameworks\base\data\etc 下面