From 3b8b61bf3579fcaa9b8000764d8c9dd9ff5f0ad7 Mon Sep 17 00:00:00 2001
From: topjohnwu <topjohnwu@gmail.com>
Date: Thu, 20 Mar 2025 14:54:25 -0700
Subject: [PATCH] Remove ZipUtils.kt

---
 .../topjohnwu/magisk/core/utils/ZipUtils.kt   | 50 -------------------
 1 file changed, 50 deletions(-)
 delete mode 100644 app/core/src/main/java/com/topjohnwu/magisk/core/utils/ZipUtils.kt

diff --git a/app/core/src/main/java/com/topjohnwu/magisk/core/utils/ZipUtils.kt b/app/core/src/main/java/com/topjohnwu/magisk/core/utils/ZipUtils.kt
deleted file mode 100644
index af0b024c6..000000000
--- a/app/core/src/main/java/com/topjohnwu/magisk/core/utils/ZipUtils.kt
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.topjohnwu.magisk.core.utils
-
-import com.topjohnwu.magisk.core.ktx.copyAll
-import org.apache.commons.compress.archivers.zip.ZipArchiveEntry
-import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream
-import org.apache.commons.compress.archivers.zip.ZipFile
-import java.io.File
-import java.io.IOException
-import java.io.InputStream
-
-@Throws(IOException::class)
-suspend fun File.unzip(folder: File, path: String = "", junkPath: Boolean = false) {
-    ZipFile.Builder().setFile(this).get().use { zip ->
-        for (entry in zip.entries) {
-            if (!entry.name.startsWith(path) || entry.isDirectory) {
-                // Ignore directories, only create files
-                continue
-            }
-            val name = if (junkPath)
-                entry.name.substring(entry.name.lastIndexOf('/') + 1)
-            else
-                entry.name
-            val dest = File(folder, name)
-            dest.parentFile?.mkdirs()
-            dest.outputStream().use { out -> zip.getInputStream(entry).copyAll(out) }
-        }
-    }
-}
-
-@Throws(IOException::class)
-suspend fun InputStream.unzip(folder: File, path: String = "", junkPath: Boolean = false) {
-    ZipArchiveInputStream(this).use { zin ->
-        var entry: ZipArchiveEntry
-        while (true) {
-            entry = zin.nextEntry ?: break
-            if (!entry.name.startsWith(path) || entry.isDirectory) {
-                // Ignore directories, only create files
-                continue
-            }
-            val name = if (junkPath)
-                entry.name.substring(entry.name.lastIndexOf('/') + 1)
-            else
-                entry.name
-
-            val dest = File(folder, name)
-            dest.parentFile?.mkdirs()
-            dest.outputStream().use { out -> zin.copyAll(out) }
-        }
-    }
-}