#!/sbin/sh
# Standard Magisk module installer. KernelSU and APatch use their own installer.
umask 022
OUTFD=$2
ZIPFILE=$3
ui_print() { echo "ui_print $1" > /proc/self/fd/$OUTFD; echo "ui_print" > /proc/self/fd/$OUTFD; }
mount /data 2>/dev/null
if [ -f /data/adb/magisk/util_functions.sh ]; then
  . /data/adb/magisk/util_functions.sh
  [ "$MAGISK_VER_CODE" -lt 20400 ] && { ui_print "Magisk 20.4+ needed"; exit 1; }
  install_module
else
  ui_print "Install this module from the Magisk / KernelSU / APatch app."
  exit 1
fi
exit 0
