[SuperSU] Ultraboss:
Does somebody noticed that root switch is not working anymore with lastest supersu 2.82 ?

I have a logged error :

rmdir :

/su: Device or resource busy

losetup: /data/su.img: Not a typewriter

Here is the script called for disable (disable.sh kill_daemon):

#!/system/bin/sh

setup_supolicy() {
SUPOLICY=supolicy
if [ -f /su/bin/supolicy ]; then
SUPOLICY=/su/bin/supolicy
fi
if [ -f /system/xbin/supolicy ]; then
SUPOLICY=/system/xbin/supolicy
fi
}

if [ "$1" == "restore_sepolicy" ]; then
shift

setup_supolicy
$SUPOLICY --save /data/sepolicy.saved

SEPOLICY=/sepolicy
if [ "$1" == "snapshot" ]; then
shift
if [ -f /data/sepolicy.snapshot ]; then
SEPOLICY=/data/sepolicy.snapshot
fi
fi

$SUPOLICY --load $SEPOLICY
$SUPOLICY --live
fi

if [ "$1" == "toggle_usb_debugging" ]; then
shift
settings put global adb_enabled 0
touch /data/.toggle_usb_debugging
fi

if [ "$1" == "no_toggle_selinux" ]; then
shift
touch /data/.reset_selinux
echo Skip toggling SELinux
else
SELINUX=`getenforce`
if [ "$SELINUX" == "Permissive" ]; then
touch /data/.reset_selinux

grep byeselinux /proc/modules
if [ "$?" -eq "0" ]; then
setup_supolicy

# dirty hack for ASUS
$SUPOLICY --live "allow untrusted_app init unix_dgram_socket { getopt write }",\
"allow untrusted_app init_tmpfs file { read }",\
\
"allow system_server system_server unix_stream_socket { ioctl }",\
\
"allow zygote system_server binder { call transfer }",\
"allow system_server zygote binder { call transfer }"

# dirty hack for SONY
if [ "`getprop ro.product.brand`" == "Sony" ]; then
$SUPOLICY --live "allow kernel shell_exec file { execute read open execute_no_trans }",\
"allow kernel toolbox_exec file { getattr execute read open execute_no_trans }",\
"allow init system_file file { execute_no_trans }",\
"allow init kernel security { read_policy load_policy }",\
\
"allow zygote surfaceflinger unix_stream_socket { read }",\
"allow zygote surfaceflinger binder { call transfer }",\
"allow zygote gpu_device chr_file { ioctl }",\
"allow zygote bluetooth binder { call }",\
\
"allow untrusted_app zygote binder { call }",\
\
"allow lmkd zygote dir { search }",\
"allow lmkd zygote file { open write }",\
\
"allow surfaceflinger zygote fd { use }",\
"allow surfaceflinger zygote binder { call }"
fi
fi
setenforce 1
fi
fi

if [ -f /data/su.img ]; then

# systemless root
if [ -d /su/xbin_bind ]; then
umount -l /system/xbin
fi

if [ -d /su ]; then
MOUNT_INFO=`cat /proc/mounts | grep " /su "`
if [ "$?" == "1" ]; then
exit
fi
LOOPDEVICE=`echo $MOUNT_INFO | tr -s " " | cut -f 1 -d " "`

mount -o rw,remount /
umount -l /su
mv /su /su2
if [ "$1" == "kill_daemon" ]; then
losetup -d /data/su.img
else
mount -t ext4 -o rw,noatime $LOOPDEVICE /su2
fi
mount -o ro,remount /
fi

else

# traditional root
if [ -f /system/xbin/su ]; then
mount -o rw,remount /system

mv /system/xbin/su /system/xbin/su_
mv /system/xbin/daemonsu /system/xbin/daemonsu_
mv /system/bin/.ext /system/bin/.ext_

if [ "`getprop ro.build.version.sdk`" -ge "20" ]; then
# restore original state
rm /system/bin/app_process
if [ -d /system/lib64 ]; then
ln -s /system/bin/app_process64 /system/bin/app_process
else
ln -s /system/bin/app_process32 /system/bin/app_process
fi

if [ -L /system/bin/app_process64 ]; then
rm /system/bin/app_process64
mv /system/bin/app_process64_original /system/bin/app_process64
fi
if [ -L /system/bin/app_process32 ]; then
rm /system/bin/app_process32
mv /system/bin/app_process32_original /system/bin/app_process32
fi

# change to xposed if exists
if [ -f /system/bin/app_process32_xposed ]; then
mv /system/bin/app_process32 /system/bin/app_process32_original
ln -s /system/bin/app_process32_xposed /system/bin/app_process32
fi
if [ -f /system/bin/app_process64_xposed ]; then
mv /system/bin/app_process64 /system/bin/app_process64_original
ln -s /system/bin/app_process64_xposed /system/bin/app_process64
fi
fi

MODEL=`getprop ro.product.model`

# ZE500KL / ZE601KL / ZE550KL / ZD551KL
if [ "$MODEL" == "ASUS_Z00ED" ] || [ "$MODEL" == "ASUS_Z00UD" ] || [ "$MODEL" == "ASUS_Z00LD" ] || [ "$MODEL" == "ASUS_Z011D" ]; then
cp /data/data/com.corner23.android.rootswitch/files/qrngd /system/bin/qrngd
chmod 755 /system/bin/qrngd
chcon u:object_r:system_file:s0 /system/bin/qrngd
# ZE550ML / ZE551ML / A500CG / A600CG
elif [ "$MODEL" == "ASUS_Z00AD" ] || [ "$MODEL" == "ASUS_Z008D" ] || [ "$MODEL" == "ASUS_T00F" ] || [ "$MODEL" == "ASUS_T00G" ]; then
cp /data/data/com.corner23.android.rootswitch/files/ct_monitor /system/bin/ct_monitor
chmod 755 /system/bin/ct_monitor
chcon u:object_r:system_file:s0 /system/bin/ct_monitor
fi

mount -o ro,remount /system
fi
fi

if [ -f /system/bin/xscript ]; then
mount -o rw,remount /system
chmod 755 /system/bin/xscript
mount -o ro,remount /system
fi

if [ "$1" == "kill_daemon" ]; then
if [ -f /data/data/com.corner23.android.rootswitch/files/restore ]; then
rm /data/data/com.corner23.android.rootswitch/files/restore
fi
cp /data/data/com.corner23.android.rootswitch/files/restore_daemon.sh /data/
chcon u:object_r:system_file:s0 /data/restore_daemon.sh
chown root:root /data/restore_daemon.sh
/data/restore_daemon.sh &

SU_PROC=`ps | grep daemonsu`
while IFS= read -r line; do
proc=($line)
PIDS="$PIDS ${proc[1]}"
done <<< "$SU_PROC"

kill -9 $PIDS
fi