Android9.0(MT8168)1.修改sdcard写权限 2.init.rc中创建软链接

1.修改sdcard写权限

2.init.rc中创建软链接

diff --git a/system/core/rootdir/init.rc b/system/core/rootdir/init.rc
index 6c2e301..251a68b 100755
--- a/system/core/rootdir/init.rc
+++ b/system/core/rootdir/init.rc
@@ -61,6 +61,11 @@ on init
     mkdir /dev/stune/background
     mkdir /dev/stune/top-app
     mkdir /dev/stune/rt
+    mkdir /dev/block/platform 0777 root root
+    mkdir /dev/block/platform/mtk-msdc.0 0777 root root
+    mkdir /dev/block/platform/mtk-msdc.0/11230000.MSDC0 0777 root root 
+    symlink /dev/block/by-name /dev/block/platform/mtk-msdc.0/11230000.MSDC0/by-name
+
     chown system system /dev/stune
     chown system system /dev/stune/foreground
     chown system system /dev/stune/background
@@ -87,7 +92,7 @@ on init
     mkdir /mnt/secure/asec 0700 root root
     mkdir /mnt/asec 0755 root system
     mkdir /mnt/obb 0755 root system
-    mkdir /mnt/media_rw 0750 root media_rw
+    mkdir /mnt/media_rw 0777 root media_rw
     mkdir /mnt/user 0755 root root
     mkdir /mnt/user/0 0755 root root
     mkdir /mnt/expand 0771 system system
diff --git a/system/vold/model/PublicVolume.cpp b/system/vold/model/PublicVolume.cpp
index fc7e96f..8551ed1 100644
--- a/system/vold/model/PublicVolume.cpp
+++ b/system/vold/model/PublicVolume.cpp
@@ -136,13 +136,13 @@ status_t PublicVolume::doMount() {
     }
 
     if (mFsType == "vfat") {
-        if (vfat::Mount(mDevPath, mRawPath, false, false, false, AID_MEDIA_RW, AID_MEDIA_RW, 0007,
+        if (vfat::Mount(mDevPath, mRawPath, false, false, false, AID_MEDIA_RW, AID_MEDIA_RW, 0000,
                         true)) {
             PLOG(ERROR) << getId() << " failed to mount " << mDevPath;
             return -EIO;
         }
     } else if (mFsType == "exfat") {
-        if (exfat::Mount(mDevPath, mRawPath, AID_MEDIA_RW, AID_MEDIA_RW, 0007)) {
+        if (exfat::Mount(mDevPath, mRawPath, AID_MEDIA_RW, AID_MEDIA_RW, 0000)) {
             PLOG(ERROR) << getId() << " failed to mount " << mDevPath;
             return -EIO;
         }
@@ -183,6 +183,7 @@ status_t PublicVolume::doMount() {
                     "-u", "1023", // AID_MEDIA_RW
                     "-g", "1023", // AID_MEDIA_RW
                     "-U", std::to_string(getMountUserId()).c_str(),
+                    "-w",
                     mRawPath.c_str(),
                     stableName.c_str(),
                     NULL)) {

 

你可能感兴趣的:(Android系统)