Properly set encryption method when compressing

This commit is contained in:
Ensar Sarajčić 2023-07-07 13:41:02 +02:00
parent 9a640c802c
commit caf2788356
1 changed files with 5 additions and 0 deletions

View File

@ -46,6 +46,7 @@ import kotlinx.android.synthetic.main.item_file_grid.view.*
import kotlinx.android.synthetic.main.item_section.view.*
import net.lingala.zip4j.io.outputstream.ZipOutputStream
import net.lingala.zip4j.model.ZipParameters
import net.lingala.zip4j.model.enums.EncryptionMethod
import java.io.BufferedInputStream
import java.io.Closeable
import java.io.File
@ -652,6 +653,10 @@ class ItemsAdapter(
fun zipEntry(name: String) = ZipParameters().also {
it.fileNameInZip = name
if (password != null) {
it.isEncryptFiles = true
it.encryptionMethod = EncryptionMethod.AES
}
}
try {