mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-01 21:54:24 +02:00
fix: callback only when inteded
This commit is contained in:
parent
3d61dacbda
commit
e3bf367ad6
@ -128,8 +128,7 @@ class Patcher(private val options: PatcherOptions) {
|
|||||||
callback: (File) -> Unit
|
callback: (File) -> Unit
|
||||||
) {
|
) {
|
||||||
for (file in files) {
|
for (file in files) {
|
||||||
callback(file)
|
val modified = false
|
||||||
|
|
||||||
for (classDef in MultiDexIO.readDexFile(true, file, NAMER, null, null).classes) {
|
for (classDef in MultiDexIO.readDexFile(true, file, NAMER, null, null).classes) {
|
||||||
val type = classDef.type
|
val type = classDef.type
|
||||||
|
|
||||||
@ -139,7 +138,7 @@ class Patcher(private val options: PatcherOptions) {
|
|||||||
|
|
||||||
logger.trace("Merging $type")
|
logger.trace("Merging $type")
|
||||||
data.bytecodeData.classes.internalClasses.add(classDef)
|
data.bytecodeData.classes.internalClasses.add(classDef)
|
||||||
|
modified = true
|
||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -150,8 +149,9 @@ class Patcher(private val options: PatcherOptions) {
|
|||||||
|
|
||||||
val index = existingClass.second
|
val index = existingClass.second
|
||||||
data.bytecodeData.classes.internalClasses[index] = classDef
|
data.bytecodeData.classes.internalClasses[index] = classDef
|
||||||
|
modified = true
|
||||||
}
|
}
|
||||||
|
if (modified) callback(file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,4 +324,4 @@ private fun BuildOptions.setBuildOptions(options: PatcherOptions) {
|
|||||||
this.aaptPath = options.aaptPath
|
this.aaptPath = options.aaptPath
|
||||||
this.useAapt2 = true
|
this.useAapt2 = true
|
||||||
this.frameworkFolderLocation = options.frameworkFolderLocation
|
this.frameworkFolderLocation = options.frameworkFolderLocation
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user