当前位置:   article > 正文

Android seLinux 设置

android selinux sdcardfs:dir

在android O上添加服务。在访问一些路径的时出现了权限的问题,将seLinux关闭之后运行成功。所以需要设置相关的权限。

参考文档:

http://blog.csdn.net/tung214/article/details/72734086

主要查看dmsg中关于avc的错误,根据对应的错误在对应的文件中添加权限。

关于权限的文件位于device/xxxx/sepolicy/common目录中。

例如init.te

  1. allow init oemfs:dir { mounton };
  2. #honeywell license check
  3. allow init counter_sysfs:file rw_file_perms;
  4. allow init fuse:dir { search mounton };
  5. allow init self:capability sys_module;
  6. allow init {
  7. adsprpcd_file
  8. cache_file
  9. persist_file
  10. storage_file
  11. }:dir mounton;
  12. #Allow init to mount non-hlos partitions in A/B builds
  13. allow init media_rw_data_file:dir { mounton };
  14. allow init unlabeled:dir { mounton };
  15. allow init oemfs:dir { mounton };
  16. allow sdcardd sdcardfs:dir { mounton };

log里面如果出现Service xxx does not have a SELinux domain defined,还需要添加domain,否则也是编译不过的。添加方法

http://blog.csdn.net/jianchi88/article/details/78417202

Tony Liu

2018-3-6

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/喵喵爱编程/article/detail/961981
推荐阅读
相关标签
  

闽ICP备14008679号