Home > Magisk Manager > Magisk Modules

How to Fix Viper4Android not working with SELinux Enforcing

In this guide, we will show you the steps to fix the issue of the Viper4Android module not working with SELinux Enforcing. It wouldn’t be too much of an exaggeration to say that there are some users who root their devices just for the sake of this audio mod. And we can’t blame them either.

While there are quite a few audio mods out there for a rooted device, it’s hard to argue that anyone could come forward and claim the dominance that Viper has managed to achieve. Master Limiter, Playback gain controller, FET Compressor, FIR Equalizer, Convolver, Reverberation, Speaker Optimization- you name it and it has it in its arsenal. However, as is the case with other rooted mods, this one isn’t free from its fair share of issues as well.

The most recent issue arose after the update of Magisk to v21.1/21.2. Due to some changes in Magisk’s SELinux policy handling, many users aren’t able to use this mod. If you are also on the same page, then this guide shall help you out. Given here are the detailed instructions to fix the Viper4Android not working issue with SELinux Enforcing.

How to Fix Viper4Android not working with SELinux Enforcing

How to Fix Viper4Android not working with SELinux Enforcing

First and foremost, forcefully setting SELinux to permissive might be called a fix for some users, but for me, it is a big No and it is highly recommended that you don’t do so either. Instead, proceed with the below instructions to fix this issue, which would preserve the SELinux Enforcing as well.

And yes, don’t forget to take a complete device backup beforehand, just to be on a safer side. Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device and data by performing the below steps to fix the Viper4Android not working issue with SELinux Enforcing.

Instructions Steps

  1. To begin with, download and install a File Explorer that supports rooting capabilities. As for this guide, I am using Solid Explorer.
  2. Now launch the File Explorer app and head over to the following location:
    /data/adb/modules/ViPER4AndroidFX/post-fs-data.sh

    viper4android install location fix not working

  3. Open the post-fs-data.sh file and add the following set of lines at the end of this file:
    magiskpolicy --live 'allow audioserver audioserver_tmpfs file { read write execute }'
    magiskpolicy --live 'allow audioserver system_file file { execmod }'
    magiskpolicy --live 'allow mediaserver mediaserver_tmpfs file { read write execute }'
    magiskpolicy --live 'allow mediaserver system_file file { execmod }'
    magiskpolicy --live 'allow audioserver unlabeled file { read write execute open getattr }'
    magiskpolicy --live 'allow hal_audio_default hal_audio_default process { execmem }'
    magiskpolicy --live 'allow hal_audio_default hal_audio_default_tmpfs file { execute }'
    magiskpolicy --live 'allow hal_audio_default audio_data_file dir { search }'
    magiskpolicy --live 'allow app app_data_file file { execute_no_trans }'
    magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio_tmpfs file { execute }'

    fix viper4android not working SELinux Enforcing

  4. Once done, save the file. Now reboot your device. Once it boots up, launch Viper4Android, go to its Settings, and toggle the Legacy Mode Off/On.
    viper4android legacy mode fix

That’s it. The issue should now have been rectified. So this was all from this guide on how to fix the Viper4Android not working issue with SELinux Enforcing. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest. NOTE: The entire credit for this method goes to XDA Senior Member_mysiak_.


Share:
  • ANULAL.N.V

    Not working.please suggest a working method.