首页 > 解决方案 > 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中。将其从/供应商移至/公开会带来更多问题。当然,您不能在两个位置都拥有文件,因为它会导致“类型重复声明”错误。有谁能指导一下,谢谢!

标签: buildandroid-sourceandroid-9.0-pieselinux

解决方案


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 中访问。


推荐阅读