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
望採納祝你好運