From 8794141b7f2773a5ce128914aaee0e46da9f803f Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 30 Jan 2021 00:56:16 -0800 Subject: [PATCH] Support super old emulators --- scripts/emulator.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/emulator.sh b/scripts/emulator.sh index 8acece95e..af894491b 100755 --- a/scripts/emulator.sh +++ b/scripts/emulator.sh @@ -29,7 +29,14 @@ mount_sbin() { if [ ! -f /system/build.prop ]; then # Running on PC cd "$(dirname "$0")/.." - adb push native/out/x86/busybox scripts/emulator.sh native/out/x86/magiskinit native/out/x86_64/magisk /data/local/tmp + 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 shell sh /data/local/tmp/emulator.sh exit 0 fi