mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 09:08:04 +01:00
fix: replaceWith
not replacing classes with used class proxies
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
338bd9f739
commit
4178a1eedc
1 changed files with 2 additions and 1 deletions
|
@ -70,12 +70,13 @@ class Patcher(
|
||||||
fun save(): Map<String, MemoryDataStore> {
|
fun save(): Map<String, MemoryDataStore> {
|
||||||
val newDexFile = object : DexFile {
|
val newDexFile = object : DexFile {
|
||||||
private fun MutableList<ClassDef>.replaceWith(proxy: ClassProxy) {
|
private fun MutableList<ClassDef>.replaceWith(proxy: ClassProxy) {
|
||||||
if (proxy.proxyUsed) return
|
|
||||||
this[proxy.originalIndex] = proxy.mutatedClass
|
this[proxy.originalIndex] = proxy.mutatedClass
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getClasses(): Set<ClassDef> {
|
override fun getClasses(): Set<ClassDef> {
|
||||||
for (proxy in patcherData.classProxies) {
|
for (proxy in patcherData.classProxies) {
|
||||||
|
if (!proxy.proxyUsed) continue
|
||||||
|
|
||||||
patcherData.classes.replaceWith(proxy)
|
patcherData.classes.replaceWith(proxy)
|
||||||
}
|
}
|
||||||
for (patch in patcherData.patches) {
|
for (patch in patcherData.patches) {
|
||||||
|
|
Loading…
Reference in a new issue