mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-12-11 20:57:49 +01:00
fix: Only open files for reading and writing if writeable
This commit is contained in:
parent
f199298317
commit
3846f721ca
@ -13,7 +13,7 @@ import java.util.zip.Deflater
|
|||||||
class ZipFile(file: File) : Closeable {
|
class ZipFile(file: File) : Closeable {
|
||||||
private var entries: MutableList<ZipEntry> = mutableListOf()
|
private var entries: MutableList<ZipEntry> = 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 var centralDirectoryNeedsRewrite = false
|
||||||
|
|
||||||
private val compressionLevel = 5
|
private val compressionLevel = 5
|
||||||
|
Loading…
Reference in New Issue
Block a user