diff --git a/revanced-lib/src/main/kotlin/app/revanced/lib/zip/ZipFile.kt b/revanced-lib/src/main/kotlin/app/revanced/lib/zip/ZipFile.kt index c4054c03..217f21ed 100644 --- a/revanced-lib/src/main/kotlin/app/revanced/lib/zip/ZipFile.kt +++ b/revanced-lib/src/main/kotlin/app/revanced/lib/zip/ZipFile.kt @@ -13,7 +13,7 @@ import java.util.zip.Deflater class ZipFile(file: File) : Closeable { private var entries: MutableList = mutableListOf() - private val filePointer: RandomAccessFile = RandomAccessFile(file, "rw") + private val filePointer: RandomAccessFile = RandomAccessFile(file, if (file.canWrite()) "rw" else "r") private var centralDirectoryNeedsRewrite = false private val compressionLevel = 5