feat: use streams to write the dex files

This commit is contained in:
oSumAtrIX 2022-06-22 03:19:39 +02:00
parent e94a706949
commit 64bae884dc
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4
2 changed files with 5 additions and 5 deletions

View file

@ -201,7 +201,7 @@ class Patcher(private val options: PatcherOptions) {
return PatcherResult(
dexFiles.map {
app.revanced.patcher.util.dex.DexFile(it.key, it.value)
app.revanced.patcher.util.dex.DexFile(it.key, it.value.readAt(0))
},
metaInfo.doNotCompress.toList(),
resourceFile

View file

@ -1,10 +1,10 @@
package app.revanced.patcher.util.dex
import org.jf.dexlib2.writer.io.MemoryDataStore
import java.io.InputStream
/**
* Wrapper for dex files.
* @param name The original name of the dex file
* @param memoryDataStore The data store for the dex file.
* @param name The original name of the dex file.
* @param dexFileInputStream The dex file as [InputStream].
*/
data class DexFile(val name: String, val memoryDataStore: MemoryDataStore)
data class DexFile(val name: String, val dexFileInputStream: InputStream)