News Tips

How to Fix Viper4Android SELinux Policy Issues on Lollipop

Viper4Android has had trouble with SELinux enforcing mode introduced on Lollipop, and so far we’ve been trying to run it under the permissive mode by changing the SELinux policy, but thanks to maximumentropy over at XDA, you can now use Viper4Android without changing SELinux from enforcing to permissive.

The fix involves pushing a few ADB commands to the device on which you want to run Viper4Android and also make sure you’ve SuperSU as your superuser management app for it to work. Check out the original post by the user below:

This requires that you are using SuperSU on your system, as it provides both the su.d startup directory support and the supolicy binary. Execute these commands in a terminal on your Android device to create the startup script. It should execute at boot time, starting with your next reboot.

If case you’re scared of ADB commands, then thankfully we also have a recovery flashable zip for the same.

[ADB method] How to apply Viper4Android SELinux fix

  1. Setup ADB and Fastboot on your PC.
  2. Enable USB debugging on your device from developer options and connect it to the PC with a USB cable.
  3. Open a command prompt window on the PC and issue the following commands:
    su
    mount -o rw,remount /system
    cd /system/su.d
    echo '#! /system/bin/sh' > 50viper.sh
    echo '/system/xbin/supolicy --live "allow mediaserver mediaserver_tmpfs:file { read write execute };"' >> 50viper.sh
    chown root.root 50viper.sh
    chmod 755 50viper.sh
    cd /
    mount -o ro,remount /system
    exit
  4. Reboot your device.

[Recovery Flashable zip] Viper4Android SELinux fix

For folks who prefer to stay away from ADB or just don’t have access to PC. Here’s recovery flashable zip file to apply the fix.

Download Viper4Android SELinux Policy fix

To install, just boot into a custom recovery (TWRP, preferably), flash the zip file and reboot. Nothing else.

via XDA

Avatar

Shivam is our resident designer and web developer who also enjoys writing. He loves to meditate, drive on the freeways and hunt for snipers during his Call Of Duty playtime. Email: shivam@theandroidsoul.com