嵌入式爱好者

3568Android11第三方app操作U盘

2024-2-29 11:26| 发布者: forqs| 查看: 145| 评论: 0

类目: RK3568系列产品  >  Android     文档编号: 1321

一、首先需要app的AndroidManifest.xml中添加如下请求读取和写入外部存储的权限:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
二、修改源码使WRITE_EXTERNAL_STORAGE和READ_EXTERNAL_STORAGE映射到 media_rw 用户组:
diff --git a/frameworks/base/data/etc/platform.xml b/frameworks/base/data/etc/platform.xml
index 76247c2d7a..2246d70a13 100644
--- a/frameworks/base/data/etc/platform.xml
+++ b/frameworks/base/data/etc/platform.xml
@@ -131,8 +131,12 @@
          is negligible (one tag with the permission) compared to
          the fragility as one can remove a built-in permission which
          no longer needs to be mapped to gids and break grant propagation. -->
-    <permission name="android.permission.READ_EXTERNAL_STORAGE" />
-    <permission name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <permission name="android.permission.READ_EXTERNAL_STORAGE" >
+    <group gid="media_rw" />
+    </permission>
+    <permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
+    <group gid="media_rw" />
+    </permission>
 
     <!-- ================================================================== -->
     <!-- ================================================================== -->
三、全编译烧写测试验证即可。


已解决

未解决

只是看看

最新评论

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-11-22 09:33

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

返回顶部