2018-01-23 20:11:52 +00:00
|
|
|
#!/sbin/sh
|
2018-09-08 17:16:45 +00:00
|
|
|
#
|
|
|
|
# ADDOND_VERSION=2
|
|
|
|
#
|
2018-01-23 20:11:52 +00:00
|
|
|
##########################################################################################
|
|
|
|
#
|
|
|
|
# NanoDroid Patcher survival script
|
|
|
|
# by Nanolx
|
|
|
|
#
|
|
|
|
# Inspired by 99-flashafterupdate.sh of osm0sis @ xda-developers
|
|
|
|
# Forked from 99-magisk.sh of topjohnwu @ xda-developers
|
|
|
|
#
|
|
|
|
##########################################################################################
|
|
|
|
|
2018-09-08 19:43:28 +00:00
|
|
|
source /tmp/backuptool.functions
|
2018-01-23 20:11:52 +00:00
|
|
|
|
2018-03-20 17:52:53 +00:00
|
|
|
if [ ! -f /data/adb/nanodroid_patcher/CommonPatcher ]; then
|
|
|
|
echo " !! failed to load CommonPatcher"
|
2018-01-23 20:11:52 +00:00
|
|
|
exit 1
|
2018-03-20 17:52:53 +00:00
|
|
|
else
|
|
|
|
source "/data/adb/nanodroid_patcher/CommonPatcher"
|
|
|
|
fi
|
2018-01-23 20:11:52 +00:00
|
|
|
|
2018-03-20 17:52:53 +00:00
|
|
|
setup_environment
|
|
|
|
BASEDIR=/data/adb/nanodroid_patcher
|
2018-09-08 19:43:28 +00:00
|
|
|
export ANDROID_DATA=${BASEDIR}
|
2018-01-23 20:11:52 +00:00
|
|
|
|
2018-03-20 17:52:53 +00:00
|
|
|
NanoDroidPatcher () {
|
2018-09-08 19:43:28 +00:00
|
|
|
sleep 5
|
|
|
|
|
2018-01-23 20:11:52 +00:00
|
|
|
ui_print " "
|
|
|
|
ui_print "*******************************"
|
|
|
|
ui_print " NanoDroid Framework Patcher "
|
2018-10-29 19:47:47 +00:00
|
|
|
ui_print " addon.d 19.1.99999999 "
|
2018-01-23 20:11:52 +00:00
|
|
|
ui_print " created by @Nanolx "
|
|
|
|
ui_print " Utilizing DexPatcher @lanchon "
|
|
|
|
ui_print "*******************************"
|
|
|
|
ui_print " "
|
|
|
|
|
2018-03-09 19:10:38 +00:00
|
|
|
mount_partitions
|
|
|
|
|
2018-01-23 20:11:52 +00:00
|
|
|
[ -f /data/adb/.nanodroid-patcher ] && \
|
|
|
|
rm -f /data/adb/.nanodroid-patcher
|
2018-08-21 20:26:51 +00:00
|
|
|
[ -f /data/adb/NanoDroid_Patched ] && \
|
|
|
|
rm -f /data/adb/NanoDroid_Patched
|
2018-01-23 20:11:52 +00:00
|
|
|
|
2018-09-08 19:43:28 +00:00
|
|
|
for artifact in classes.dex oat dalvik-cache \
|
|
|
|
services.jar services.jar-mod; do
|
2018-09-08 18:20:07 +00:00
|
|
|
rm -rf ${BASEDIR}/${artifact}
|
2018-01-23 20:11:52 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
detect_sdk
|
|
|
|
detect_arch
|
|
|
|
detect_odex
|
|
|
|
|
|
|
|
[ -f ${MAGISK_IMG} ] && magisk_setup
|
|
|
|
|
|
|
|
patch_services
|
|
|
|
install_services
|
|
|
|
|
|
|
|
ui_print " "
|
|
|
|
ui_print " >> clean up"
|
|
|
|
|
|
|
|
magisk_cleanup
|
|
|
|
|
|
|
|
ui_print " "
|
|
|
|
ui_print " > Done!"
|
|
|
|
ui_print " "
|
|
|
|
ui_print "Thanks for using NanoDroid"
|
|
|
|
ui_print " "
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
# Check environment
|
|
|
|
##########################################################################################
|
|
|
|
|
2018-09-08 19:43:28 +00:00
|
|
|
OUTFD=
|
|
|
|
detect_outfd
|
|
|
|
|
|
|
|
if ! test -d /data/adb/nanodroid_patcher ; then
|
2018-01-23 20:11:52 +00:00
|
|
|
ui_print " "
|
|
|
|
ui_print " !! NanoDroid-Patcher environment missing"
|
|
|
|
ui_print " !! guessing, you've wiped /data ?"
|
|
|
|
ui_print " !! re-flash the NanoDroid-Patcher zip"
|
|
|
|
ui_print " "
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
# Stuffz
|
|
|
|
##########################################################################################
|
|
|
|
|
2018-03-20 17:52:53 +00:00
|
|
|
case "${1}" in
|
2018-01-23 20:11:52 +00:00
|
|
|
backup)
|
|
|
|
# Stub
|
|
|
|
;;
|
|
|
|
restore)
|
|
|
|
# Stub
|
|
|
|
;;
|
|
|
|
pre-backup)
|
|
|
|
# Stub
|
|
|
|
;;
|
|
|
|
post-backup)
|
|
|
|
# Stub
|
|
|
|
;;
|
|
|
|
pre-restore)
|
|
|
|
# Stub
|
|
|
|
;;
|
|
|
|
post-restore)
|
2018-09-08 20:00:46 +00:00
|
|
|
NanoDroidPatcher
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|