Skip to content

Commit

Permalink
feat: use streams to write the dex files
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Jun 22, 2022
1 parent e94a706 commit 64bae88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/app/revanced/patcher/Patcher.kt
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions 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)
data class DexFile(val name: String, val dexFileInputStream: InputStream)

0 comments on commit 64bae88

Please sign in to comment.