Welcome to the 64 bit world!

Close #854
This commit is contained in:
topjohnwu
2019-02-24 08:13:27 -05:00
parent ea129fb206
commit 6ca8db2f0c
8 changed files with 61 additions and 58 deletions
@@ -108,7 +108,7 @@ public abstract class MagiskInstaller {
protected boolean extractZip() {
String arch;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (Build.VERSION.SDK_INT >= 21) {
List<String> abis = Arrays.asList(Build.SUPPORTED_ABIS);
arch = abis.contains("x86") ? "x86" : "arm";
} else {
@@ -162,8 +162,6 @@ public abstract class MagiskInstaller {
console.add("! Cannot unzip zip");
return false;
}
Shell.sh(Utils.fmt("chmod -R 755 %s/*; %s/magiskinit -x magisk %s/magisk",
installDir, installDir, installDir)).exec();
return true;
}
@@ -213,14 +211,18 @@ public abstract class MagiskInstaller {
return false;
}
// Patch boot image
if (!Shell.sh(Utils.fmt("cd %s; KEEPFORCEENCRYPT=%b KEEPVERITY=%b " +
Shell.Job job = Shell.sh("cd " + installDir);
if (Build.VERSION.SDK_INT >= 21 && Build.SUPPORTED_64_BIT_ABIS.length != 0) {
job.add("mv -f magiskinit64 magiskinit 2>/dev/null");
} else {
job.add("rm -f magiskinit64 2>/dev/null");
}
if (!job.add(Utils.fmt("KEEPFORCEENCRYPT=%b KEEPVERITY=%b " +
"sh update-binary sh boot_patch.sh %s",
installDir, Config.keepEnc, Config.keepVerity, srcBoot))
.to(console, logs).exec().isSuccess())
Config.keepEnc, Config.keepVerity, srcBoot)).to(console, logs).exec().isSuccess())
return false;
Shell.Job job = Shell.sh("mv bin/busybox busybox",
job = Shell.sh("mv bin/busybox busybox",
"rm -rf magisk.apk bin boot.img update-binary",
"cd /");
+1
View File
@@ -14,6 +14,7 @@ fix_env() {
./busybox rm -f $MAGISKTMP/busybox/*
$MAGISKTMP/mirror/bin/busybox --install -s $MAGISKTMP/busybox
rm -f update-binary magisk.apk
chmod -R 755 .
cd /
}