build - SE Linux Android 9 AOSP:在 platform_app.te 文件中添加权限导致构建失败
问题描述
我正在使用 Android9 AOSP,当我在我的 platform_app.te(位于 /system/sepolicy/public/platform_app.te)中添加权限时,我的构建失败。
system/sepolicy/public/platform_app.te:10:"ERROR 'unknown type xyz_service' at token ';' on line "
添加的权限是allow platform_app xyz_service:binder { call transfer };
xyz_service 的背景:- 它是一个由 init 启动的服务,它的 '.te' 文件位于 /system/sepolicy/vendor/xyz_service.te
我能想到的一个原因是 xyz_service.te 位于 /system/sepolicy/ vendor中,而另一个文件位于 /system/sepolicy/ public中。将其从/供应商移至/公开会带来更多问题。当然,您不能在两个位置都拥有文件,因为它会导致“类型重复声明”错误。有谁能指导一下,谢谢!
解决方案
xyz_service 类型在 /system/sepolicy/vendor/xyz_service.te 中定义,您尝试从无法访问的 system/sepolicy/public/platform_app.te 访问它。请检查 system/sepolicy/public 中可用的 file.te 并在此 file.te 中定义 xyz_service 类型以在 system/sepolicy/public/platform_app.te 中访问。
推荐阅读
- java - 与 ConcurrentSkipListSet 一起正常工作的动态比较器
- json - 使用 URLSession 获取数据时“不允许从后台线程发布更改”
- docker - 通过 Docker Operator 在 Airflow 中运行 DBT
- php - Laravel CRUD API 致命错误:未找到特征 'Illuminate\Database\Eloquent\Factories\HasFactory'
- react-native - 调用 react-native 相机胶卷时 null 不是对象
- python - Python列表数学运算
- python - Flask sqlachemy 处理多个过滤器
- python-3.x - 通过戏剧性运行后台任务不起作用
- python - 如何使用 python 将文件上传到 pCloud 文件夹?
- react-native - react-native-keyboard-aware-scroll-view 不在 Android 上滚动