diff --git a/src/main/kotlin/app/revanced/patcher/Patcher.kt b/src/main/kotlin/app/revanced/patcher/Patcher.kt index 263b7c4..6a0320c 100644 --- a/src/main/kotlin/app/revanced/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/patcher/Patcher.kt @@ -137,6 +137,7 @@ class Patcher(private val options: PatcherOptions) { fun save(): PatcherResult { val packageMetadata = data.packageMetadata val metaInfo = packageMetadata.metaInfo + var resourceFile: ExtFile? = null if (options.patchResources) { val cacheDirectory = ExtFile(options.resourceCacheDirectory) @@ -177,9 +178,7 @@ class Patcher(private val options: PatcherOptions) { null, includedFiles ) - // write packaged resources to cache directory - ExtFile(aaptFile).directory.copyToDir(cacheDirectory.resolve("build/")) - + resourceFile = ExtFile(aaptFile) } val newDexFile = object : DexFile { @@ -204,7 +203,8 @@ class Patcher(private val options: PatcherOptions) { dexFiles.map { app.revanced.patcher.util.dex.DexFile(it.key, it.value) }, - metaInfo.doNotCompress.toList() + metaInfo.doNotCompress.toList(), + resourceFile ) } diff --git a/src/main/kotlin/app/revanced/patcher/PatcherResult.kt b/src/main/kotlin/app/revanced/patcher/PatcherResult.kt index beb304c..acecd7b 100644 --- a/src/main/kotlin/app/revanced/patcher/PatcherResult.kt +++ b/src/main/kotlin/app/revanced/patcher/PatcherResult.kt @@ -1,6 +1,7 @@ package app.revanced.patcher import app.revanced.patcher.util.dex.DexFile +import brut.directory.ExtFile /** * The result of a patcher. @@ -9,5 +10,6 @@ import app.revanced.patcher.util.dex.DexFile */ data class PatcherResult( val dexFiles: List, - val doNotCompress: List? = null + val doNotCompress: List? = null, + val resourceFile: ExtFile? ) \ No newline at end of file