From 64bae884dcb72550a3218e149f3ca0fd0ca03aaf Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Wed, 22 Jun 2022 03:19:39 +0200 Subject: [PATCH] feat: use streams to write the dex files --- src/main/kotlin/app/revanced/patcher/Patcher.kt | 2 +- src/main/kotlin/app/revanced/patcher/util/dex/DexFile.kt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/app/revanced/patcher/Patcher.kt b/src/main/kotlin/app/revanced/patcher/Patcher.kt index b10cbb6..fc5668a 100644 --- a/src/main/kotlin/app/revanced/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/patcher/Patcher.kt @@ -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 diff --git a/src/main/kotlin/app/revanced/patcher/util/dex/DexFile.kt b/src/main/kotlin/app/revanced/patcher/util/dex/DexFile.kt index 1ddd2a9..f11456d 100644 --- a/src/main/kotlin/app/revanced/patcher/util/dex/DexFile.kt +++ b/src/main/kotlin/app/revanced/patcher/util/dex/DexFile.kt @@ -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) \ No newline at end of file +data class DexFile(val name: String, val dexFileInputStream: InputStream) \ No newline at end of file