How to set SELinux Mode to Permissive Permanently in MIUI 9

How to set SELinux Mode to Permissive Permanently in MIUI 9

I know that it is hard to set SELinux mode to permissive permanently in MIUI 9. I came forward to show some simple and easy steps to fix this in miui9. Actually, its a problem of Android Nougat (7.0) and not just miui. There are some apps to change SELinux mode to Permissive from Enforcing but you have to do it everytime you turn on your phone which is hard.

Viper4Android needs SELinux to be permissive in order to work. But in MIUI 9 you have to enable developer mode in Viper4Android to disable SELinux everytime you boot. So, by following the below instructions you don’t have to enter developer mode every time as the policy changes to permissive automatically at startup.

I found a method in which the SELinux mode changes to permissive automatically at smartphone bootup so that you don’t have to change it manually every time. This method involves rooting your phone so I advise you to take a backup of your phone. However, this method works perfectly without any problem if you follow the below steps properly.

Please install TWRP Recovery on your phone running on MIUI 9 to flash some files which can be downloaded below. If you don’t know how to install a custom recovery on your mobile you can search in XDA developers or in miui forums.

Instructions to set SELinux Mode to Permissive

If you have already rooted the phone please unroot it. If you didn’t root your phone please move to step 2. If you have SuperSu installed on your phone go to settings and click on “Full unroot” option. Reboot your phone and your root access will be gone.

Open Magisk Manager application and go to Modules section. Click on the “+” icon below and select the downloaded module zip file.

Magisk Manager will automatically install the module and asks you to reboot the phone.

Just reboot the phone and you are done! Every time you boot the phone Magisk will automatically change the SELinux mode to permissive.

You will see the screen above once you finish installing everything properly. You can now use Viper4Android on MIUI 9 or any other application without the need of disabling SELinux every time you start the phone. This method works on all phones and not just MIUI.

Hope you like this article. Please don’t forget to share and feel free to comment below if you have any queries!