Some cleanups

This commit is contained in:
topjohnwu
2018-08-01 03:09:44 +08:00
parent 863b9a410f
commit e90c555c18
6 changed files with 13 additions and 15 deletions
@@ -231,10 +231,11 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
private void outputBoot(File patched) throws IOException {
switch (mode) {
case PATCH_MODE:
File dest = new File(Download.EXTERNAL_PATH, "patched_boot" + Data.bootFormat);
String fmt = mm.prefs.getString(Const.Key.BOOT_FORMAT, ".img");
File dest = new File(Download.EXTERNAL_PATH, "patched_boot" + fmt);
dest.getParentFile().mkdirs();
OutputStream out;
switch (Data.bootFormat) {
switch (fmt) {
case ".img.tar":
out = new TarOutputStream(new BufferedOutputStream(new FileOutputStream(dest)));
((TarOutputStream) out).putNextEntry(new TarEntry(patched, "boot.img"));