From d1b290b91a24bc4347965146a3931cafefca8006 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 3 Aug 2018 22:41:53 +0800 Subject: [PATCH] Fix install failure --- .../full/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/full/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java b/app/src/full/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java index 3257972d0..98002f83a 100644 --- a/app/src/full/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java +++ b/app/src/full/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java @@ -141,7 +141,9 @@ public class InstallMagisk extends ParallelTask { HttpURLConnection conn = WebService.mustRequest(Data.magiskLink, null); BufferedInputStream buf = new BufferedInputStream(new ProgressStream(conn)); buf.mark(Integer.MAX_VALUE); - try (OutputStream out = new FileOutputStream(new File(Download.EXTERNAL_PATH, filename))) { + File zip = new File(Download.EXTERNAL_PATH, filename); + zip.getParentFile().mkdirs(); + try (OutputStream out = new FileOutputStream(zip)) { ShellUtils.pump(buf, out); buf.reset(); }