sepolicy编译
A. CnetOS编译AOSP不明原因失败
ROOT获得最高权限是删除这些应用的唯一途径 实际手动操作的流程非常复杂,并且有版本限制 我推荐你款不错的手机ROOT工具吧, 我一直都是在用的,很不错 使用应用宝获取手机root权限在工具 选项里找到一键ROOT即可或者KINGROOT也行。
B. 怎么用android image kitchen解包,并且修改sepolicy文件,方便在MIUI中安装root。
如果你要获取root权限。那何必这么麻烦呀。直接刷miui开发版就可以获取自带root权限了。而且比第三方外root百分之百好。
C. 高通selinux怎么单独编译
模块编译。selinux编译修改了*.te,可以选择模块编译,也可以全编译。makeselinux_policy,编译system/sepolicy/Android.mk中selinux_policy目标,也将Android.mk中大部分目标都编译了。
D. 安卓关闭selinux好处
你好朋友
1. 禁止selinux
1.1 在内核中关闭selinux编译选项CONFIG_SECURITY_SELINUX
1.2 还可以在system.prop中定义ro.boot.selinux=disable
这两种方法都可以禁用selinux,也可以设置成ro.boot.selinux=permissive
宽容模式
1.3 可以通过setenforce1开启enforce模式,setenforce 0为permissive模式
getenforce获取当前模式
2. 所有安全策略最终编译成sepolicy文件放在root目录下,init进程启动后会读取/sepolicy策略文件,并通过/sys/fs/selinux/load节点
把策略文件内容写入内核
3 安全上下文存放root目录
/etc/security/mac_permissions.xml
/file_contexts //系统中所有file_contexts安全上下文
/seapp_contexts //app安全上下文
/property_contexts //属性的安全上下文
/service_contexts //service文件安全上下文
genfs_contexts //虚拟文件系统安全上下文
4. app在/data/data/文件的安全上下文设置过程
1. 根据uid,pkgname,seinfo在seapp_contexts中匹配.
2. 根据匹配到的contexts,重新设置给相对应文件
5. 系统中所有的object class 定义在external/sepolicy/security_classes中.
object class使用在allow语句中,object class所具有的操作定义在external/sepolicy/access_vectors
文件中
6 allow语句
allow语句用来权限设置
rule_name source_type target_type : class perm_set
rule_name : 有allow,neverallow
source_type : 权限主体,表示source_type对target_type有perm_set描述的权限
如:
allow zygote init:process sigchld
允许zygote域里面的进程可对init域的进程发送sigchld信号
typeattribute表示把属性和type关联起来
7 role定义
Android系统中的role定义在external/sepolicy/roles中,
目前只定义了r
8 socket使用
以/data/misc/wifi/sockets/wlan0 socket来说明使用方法
1. 定义socket type
type wpa_socket ,file_type
2. 指定安全上下文
/data/misc/wifi/sockets(/.*)? u:object_r:wpa_socket:s0
给/data/misc/wifi/sockets目录下所有的文件统一指定安全上下文为wpa_socket
3.声明socket使用权限
在进程te中使用unix_socket_send(clientdomain, wpa, serverdomain)即可建立socket连接
9binder使用
在使用binder进程的te中根据情况使用如下宏:
binder_use(domain)//允许domain域中的进程使用binder通信
binder_call(clientdomain, serverdomain)//允许clientdomain和serverdomain域中的进程通信
binder_service(domain)//标志domain为service端
10 文件的使用
以/dev/wmtWifi来说明:
1.定义type
type wmtWifi_device dev_type //dev_type用来标志/dev/下的文件
2.给/dev/wmtWifi指定完全上下文
/dev/wmtWifi(/.*)? u:object_r:wmtWifi_device:s0
3.进程权限设置
在进程te文件中allow权限
allow netd wmtWifi_device:chr_file { write open };
11 property 属性设置
以蓝牙的各种属性来说明
1.定义type
type bluetooth_prop, property_type;
2设置安全上下文
bluetooth. u:object_r:bluetooth_prop:s0
3进程权限设置
allow bluetooth bluetooth_prop:property_service set;
5 专业词汇
MLS :Multi-Level Security
RBAC :Role Based Access Control
DAC :Discretionary Access Control
MAC :Mandatory Access Control
TEAC :Type Enforcement Accesc Control
望采纳祝你好运