diff --git a/build.gradle b/build.gradle index fdb4591f4..18f887f12 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ android { productFlavors { full { - versionCode 120 + versionCode 121 versionName "5.7.0" } stub { diff --git a/src/full/java/com/topjohnwu/magisk/utils/ZipUtils.java b/src/full/java/com/topjohnwu/magisk/utils/ZipUtils.java index d838020a7..f18eb7017 100644 --- a/src/full/java/com/topjohnwu/magisk/utils/ZipUtils.java +++ b/src/full/java/com/topjohnwu/magisk/utils/ZipUtils.java @@ -41,7 +41,7 @@ public class ZipUtils { name = entry.getName(); } File dest = new File(folder, name); - if (!dest.getParentFile().mkdirs()) { + if (!dest.getParentFile().exists() && !dest.getParentFile().mkdirs()) { dest = new SuFile(folder, name); dest.getParentFile().mkdirs(); } diff --git a/src/main/java/com/topjohnwu/magisk/utils/Const.java b/src/main/java/com/topjohnwu/magisk/utils/Const.java index 528a6689e..9b10dff15 100644 --- a/src/main/java/com/topjohnwu/magisk/utils/Const.java +++ b/src/main/java/com/topjohnwu/magisk/utils/Const.java @@ -28,6 +28,11 @@ public class Const { public static File MAGISK_DISABLE_FILE; public static File MAGISK_HOST_FILE; + static { + /* Prevent crashing on unrooted devices */ + MAGISK_PATH = MAGISK_DISABLE_FILE = MAGISK_HOST_FILE = new File("xxx"); + } + public static final String BUSYBOX_PATH = "/sbin/.core/busybox"; public static final String TMP_FOLDER_PATH = "/dev/tmp"; public static final String MAGISK_LOG = "/cache/magisk.log";