mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 01:02:22 +01:00
fix: return resourceFile to caller
This commit is contained in:
parent
28d5468b07
commit
1f75777cf9
2 changed files with 7 additions and 5 deletions
|
@ -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
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -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<DexFile>,
|
||||
val doNotCompress: List<String>? = null
|
||||
val doNotCompress: List<String>? = null,
|
||||
val resourceFile: ExtFile?
|
||||
)
|
Loading…
Reference in a new issue