mirror of
https://github.com/ReVanced/revanced-library.git
synced 2026-01-11 13:56:17 +00:00
fix: Check if file exists before trying to open it
This commit is contained in:
@@ -13,7 +13,12 @@ import java.util.zip.Deflater
|
||||
class ZipFile(file: File) : Closeable {
|
||||
private var entries: MutableList<ZipEntry> = mutableListOf()
|
||||
|
||||
private val filePointer: RandomAccessFile = RandomAccessFile(file, if (file.canWrite()) "rw" else "r")
|
||||
// Open file for writing if it doesn't exist (because the intention is to write) or is writable.
|
||||
private val filePointer: RandomAccessFile = RandomAccessFile(
|
||||
file,
|
||||
if (!file.exists() || file.canWrite()) "rw" else "r"
|
||||
)
|
||||
|
||||
private var centralDirectoryNeedsRewrite = false
|
||||
|
||||
private val compressionLevel = 5
|
||||
|
||||
Reference in New Issue
Block a user