2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-11-11 13:11:24 +00:00
NanoDroid/patcher/dexpatcher/70-nanodroidpatcher.sh

106 lines
2.1 KiB
Bash
Raw Normal View History

2018-01-23 20:11:52 +00:00
#!/sbin/sh
#
# 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
#
##########################################################################################
source /tmp/backuptool.functions
2018-01-23 20:11:52 +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
else
source "/data/adb/nanodroid_patcher/CommonPatcher"
fi
2018-01-23 20:11:52 +00:00
setup_environment
BASEDIR=/data/adb/nanodroid_patcher
export ANDROID_DATA=${BASEDIR}
2018-01-23 20:11:52 +00:00
NanoDroidPatcher () {
sleep 5
show_banner
2018-01-23 20:11:52 +00:00
mount_partitions
2018-01-23 20:11:52 +00:00
[ -f /data/adb/.nanodroid-patcher ] && \
rm -f /data/adb/.nanodroid-patcher
[ -f /data/adb/NanoDroid_Patched ] && \
rm -f /data/adb/NanoDroid_Patched
2018-01-23 20:11:52 +00:00
for artifact in classes.dex oat dalvik-cache \
services.jar services.jar-mod; do
rm -rf ${BASEDIR}/${artifact}
2018-01-23 20:11:52 +00:00
done
2019-01-06 20:21:55 +00:00
detect_sdk
detect_arch
2018-12-27 21:14:41 +00:00
if search_fake_package_signature; then
ui_print " ROM has native signature spoofing already!"
exit 0
fi
2018-01-23 20:11:52 +00:00
detect_odex
patch_services
install_services
ui_print " "
ui_print " > Done!"
ui_print " "
ui_print "Thanks for using NanoDroid"
ui_print " "
exit 0
}
##########################################################################################
# Check environment
##########################################################################################
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
##########################################################################################
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)
NanoDroidPatcher
2018-01-23 20:11:52 +00:00
;;
esac