Update to libsu 1.2.0

This commit is contained in:
topjohnwu
2018-06-20 04:48:56 +08:00
parent 1df41003ec
commit 4ff39f8817
13 changed files with 72 additions and 77 deletions
@@ -13,7 +13,6 @@ import com.topjohnwu.magisk.MagiskManager;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.container.TarEntry;
import com.topjohnwu.magisk.utils.Const;
import com.topjohnwu.magisk.utils.RootUtils;
import com.topjohnwu.magisk.utils.Utils;
import com.topjohnwu.magisk.utils.ZipUtils;
import com.topjohnwu.superuser.Shell;
@@ -148,9 +147,8 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
case DIRECT_MODE:
console.add("- Patch boot/ramdisk image: " + mBootLocation);
if (mm.remoteMagiskVersionCode >= 1463) {
highCompression = Integer.parseInt(RootUtils.cmd(Utils.fmt(
"%s/magiskboot --parse %s; echo $?",
install, mBootLocation))) == 2;
highCompression = Integer.parseInt(ShellUtils.fastCmd(Utils.fmt(
"%s/magiskboot --parse %s; echo $?", install, mBootLocation))) == 2;
if (highCompression)
console.add("! Insufficient boot partition size detected");
}
@@ -263,6 +261,7 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
.getFilesDir().getParent()
, "install");
Shell.Sync.sh("rm -rf " + install);
install.mkdirs();
}
List<String> abis = Arrays.asList(Build.SUPPORTED_ABIS);
@@ -294,7 +293,7 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
);
} else {
File boot = new File(install, "boot.img");
SuFile patched_boot = new SuFile(install.getParent() + "/new-boot.img", true);
SuFile patched_boot = new SuFile(install.getParent(), "new-boot.img");
if (!dumpBoot(boot) || !patchBoot(boot, patched_boot))
return false;