From e5638e4b1542497bfb2ba43c5ed3b437bdfcaae0 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 29 Apr 2018 14:39:03 +0800 Subject: [PATCH] Prevent installing 32-bit binaries on older versions --- .../topjohnwu/magisk/asyncs/InstallMagisk.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java b/src/main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java index a8d06eda9..ab7547265 100644 --- a/src/main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java +++ b/src/main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java @@ -76,10 +76,18 @@ public class InstallMagisk extends ParallelTask { List abis = Arrays.asList(Build.SUPPORTED_ABIS); String arch; - if (abis.contains("x86")) - arch = "x86"; - else - arch = "arm"; + + if (mm.remoteMagiskVersionCode >= Const.MAGISK_VER.SEPOL_REFACTOR) { + // 32-bit only + if (abis.contains("x86")) arch = "x86"; + else arch = "arm"; + } else { + if (abis.contains("x86_64")) arch = "x64"; + else if (abis.contains("arm64-v8a")) arch = "arm64"; + else if (abis.contains("x86")) arch = "x86"; + else arch = "arm"; + } + console.add("- Device platform: " + Build.SUPPORTED_ABIS[0]); try {