全志A64 android6.0系統允許第三方應用讀寫U盤外接sd卡修改
阿新 • • 發佈:2019-02-17
frameworks/base/data/etc/platform.xml中新增如下修改
<permission name="android.permission.READ_EXTERNAL_STORAGE" >
<group gid="media_rw" />
</permission>
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="media_rw" />
<group gid="sdcard_rw" />
</permission>
<permission name="android.permission.READ_EXTERNAL_STORAGE" >
<group gid="media_rw" />
</permission>
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="media_rw" />
<group gid="sdcard_rw" />
</permission>
system/vold/PublicVolume.cpp修改如下程式碼
if (vfat::Mount(mDevPath, mRawPath, false, false, false,
- AID_MEDIA_RW, AID_MEDIA_RW, 0007, true)) {
+ AID_MEDIA_RW, AID_MEDIA_RW, 0001, true)) {
PLOG(ERROR) << getId() << " failed to mount " << mDevPath;
return -EIO;
}
0007是許可權的掩碼,意思是把r w x的許可權都遮蔽了,001是隻遮蔽x許可權。