• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[MOD] viper4android + MIUI 12 + Magisk 21.1

Search This thread

DorianLeDev

New member
May 14, 2020
2
2
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

onoakino

Senior Member
Sep 25, 2015
259
54
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 }'
 

Erpe7

Senior Member
Jan 13, 2018
365
70
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.
 
  • Like
Reactions: _mysiak_

Top Liked Posts

  • There are no posts matching your filters.
  • 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 }'
    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.
  • 30
    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
    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
    1
    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.
    1
    This fixed it, i think the problem is because of A11 because a lot of people have this problem with it.
    Hopefully those people can find this post too.
    Thanks
    Glad to be of help. The fix is most probably needed due to Magisk 21.1 changes in SELinux policy handling though. I had the very same issue/fix in Android 10 as well.
    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 }'
    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.