How to set SELinux to 0 or permissive mode in android 4.4.4 and above?

后端 未结 3 771
名媛妹妹
名媛妹妹 2021-01-11 09:31

I want to set the SELinux (Security Enhanced Linux) mode to Permissive or (0) on android 4.4.4 (and above if possible). I use the following command: setenforce 0

3条回答
  •  逝去的感伤
    2021-01-11 09:55

    MUST BE ROOTED! Not sure if this works on KitKat (it should) but I use this on my Nexus 6. Run following in terminal or ADB Shell:

    su
    mount -o remount,rw /system
    mkdir /system/su.d
    echo "#!/system/bin/sh" > /system/su.d/permissive.sh
    echo "echo 0 > /sys/fs/selinux/enforce" >> /system/su.d/permissive.sh
    chmod 755 /system/su.d/permissive.sh
    

    And check it after reboot by this:

    su
    /system/bin/getenforce
    

提交回复
热议问题