From 4178a1eedce1436ffeb3ddd6952ce0b6ec87d5a0 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Thu, 14 Apr 2022 11:00:25 +0200 Subject: [PATCH] fix: `replaceWith` not replacing classes with used class proxies Signed-off-by: oSumAtrIX --- src/main/kotlin/app/revanced/patcher/Patcher.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patcher/Patcher.kt b/src/main/kotlin/app/revanced/patcher/Patcher.kt index c2cbcd8..82050d3 100644 --- a/src/main/kotlin/app/revanced/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/patcher/Patcher.kt @@ -70,12 +70,13 @@ class Patcher( fun save(): Map { val newDexFile = object : DexFile { private fun MutableList.replaceWith(proxy: ClassProxy) { - if (proxy.proxyUsed) return this[proxy.originalIndex] = proxy.mutatedClass } override fun getClasses(): Set { for (proxy in patcherData.classProxies) { + if (!proxy.proxyUsed) continue + patcherData.classes.replaceWith(proxy) } for (patch in patcherData.patches) {