Commit ff36f2ba authored by topjohnwu's avatar topjohnwu

Add 1 more byte to mark

Prevent crashes on higher Android versions
parent 5164cfd3
......@@ -147,7 +147,7 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
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<Void, Void, Boolean> {
} 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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment