mirror of
https://gitlab.com/Nanolx/NanoDroid
synced 2024-11-07 15:20:36 +00:00
72 lines
1.3 KiB
Bash
72 lines
1.3 KiB
Bash
#!/sbin/sh
|
|
|
|
umask 022
|
|
OUTFD=${2}
|
|
ZIP=${3}
|
|
|
|
umount /system &>/dev/null
|
|
|
|
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"
|
|
PATCH_CORE="${BASEDIR}/core_services.jar.dex"
|
|
|
|
detect_outfd
|
|
|
|
ui_print " "
|
|
ui_print "********************************"
|
|
ui_print " NanoDroid 17.4.20180731 "
|
|
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"
|
|
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
|
|
fi
|
|
|
|
ui_print " "
|
|
ui_print " > Done!"
|
|
ui_print " "
|
|
ui_print "Thanks for using NanoDroid"
|
|
ui_print " "
|
|
|
|
exit 0
|