|
|
|
@ -81,6 +81,34 @@ mount_image() {
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# taken from Magisk, with minor modifications for NanoDroid
|
|
|
|
|
mount_partitions () {
|
|
|
|
|
SLOT=$(getprop ro.boot.slot_suffix)
|
|
|
|
|
if [ -z ${SLOT} ]; then
|
|
|
|
|
SLOT=$(getprop ro.boot.slot)
|
|
|
|
|
[ "${SLOT}" = "_" ] && SLOT=
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
is_mounted /data || mount /data 2>/dev/null
|
|
|
|
|
|
|
|
|
|
${BOOTMODE} || mount -o bind /dev/urandom /dev/random
|
|
|
|
|
|
|
|
|
|
[ ! -f /system/build.prop ] && mount -o ro /system 2>/dev/null
|
|
|
|
|
|
|
|
|
|
if [ ! -f /system/build.prop ]; then
|
|
|
|
|
SYSTEMBLOCK=$(find /dev/block -iname system${SLOT} | head -n 1)
|
|
|
|
|
mount -t ext4 -o ro $SYSTEMBLOCK /system
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ -f /system/init.rc ]; then
|
|
|
|
|
mkdir /system_root 2>/dev/null
|
|
|
|
|
mount --move /system /system_root
|
|
|
|
|
mount -o bind /system_root/system /system
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
[ ! -f /system/build.prop ] && error "failed to mount /system"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
error () {
|
|
|
|
|
ui_print "${@}"
|
|
|
|
|
magisk_cleanup
|
|
|
|
@ -454,11 +482,7 @@ nanodroid_sigspoofui=0
|
|
|
|
|
get_config .nanodroid-setup
|
|
|
|
|
[ "$config_exists" -eq 1 ] && source ${config}
|
|
|
|
|
|
|
|
|
|
if ! (is_mounted /data); then
|
|
|
|
|
mount -orw /data || error " !! failed to mount /data"
|
|
|
|
|
else mount -orw,remount /data || \
|
|
|
|
|
error " !! failed to remount /data read-write"
|
|
|
|
|
fi
|
|
|
|
|
mount_partition
|
|
|
|
|
|
|
|
|
|
if [ -f /data/adb/.nanodroid-patcher ]; then
|
|
|
|
|
ui_print " !! /data/adb/.nanodroid-patcher exists"
|
|
|
|
@ -466,12 +490,6 @@ if [ -f /data/adb/.nanodroid-patcher ]; then
|
|
|
|
|
error " !! remove this file and try again"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if ! (is_mounted /system); then
|
|
|
|
|
mount -orw /system || error " !! failed to mount /system"
|
|
|
|
|
else mount -orw,remount /system || \
|
|
|
|
|
error " !! failed to remount /system read-write"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
setup_patcher
|
|
|
|
|
|
|
|
|
|
detect_sdk
|
|
|
|
|