chore: Merge branch dev to main (#5)

This commit is contained in:
oSumAtrIX
2023-09-24 23:59:58 +02:00
committed by GitHub
3 changed files with 14 additions and 2 deletions

View File

@@ -1,3 +1,10 @@
## [1.0.1-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.0.0...v1.0.1-dev.1) (2023-09-24)
### Bug Fixes
* Check if file exists before trying to open it ([8ddc6e9](https://github.com/ReVanced/revanced-library/commit/8ddc6e9d6f3c41c1528e0d43156d7d811dd6be40))
# 1.0.0 (2023-09-23)

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 1.0.0
version = 1.0.1-dev.1

View File

@@ -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