[MOD] viper4android + MIUI 12 + Magisk 21.1

Search This thread

DorianLeDev

New member
May 14, 2020
4
3
Redmi Note 9
Default viper4android Magisk module doesn't work for me with SELinux enforcing. "Brute force" fix is to set SELinux to permissive, but I don't like this approach. Viper4android module should patch selinux policies during installation, but it fails for some reason. Fix is quite simple:

1. Locate and edit file
Code:
/data/adb/modules/ViPER4AndroidFX/post-fs-data.sh
2. Add this text to the end of the file
Code:
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 }'
3. save, reboot phone
4. go to viper4android app and toggle legacy mode off and on, it should work now with legacy mode enabled

Edit:
One user needed few extra lines to make it working on his Redmi Note 9:
Code:
magiskpolicy --live 'allow mtk_hal_audio sysfs_dt_firmware_android file { read }'
magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio process { execmem }'
magiskpolicy --live 'allow vendor_default_prop vendor_default_prop file { read }'
magiskpolicy --live 'allow mtk_hal_audio metadata_file dir { search }'
magiskpolicy --live 'allow mtk_hal_audio debugfs_ion dir { search }'
Wahoooooo! It WORKS! Finally!
I've been trying to get Viper4android to work on my Redmi Note 9 without having SELinux in Permissive for so long! Thanks a lot! I finally find the joy of music without ever more complex prerequisites!
1624390543308.jpg
 
  • Like
Reactions: Erpe7 and wallah

wertguygywe

Member
Jun 9, 2021
25
1
This does not work for me on my Poco X3 Pro running Arrow OS 11. Setting SELinux to permissive also did not work.
 
Last edited:

onoakino

Senior Member
Sep 25, 2015
331
77
Manila
If you need audio modification library, it means that you most probably have another audio mod active. I would try turning all other modules off and enable just Viper or James.

I am not trying to sell you James DSP, but in my experience it provides higher quality audio processing and I was able to replicate all features from Viper (but I admit that I did not use a lot of them). What exactly do you find missing in James? My first impression was similar to yours, but at the end I prefer it over Viper now. The only thing I miss is home screen widget for quick preset changing.
Is it possible I use vdc files on jamesDSP?

--edit--

wow, it does! adios, v4a.
 
Last edited:

richiegongora

Member
Apr 6, 2017
5
1
Merida
Thank You! It's perfectly in Xiaomi Redmi Note 8 (Ginkgo). I've installed the ViPERAndroidFX module from Magisk library and wasn't working, but following this tutotial now it's working very well!
(I'm usisng a xiaomi.eu rom with miui 12.5)

Default viper4android Magisk module doesn't work for me with SELinux enforcing. "Brute force" fix is to set SELinux to permissive, but I don't like this approach. Viper4android module should patch selinux policies during installation, but it fails for some reason. Fix is quite simple:

1. Locate and edit file
Code:
/data/adb/modules/ViPER4AndroidFX/post-fs-data.sh
2. Add this text to the end of the file
Code:
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 }'
3. save, reboot phone
4. go to viper4android app and toggle legacy mode off and on, it should work now with legacy mode enabled

Edit:
One user needed few extra lines to make it working on his Redmi Note 9:
Code:
magiskpolicy --live 'allow mtk_hal_audio sysfs_dt_firmware_android file { read }'
magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio process { execmem }'
magiskpolicy --live 'allow vendor_default_prop vendor_default_prop file { read }'
magiskpolicy --live 'allow mtk_hal_audio metadata_file dir { search }'
magiskpolicy --live 'allow mtk_hal_audio debugfs_ion dir { search }'
 

Lu5ck

Senior Member
Dec 18, 2013
356
119
This does not work for me on my Poco X3 Pro running Arrow OS 11. Setting SELinux to permissive also did not work.
Second this

Edit
Got this to work on Poco X3 Pro - ArrowOS 11.0
I need to install Ainur Narsil and Audio Modification Library, then toggle legacy in viper.
 
Last edited:

Erpe7

Senior Member
Jan 13, 2018
366
71
Default viper4android Magisk module doesn't work for me with SELinux enforcing. "Brute force" fix is to set SELinux to permissive, but I don't like this approach. Viper4android module should patch selinux policies during installation, but it fails for some reason. Fix is quite simple:

1. Locate and edit file
Code:
/data/adb/modules/ViPER4AndroidFX/post-fs-data.sh
2. Add this text to the end of the file
Code:
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 }'
3. save, reboot phone
4. go to viper4android app and toggle legacy mode off and on, it should work now with legacy mode enabled

Edit:
One user needed few extra lines to make it working on his Redmi Note 9:
Code:
magiskpolicy --live 'allow mtk_hal_audio sysfs_dt_firmware_android file { read }'
magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio process { execmem }'
magiskpolicy --live 'allow vendor_default_prop vendor_default_prop file { read }'
magiskpolicy --live 'allow mtk_hal_audio metadata_file dir { search }'
magiskpolicy --live 'allow mtk_hal_audio debugfs_ion dir { search }'
Cheers for this tip !
After installing viper via magisk on my Mi 8 Dipper running official Miui 12.0.2. I uninstalled it (without trying the code first-I wasn't aware of) then I installed the 2.7.2.1 apk (should be the same I suppose) , then I found your post and added these lines. No need for me to add "few extra lines".
And it works ! So, cheers again.
 

JustIceForSake

Senior Member
Jul 25, 2014
162
41
Default viper4android Magisk module doesn't work for me with SELinux enforcing. "Brute force" fix is to set SELinux to permissive, but I don't like this approach. Viper4android module should patch selinux policies during installation, but it fails for some reason. Fix is quite simple:

1. Locate and edit file
Code:
/data/adb/modules/ViPER4AndroidFX/post-fs-data.sh
2. Add this text to the end of the file
Code:
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 }'
3. save, reboot phone
4. go to viper4android app and toggle legacy mode off and on, it should work now with legacy mode enabled

Edit:
One user needed few extra lines to make it working on his Redmi Note 9:
Code:
magiskpolicy --live 'allow mtk_hal_audio sysfs_dt_firmware_android file { read }'
magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio process { execmem }'
magiskpolicy --live 'allow vendor_default_prop vendor_default_prop file { read }'
magiskpolicy --live 'allow mtk_hal_audio metadata_file dir { search }'
magiskpolicy --live 'allow mtk_hal_audio debugfs_ion dir { search }'
Just wanted to say thank you! It works! I also had to put those extra lines of code you provided for a Redmi Note 8 Pro.
 

brandonabandon

Senior Member
Nov 17, 2013
290
304
Default viper4android Magisk module doesn't work for me with SELinux enforcing. "Brute force" fix is to set SELinux to permissive, but I don't like this approach. Viper4android module should patch selinux policies during installation, but it fails for some reason. Fix is quite simple:

1. Locate and edit file
Code:
/data/adb/modules/ViPER4AndroidFX/post-fs-data.sh
2. Add this text to the end of the file
Code:
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 }'
3. save, reboot phone
4. go to viper4android app and toggle legacy mode off and on, it should work now with legacy mode enabled

Edit:
One user needed few extra lines to make it working on his Redmi Note 9:
Code:
magiskpolicy --live 'allow mtk_hal_audio sysfs_dt_firmware_android file { read }'
magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio process { execmem }'
magiskpolicy --live 'allow vendor_default_prop vendor_default_prop file { read }'
magiskpolicy --live 'allow mtk_hal_audio metadata_file dir { search }'
magiskpolicy --live 'allow mtk_hal_audio debugfs_ion dir { search }'
Thx bro. Fix for pixel 3 xl
 

Saphyres

Member
Oct 29, 2020
8
1
Default viper4android Magisk module doesn't work for me with SELinux enforcing. "Brute force" fix is to set SELinux to permissive, but I don't like this approach. Viper4android module should patch selinux policies during installation, but it fails for some reason. Fix is quite simple:

1. Locate and edit file
Code:
/data/adb/modules/ViPER4AndroidFX/post-fs-data.sh
2. Add this text to the end of the file
Code:
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 }'
3. save, reboot phone
4. go to viper4android app and toggle legacy mode off and on, it should work now with legacy mode enabled

Edit:
One user needed few extra lines to make it working on his Redmi Note 9:
Code:
magiskpolicy --live 'allow mtk_hal_audio sysfs_dt_firmware_android file { read }'
magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio process { execmem }'
magiskpolicy --live 'allow vendor_default_prop vendor_default_prop file { read }'
magiskpolicy --live 'allow mtk_hal_audio metadata_file dir { search }'
magiskpolicy --live 'allow mtk_hal_audio debugfs_ion dir { search }'
Thanks a lot for that genius work and sharing it with us. Helped me :)
 

Apih95

Senior Member
Default viper4android Magisk module doesn't work for me with SELinux enforcing. "Brute force" fix is to set SELinux to permissive, but I don't like this approach. Viper4android module should patch selinux policies during installation, but it fails for some reason. Fix is quite simple:

1. Locate and edit file
Code:
/data/adb/modules/ViPER4AndroidFX/post-fs-data.sh
2. Add this text to the end of the file
Code:
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 }'
3. save, reboot phone
4. go to viper4android app and toggle legacy mode off and on, it should work now with legacy mode enabled

Edit:
One user needed few extra lines to make it working on his Redmi Note 9:
Code:
magiskpolicy --live 'allow mtk_hal_audio sysfs_dt_firmware_android file { read }'
magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio process { execmem }'
magiskpolicy --live 'allow vendor_default_prop vendor_default_prop file { read }'
magiskpolicy --live 'allow mtk_hal_audio metadata_file dir { search }'
magiskpolicy --live 'allow mtk_hal_audio debugfs_ion dir { search }'
thanks !!!! no need to remove anything , work perfectly on my Redmi Note 10(MOJITO) MIUI 12.5.2 !!!😍😍😍😍😍
 

alb0603

Senior Member
Nov 23, 2011
77
17
Brisbane
Legend!!! Works for me, but I did have to use both chucks of text. Redmi Note 8 Pro running Miui 12.0.5 Android 10Magisk 23.0 & V4A 2.7.2.1. I also have the Audio Modification Library mod install, not sure if this made a difference or not
 

voshchronos

Senior Member
Mar 14, 2016
103
9
Damn, adding the first set of lines to the file worked perfectly for me! Thank you so much!
Btw, I'm on MIUI 12, and my phone is the Mi CC9 Meitu Edition.
 

joshtau

New member
Feb 24, 2017
2
0
This worked for Samsung S10 Android 11. This should be a sticky a it looks like it resolves issues with any SeLinux enabled phone, like Samsung. I had no end of problems getting Viper4Android to work, and this ultimately fixed it. There was talk about Magisk Audio modules and such, but these are not required. Just standard Magisk install, and then this fix.

Thank you!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 48
    Default viper4android Magisk module doesn't work for me with SELinux enforcing. "Brute force" fix is to set SELinux to permissive, but I don't like this approach. Viper4android module should patch selinux policies during installation, but it fails for some reason. Fix is quite simple:

    1. Locate and edit file
    Code:
    /data/adb/modules/ViPER4AndroidFX/post-fs-data.sh
    2. Add this text to the end of the file
    Code:
    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 }'
    3. save, reboot phone
    4. go to viper4android app and toggle legacy mode off and on, it should work now with legacy mode enabled

    Edit:
    One user needed few extra lines to make it working on his Redmi Note 9:
    Code:
    magiskpolicy --live 'allow mtk_hal_audio sysfs_dt_firmware_android file { read }'
    magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio process { execmem }'
    magiskpolicy --live 'allow vendor_default_prop vendor_default_prop file { read }'
    magiskpolicy --live 'allow mtk_hal_audio metadata_file dir { search }'
    magiskpolicy --live 'allow mtk_hal_audio debugfs_ion dir { search }'
    2
    Thank you, this fix is working for me on MIUI 12.0.6 xiaomi.eu running on viper4android 2.7.2.1
    Although I had to edit it externally on my PC since my rootexplorer keep crashing while editing on the phone.
    Btw I'm using Mi 9T Pro.
    2
    Thanks Bro, this works for me on Oneplus 7T. V4A broke after updating Magisk to v21.2. Followed your method now's golden.
    2
    Thanks a lot. i just received the MIUI 12 update and i couldn't get V4A to work anymore. Followed your instruction and its working fine now. V4A is the only reason i keep my phone rooted so far. I'm on Redmi N5P
    2
    Default viper4android Magisk module doesn't work for me with SELinux enforcing. "Brute force" fix is to set SELinux to permissive, but I don't like this approach. Viper4android module should patch selinux policies during installation, but it fails for some reason. Fix is quite simple:

    1. Locate and edit file
    Code:
    /data/adb/modules/ViPER4AndroidFX/post-fs-data.sh
    2. Add this text to the end of the file
    Code:
    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 }'
    3. save, reboot phone
    4. go to viper4android app and toggle legacy mode off and on, it should work now with legacy mode enabled

    Edit:
    One user needed few extra lines to make it working on his Redmi Note 9:
    Code:
    magiskpolicy --live 'allow mtk_hal_audio sysfs_dt_firmware_android file { read }'
    magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio process { execmem }'
    magiskpolicy --live 'allow vendor_default_prop vendor_default_prop file { read }'
    magiskpolicy --live 'allow mtk_hal_audio metadata_file dir { search }'
    magiskpolicy --live 'allow mtk_hal_audio debugfs_ion dir { search }'
    Wahoooooo! It WORKS! Finally!
    I've been trying to get Viper4android to work on my Redmi Note 9 without having SELinux in Permissive for so long! Thanks a lot! I finally find the joy of music without ever more complex prerequisites!
    1624390543308.jpg