#!/sbin/sh umask 022 OUTFD=${2} ZIP=${3} mkdir /dev/tmp unzip -o "${ZIP}" CommonPatcher -d "/dev/tmp" if [ ! -f /dev/tmp/CommonPatcher ]; then echo " !! failed to load CommonPatcher" exit 1 else source "/dev/tmp/CommonPatcher" fi detect_bootmode setup_environment BASEDIR="${TMPDIR}/dexpatcher" detect_outfd ui_print " " ui_print "********************************" ui_print " NanoDroid 19.1.99999999 " ui_print " created by @Nanolx " ui_print " Framework Patcher " ui_print "Powered by DexPatcher (@lanchon)" ui_print "********************************" ui_print " " mount_partitions if [ -f /data/adb/.nanodroid-patcher ]; then ui_print " !! /data/adb/.nanodroid-patcher exists" ui_print " !! if you want to force patching, then" error " remove this file and try again" elif [ -f /data/adb/NanoDroid_Patched ]; then ui_print " !! /data/adb/NanoDroid_Patched exists" ui_print " !! if you want to force patching, then" error " remove this file and try again" fi setup_patcher detect_sdk detect_arch detect_odex [ -f ${MAGISK_IMG} ] && magisk_setup patch_services install_services install_addond ui_print " " ui_print " >> clean up" magisk_cleanup if ! ${BOOTMODE} ; then umount -l /system_root 2>/dev/null umount -l /system 2>/dev/null umount -l /vendor 2>/dev/null umount -l /dev/random 2>/dev/null fi ui_print " " ui_print " > Done!" ui_print " " ui_print "Thanks for using NanoDroid" ui_print " " exit 0