文章目錄
- 一、selinux 行程保護
- 二、寬容模式與強制模式
一、selinux 行程保護
selinux 行程保護 一旦開啟后 , 其它行程不能除錯指定的行程 ;
Android 5.0 及之后的系統默認開啟 ;
執行 getenforce 查看 selinux 是否開啟 ;
walleye:/ # getenforce
Enforcing

二、寬容模式與強制模式
selinux 有兩種模式 :
- 0 : permissive , 寬容模式 ; 該模式下 selinux 關閉 , 可以除錯行程資料 ;
- 1 : enforcing , 強制模式 ; 該模式下 selinux 打開 , 不能除錯行程資料 ;
默認模式為 強制模式 ;
如果在除錯行程時 , 除錯失敗 , 需要查看當前的 selinux 的模式 是否是 寬容模式 , 強制模式下 , 無法進行除錯 ;
設定 寬容模式 : 執行如下命令 , 可以設定寬容模式 ;
setenforce 0
完整命令列輸出 : 前提是手機是 root 過的 , 呼叫 su 命令 , 獲取 root 權限 ;
walleye:/ # getenforce
Enforcing
walleye:/ # setenforce 0
walleye:/ # getenforce
Permissive
walleye:/ #

設定強制模式 : 執行如下命令 , 可以設定強制模式 ;
setenforce 1
完整命令列輸出 :
walleye:/ # getenforce
Permissive
walleye:/ # setenforce 1
walleye:/ # getenforce
Enforcing
walleye:/ #

轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/333829.html
標籤:其他
上一篇:C++檔案操作fstream
下一篇:Android 選單知識儲備
