【Android O】 Service AAA does not have a SELinux domain defined
在init.AAA.rc里面添加了一个脚本启动的服务:
service AAA /vendor/bin/sh /vendor/etc/AAA_spec.sh
user root
group root
disabled
oneshot
on post-fs-data
start AAA
在系统启动时通过dmesg | grep init查看发现出现:Service AAA does not have a SELinux domain defined
解决方法:
1.在devices/vendorxxx/sepolicy/common/目录下新增AAA.te文件,内容如下:
type AAA, domain;
type AAA_exec, exec_type, vendor_file_type,file_type;
init_daemon_domain(AAA)
allow AAA vendor_shell_exec:file { entrypoint };
2.在devices/vendorxxx/sepolicy/Android.mk文件中添加:
BOARD_SEPOLICY_DIRS += devices/vendorxxx/sepolicy/common/
3.在devices/vendorxxx/sepolicy/common/file_contexts中添加:
##add for AAA file permission##
/(vendor|system/vendor)/etc/AAA_spec\.sh u:object_r:AAA_exec:s0
4.在init.AAA.rc里面对应的service里面添加:
service AAA /vendor/bin/sh /vendor/etc/AAA_spec.sh
user root
group root
disabled
oneshot
seclabel u:r:carrier_switcher:s0
5.编译并烧录bootimage,若编译报错注意解决neverallow冲突
6.系统起来时如发现avc则逐一添加allow策略语句
补充:
在Android P上创建hal服务还需要在te文件中添加如下两行:
hwbinder_use(hal_XXXX)
get_prop(hal_XXXX, hwservicemanager_prop)
最新文章
- 跟vczh看实例学编译原理——一:Tinymoe的设计哲学
- 物料分类账 [COML] PART 1 - 概览
- WebForm之Linq组合查询
- BUAA 724 晴天小猪的神题(RMQ线段树)
- kuangbin RMQ
- 使用Gson解析复杂的json数据
- 锁之“重量级锁”Synchronized
- Entity Framework的事务提交
- ubutun下安装jenkins
- RPC远程过程调用机制底层原理
- 不使用模板导出Excel(C#版本)
- 只要发生ajax请求时加载旋转的按钮
- mac php7.0~7.2 memcache安装
- 将input或textarea设置为disabled的样式问题
- [20171220]toad plsql显示整形的bug.txt
- 1:python 简介与基础
- !!! no internal routing support, rebuild with pcre support !!!
- 实现AJAX的基本步骤
- shell 脚本启动tomcat服务
- Vue.js2 + Laravel5 采用 CORS 方式解决 AJAX 跨域的问题
热门文章
- vue2.x 在引用插件的时候,npm run dev跑正常 ,npm run build 报错vue-cli Unexpected token: punc (() [
- 轨迹系列5——验证轨迹GPS坐标转换为本地坐标的四/七参数是否准确的一种方案
- Linux系统性能分析工具 sar--系统活动情况报告
- CPP内存检测
- 章节十、1-用ID和XPath、name定位元素
- Python使用Plotly绘图工具,绘制水平条形图
- iOS 防止UIButton重复点击
- MySql 学习之路-高级1
- 【笔记】基于Python的数字图像处理
- java格式化