标签:
一、SElinux在Android 8.0后的差异:
从Android 4.4到Android 7.0的SELinux策略构建方式合并了所有sepolicy片段(平台和非平台),然后在根目录生成单一文件,而Android 8.0开始关于selinux架构也类似于HIDL想把系统平台的selinux策略和厂商自己维护的策略剥离开来, 允许合作伙伴单独自己的策略,构建他们的镜像(.img)引导,这样便可以独立于平台更新这些.img,反之亦然(即:在不更新合作伙伴jiang'xaing像的情况下执行平台更新)。
二、修改示例:
以下便通过修改xxx系统服务的selinux权限作为例子参考(实际需根据SDK的版本修改对应目录):
1./system/sepolicy/prebuilts/api/26.0/nonplat_sepolicy.ci
(typeattribute xxx_service_26_0)
(roletype object_r xxx_service_26_0)
2./system/sepolicy/prebuilts/api/27.0/nonplat_sepolicy.cil
(typeattribute xxx_service_27_0)
(roletype object_r xxx_service_27_0)
3./system/sepolicy/prebuilts/api/28.0/private/compat/26.0/26.0.cil
(typeattributeset xxx_service_26_0 (xxx_service))
4./system/sepolicy/prebuilts/api/28.0/private/compat/27.0/27.0.cil
(typeattributeset xxx_service_27_0 (xxx_service))
5./system/sepolicy/prebuilts/api/28.0/private/service_contexts
6./system/sepolicy/prebuilts/api/28.0/public/service.te
7./system/sepolicy/private/compat/26.0/26.0.cil
8./system/sepolicy/private/compat/27.0/27.0.cil
9./system/sepolicy/private/service_contexts
10./system/sepolicy/public/service.te
标签:
来源: https://www.cnblogs.com/blogs-of-lxl/p/10017957.html