mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 09:08:04 +01:00
refactor: Replacing original classes with mutated ones
This commit is contained in:
parent
e6c2501539
commit
1dd3394ea3
1 changed files with 4 additions and 3 deletions
|
@ -29,12 +29,13 @@ class Patcher(
|
|||
val newDexFile = object : DexFile {
|
||||
override fun getClasses(): Set<ClassDef> {
|
||||
// this is a slow workaround for now
|
||||
val mutableClassList = cache.classes.toMutableList()
|
||||
val classes = cache.classes.toMutableSet()
|
||||
cache.classProxy
|
||||
.filter { it.proxyUsed }.forEach { proxy ->
|
||||
mutableClassList[proxy.originalIndex] = proxy.mutatedClass
|
||||
classes.remove(classes.elementAt(proxy.originalIndex))
|
||||
classes.add(proxy.mutatedClass)
|
||||
}
|
||||
return mutableClassList.toSet()
|
||||
return classes
|
||||
}
|
||||
|
||||
override fun getOpcodes(): Opcodes {
|
||||
|
|
Loading…
Reference in a new issue