More fixes for non-root devices

This commit is contained in:
topjohnwu 2018-06-26 06:04:11 +08:00
parent 4601989d4a
commit 7684602ea8
3 changed files with 7 additions and 2 deletions

View File

@ -27,7 +27,7 @@ android {
productFlavors {
full {
versionCode 120
versionCode 121
versionName "5.7.0"
}
stub {

View File

@ -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();
}

View File

@ -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";