From 0ad66875abd25d2f23c914c2cf410484eb0cf8b2 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Thu, 27 Jan 2022 21:26:31 +0800 Subject: [PATCH] Fix crash when zip is malformat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 南宫雪珊 Co-authored-by: 残页 <31466456+canyie@users.noreply.github.com> --- .../main/java/com/topjohnwu/magisk/core/utils/ZipUtils.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/core/utils/ZipUtils.kt b/app/src/main/java/com/topjohnwu/magisk/core/utils/ZipUtils.kt index 57f8a21f7..758efe27b 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/utils/ZipUtils.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/utils/ZipUtils.kt @@ -38,8 +38,7 @@ fun InputStream.unzip(folder: File, path: String, junkPath: Boolean) { } SuFileOutputStream.open(dest).use { out -> zin.copyTo(out) } } - } catch (e: IOException) { - e.printStackTrace() - throw e + } catch (e: IllegalArgumentException) { + throw IOException(e) } }