Android 系统调试(1) 禁止SeLinux
生活随笔
收集整理的這篇文章主要介紹了
Android 系统调试(1) 禁止SeLinux
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
有時(shí)候調(diào)試需要關(guān)閉SElinux , 下面方式可以臨時(shí)或永久關(guān)閉SELinux
方式一:?
adb shell "echo 0 > /sys/fs/selinux/enforce" //設(shè)置SELinux 成為permissive模式 adb shell "echo 1 > /sys/fs/selinux/enforce" //設(shè)置SELinux 成為enforcing模式方式二:?
adb shell setenforce 1 //設(shè)置SELinux 成為enforcing模式 adb shell setenforce 0 //設(shè)置SELinux 成為permissive模式方式三:?
diff --git a/system/core/init/selinux.cpp b/system/core/init/selinux.cpp index 438ba7a..8282d83 100755 --- a/system/core/init/selinux.cpp +++ b/system/core/init/selinux.cpp @@ -106,7 +106,8 @@ EnforcingStatus StatusFromCmdline() {bool IsEnforcing() {//return false;//add by hxqif (ALLOW_PERMISSIVE_SELINUX) { - return StatusFromCmdline() == SELINUX_ENFORCING; + //return StatusFromCmdline() == SELINUX_ENFORCING; + return StatusFromCmdline() == SELINUX_PERMISSIVE;}return true;} --- a/system/core/init/service.cpp +++ b/system/core/init/service.cpp @@ -86,7 +86,9 @@ static Result<std::string> ComputeContextFromExecutable(const std::string& servifree(new_con);}if (rc == 0 && computed_context == mycon.get()) { - return Error() << "File " << service_path << "(labeled \"" << filecon.get() + //return Error() << "File " << service_path << "(labeled \"" << filecon.get() + std::ostringstream file_label_err; + file_label_err << "File " << service_path << "(labeled \"" << filecon.get()<< "\") has incorrect label or no domain transition from " << mycon.get()<< " to another SELinux domain defined. Have you configured your ""service correctly? https://source.android.com/security/selinux/"總結(jié)
以上是生活随笔為你收集整理的Android 系统调试(1) 禁止SeLinux的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android SQLite开发调试工具
- 下一篇: MTK 鼠标在列表界面选不到最后的选项