[MOD] viper4android + MIUI 12 + Magisk 21.1

Search This thread

_mysiak_

Senior Member
Apr 1, 2009
2,392
1,385
Xiaomi Mi 10T Lite
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
 

mark.dx

Senior Member
Oct 20, 2015
223
48
Redmi K20 Pro
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.
 
  • Like
Reactions: Rock-Ace

lukolh

New member
Jun 2, 2014
4
1
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
 

Xosrov

New member
Feb 10, 2021
3
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
 

hachamacha

Senior Member
Jun 15, 2010
1,355
746
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
Thanks very much! - I think this was my last little nit on V11.0 / OP7T Global and adding these magiskpolicy lines to the end of the file and a reboot worked fine. I used root-explorer / Edit and had to just clean up from the cut&Paste I did so it matched exactly the above.

FWIW: I'm using ViperFX as installed via Magisk repo 2.5.0.4 Legacy mode. I'd forgotten how much I liked Viper ;). - Oh - Meant to mention I was using Magisk 22.0 since it came out. No problems.

screenie.jpg
 
Last edited:

mehediceps

Member
Feb 11, 2015
18
1
Sylhet
LG Nexus 5X
Realme 7 Pro
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
Thanks a lot man! Huge respect. Follow your instructions and it works like charm in Samsung M21 One UI 3.0
 

leobahlis

Senior Member
Nov 14, 2018
57
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
What's difference with legacy mode on to off?( Not talking about this method to work...talking in general)
 

_mysiak_

Senior Member
Apr 1, 2009
2,392
1,385
Xiaomi Mi 10T Lite
What's difference with legacy mode on to off?( Not talking about this method to work...talking in general)
Legacy mode connects to the default audio session, which works system wide. Non-legacy mode connects to dedicated audio sessions created by each app, but some don't use/announce their audio session ID and Viper might not work in such apps (e.g. Youtube or Netflix). In theory, non-legacy mode should offer higher quality, but I wasn't able to tell the difference. Legacy mode offers better compatibility.

Btw. those who want "plug&play" experience and/or higher sound processing quality should give James DSP a try.
 

leobahlis

Senior Member
Nov 14, 2018
57
5
Legacy mode connects to the default audio session, which works system wide. Non-legacy mode connects to dedicated audio sessions created by each app, but some don't use/announce their audio session ID and Viper might not work in such apps (e.g. Youtube or Netflix). In theory, non-legacy mode should offer higher quality, but I wasn't able to tell the difference. Legacy mode offers better compatibility.

Btw. those who want "plug&play" experience and/or higher sound processing quality should give James DSP a try.
Thanks for the explanation
this james dsp works in miui selinux enforced?
 

br4t0

Member
May 1, 2021
10
1
I can't find " /data/adb/modules/ViPER4AndroidFX/post-fs-data.sh" on my phone...

I only find this folder, but its empty:

Mi 10T Lite\android\Android\data\com.pittvandewitt.viperfx\files

I dont get it :(
 

Rock-Ace

Senior Member
  • Mar 25, 2013
    233
    91
    Hyderabad
    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
    Thanks , it worked for my Mi 10T Pro with MIUI 12.6 weekly channel Rom
     

    Top Liked Posts

    • There are no posts matching your filters.
    • 20
      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
      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.
    Our Apps
    Get our official app!
    The best way to access XDA on your phone
    Nav Gestures
    Add swipe gestures to any Android
    One Handed Mode
    Eases uses one hand with your phone