From ff36f2ba17a63359395daa1bced28e2a12c17859 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Thu, 9 Aug 2018 03:01:33 +0800 Subject: [PATCH] Add 1 more byte to mark Prevent crashes on higher Android versions --- .../full/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 97aec05a1..ceccf23d3 100644 --- a/app/src/full/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java +++ b/app/src/full/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java @@ -147,7 +147,7 @@ public class InstallMagisk extends ParallelTask { console.add("- Downloading zip"); HttpURLConnection conn = WebService.mustRequest(Data.magiskLink, null); buf = new BufferedInputStream(new ProgressStream(conn), conn.getContentLength()); - buf.mark(conn.getContentLength()); + buf.mark(conn.getContentLength() + 1); try (OutputStream out = new FileOutputStream(zip)) { ShellUtils.pump(buf, out); } @@ -156,7 +156,7 @@ public class InstallMagisk extends ParallelTask { } else { console.add("- Existing zip found"); buf = new BufferedInputStream(new FileInputStream(zip), (int) zip.length()); - buf.mark((int) zip.length()); + buf.mark((int) zip.length() + 1); } console.add("- Extracting files");