1.添加完权限如何编译验证?
android 8.0及以后,android根目录下执行 make selinux_policy,会输出到
out/target/product/XXXX/system/etc/selinux 和 out/target/product/XXXX/vendor/etc/selinux
push上述两个目录的所有文件到system/etc/selinux和vendor/etc/selinux目录 重启手机即可。
//手动修改某个文件的conext
chcon -v u:object_r:netdiag_exec:s0 mydump
2.问题集锦
out/target/product/xxx/obj/ETC/sepolicy_tests_intermediates/sepolicy_tests )" The following types on /system/ must be associated with the "system_file_type" attribute: verifyusb_exec
解决:
type verifyusb, domain;
type verifyusb_exec, system_file_type, exec_type, file_type;
init_daemon_domain(verifyusb)
libsepol.report_assertion_extended_permissions: neverallowxperm on line 335 of system/sepolicy/public/domain.te (or line 11682 of policy.conf) violated by
allow nds nds:packet_socket { ioctl };
解决:
allowxperm nds self:packet_socket ioctl &n

本文详细介绍了在Android 8.0及以上版本中如何验证权限编译,包括执行`makeselinux_policy`命令、修改文件上下文以及解决SELinux策略冲突的方法。同时,针对SELinux权限拒绝、onproperty触发问题和开关SELinux的操作进行了说明,并提供了相关链接和解决方案。
最低0.47元/天 解锁文章
1692

被折叠的 条评论
为什么被折叠?



