mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-24 02:25:28 +00:00
Update scripts
This commit is contained in:
parent
50d9877446
commit
8664e9d19b
@ -131,7 +131,7 @@ case "$1" in
|
|||||||
else
|
else
|
||||||
initialize
|
initialize
|
||||||
OUTFD=
|
OUTFD=
|
||||||
get_outfd
|
setup_flashable
|
||||||
# Run in background, hack for addon.d-v1
|
# Run in background, hack for addon.d-v1
|
||||||
(main_v1) &
|
(main_v1) &
|
||||||
fi
|
fi
|
||||||
|
@ -31,7 +31,7 @@ fi
|
|||||||
# Load utility fuctions
|
# Load utility fuctions
|
||||||
. $COMMONDIR/util_functions.sh
|
. $COMMONDIR/util_functions.sh
|
||||||
|
|
||||||
get_outfd
|
setup_flashable
|
||||||
|
|
||||||
##########################################################################################
|
##########################################################################################
|
||||||
# Detection
|
# Detection
|
||||||
|
@ -30,7 +30,7 @@ fi
|
|||||||
# Load utility functions
|
# Load utility functions
|
||||||
. $INSTALLER/util_functions.sh
|
. $INSTALLER/util_functions.sh
|
||||||
|
|
||||||
get_outfd
|
setup_flashable
|
||||||
|
|
||||||
ui_print "************************"
|
ui_print "************************"
|
||||||
ui_print " Magisk Uninstaller "
|
ui_print " Magisk Uninstaller "
|
||||||
|
@ -10,19 +10,19 @@
|
|||||||
#MAGISK_VERSION_STUB
|
#MAGISK_VERSION_STUB
|
||||||
|
|
||||||
# Detect whether in boot mode
|
# Detect whether in boot mode
|
||||||
ps | grep zygote | grep -v grep >/dev/null && BOOTMODE=true || BOOTMODE=false
|
ps | grep zygote | grep -qv grep && BOOTMODE=true || BOOTMODE=false
|
||||||
$BOOTMODE || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true
|
$BOOTMODE || ps -A | grep zygote | grep -qv grep && BOOTMODE=true
|
||||||
$BOOTMODE || id | grep -q 'uid=0' || BOOTMODE=true
|
|
||||||
|
|
||||||
# Default location, will override if needed
|
# Presets
|
||||||
MAGISKBIN=/data/adb/magisk
|
[ -z $NVBASE ] && NVBASE=/data/adb
|
||||||
|
[ -z $MAGISKBIN ] && MAGISKBIN=$NVBASE/magisk
|
||||||
|
[ -z $IMG ] && IMG=$NVBASE/magisk.img
|
||||||
[ -z $MOUNTPATH ] && MOUNTPATH=/sbin/.core/img
|
[ -z $MOUNTPATH ] && MOUNTPATH=/sbin/.core/img
|
||||||
[ -z $IMG ] && IMG=/data/adb/magisk.img
|
|
||||||
|
|
||||||
BOOTSIGNER="/system/bin/dalvikvm -Xnodex2oat -Xnoimage-dex2oat -cp \$APK com.topjohnwu.magisk.utils.BootSigner"
|
BOOTSIGNER="/system/bin/dalvikvm -Xnodex2oat -Xnoimage-dex2oat -cp \$APK com.topjohnwu.magisk.utils.BootSigner"
|
||||||
BOOTSIGNED=false
|
BOOTSIGNED=false
|
||||||
|
|
||||||
get_outfd() {
|
setup_flashable() {
|
||||||
$BOOTMODE && return
|
$BOOTMODE && return
|
||||||
# Preserve environment varibles
|
# Preserve environment varibles
|
||||||
OLD_PATH=$PATH
|
OLD_PATH=$PATH
|
||||||
@ -40,6 +40,11 @@ get_outfd() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Backward compatibility
|
||||||
|
get_outfd() {
|
||||||
|
setup_flashable
|
||||||
|
}
|
||||||
|
|
||||||
ui_print() {
|
ui_print() {
|
||||||
$BOOTMODE && echo "$1" || echo -e "ui_print $1\nui_print" >> /proc/self/fd/$OUTFD
|
$BOOTMODE && echo "$1" || echo -e "ui_print $1\nui_print" >> /proc/self/fd/$OUTFD
|
||||||
}
|
}
|
||||||
@ -250,7 +255,7 @@ is_mounted() {
|
|||||||
|
|
||||||
remove_system_su() {
|
remove_system_su() {
|
||||||
if [ -f /system/bin/su -o -f /system/xbin/su ] && [ ! -f /su/bin/su ]; then
|
if [ -f /system/bin/su -o -f /system/xbin/su ] && [ ! -f /su/bin/su ]; then
|
||||||
ui_print "! System installed root detected, mount rw :("
|
ui_print "- Removing system installed root"
|
||||||
mount -o rw,remount /system
|
mount -o rw,remount /system
|
||||||
# SuperSU
|
# SuperSU
|
||||||
if [ -e /system/bin/.ext/.su ]; then
|
if [ -e /system/bin/.ext/.su ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user