1. Check whether the /system/bin/su file exists. If it exists, execute the following:
setenforce 0
2. If the /system/bin/su file does not exist, then execute
cd /system/bin
ln -s ./magisk su
setenforce 0
3. If 1 and 2 above don’t work, try this method.
Name the following code su, and then push it to the /system/bin directory of the android device
#!/system/bin/sh
#echo "count =$#"
#chcon u:r:magisk:s0 /system/bin/su
#chmod 777 /system/bin/su
#chown 0.0 /system/bin/su
if [ $# == 0 ]; then
magisk su
else
magisk su -s $@
fi
Then, chmod 755 /system/bin/su can root and run normally.