mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-06-12 21:27:41 +02:00
Remove more pre SDK 21 stuffs
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
# in the emulator. The constructed Magisk environment is not a
|
||||
# fully functional one as if it is running on an actual device.
|
||||
#
|
||||
# The script assumes you are using x86/x64 emulator images.
|
||||
# The script assumes you are using x64 emulator images.
|
||||
# Build binaries with `./build.py binary` before running this script.
|
||||
#
|
||||
#####################################################################
|
||||
@ -29,14 +29,8 @@ mount_sbin() {
|
||||
if [ ! -f /system/build.prop ]; then
|
||||
# Running on PC
|
||||
cd "$(dirname "$0")/.."
|
||||
tmp="/data/local/tmp"
|
||||
adb push native/out/x86/busybox native/out/x86/magiskinit scripts/emulator.sh $tmp
|
||||
emu_arch=$(adb shell "chmod 777 $tmp/busybox; $tmp/busybox uname -m")
|
||||
if [ "$emu_arch" = "x86_64" ]; then
|
||||
adb push native/out/x86_64/magisk /data/local/tmp
|
||||
else
|
||||
adb push native/out/x86/magisk /data/local/tmp
|
||||
fi
|
||||
adb push native/out/x86/busybox native/out/x86/magiskinit \
|
||||
native/out/x86_64/magisk scripts/emulator.sh /data/local/tmp
|
||||
adb shell sh /data/local/tmp/emulator.sh
|
||||
exit 0
|
||||
fi
|
||||
@ -89,7 +83,7 @@ elif [ -e /sbin ]; then
|
||||
mount_sbin
|
||||
if ! grep -q '/sbin/.magisk/mirror/system_root' /proc/mounts; then
|
||||
mkdir -p /sbin/.magisk/mirror/system_root
|
||||
block=`mount | grep ' / ' | awk '{ print $1 }'`
|
||||
block=$(mount | grep ' / ' | awk '{ print $1 }')
|
||||
[ $block = "/dev/root" ] && block=/dev/block/dm-0
|
||||
mount -o ro $block /sbin/.magisk/mirror/system_root
|
||||
fi
|
||||
@ -98,7 +92,7 @@ elif [ -e /sbin ]; then
|
||||
if [ -L $file ]; then
|
||||
cp -af $file /sbin
|
||||
else
|
||||
sfile=/sbin/`basename $file`
|
||||
sfile=/sbin/$(basename $file)
|
||||
touch $sfile
|
||||
mount -o bind $file $sfile
|
||||
fi
|
||||
|
@ -48,7 +48,7 @@ ui_print "- Target image: $BOOTIMAGE"
|
||||
# Detect version and architecture
|
||||
api_level_arch_detect
|
||||
|
||||
[ $API -lt 17 ] && abort "! Magisk only support Android 4.2 and above"
|
||||
[ $API -lt 21 ] && abort "! Magisk only support Android 5.0 and above"
|
||||
|
||||
ui_print "- Device platform: $ARCH"
|
||||
|
||||
|
@ -448,7 +448,7 @@ flash_image() {
|
||||
install_magisk() {
|
||||
cd $MAGISKBIN
|
||||
|
||||
if [ $API -ge 21 -a ! -c $BOOTIMAGE ]; then
|
||||
if [ ! -c $BOOTIMAGE ]; then
|
||||
eval $BOOTSIGNER -verify < $BOOTIMAGE && BOOTSIGNED=true
|
||||
$BOOTSIGNED && ui_print "- Boot image is signed with AVB 1.0"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user