Skip to content

Commit

Permalink
fix: replaceWith not replacing classes with used class proxies
Browse files Browse the repository at this point in the history
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
  • Loading branch information
oSumAtrIX committed Apr 14, 2022
1 parent 560c485 commit f0f3403
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/kotlin/app/revanced/patcher/Patcher.kt
Expand Up @@ -70,12 +70,13 @@ class Patcher(
fun save(): Map<String, MemoryDataStore> {
val newDexFile = object : DexFile {
private fun MutableList<ClassDef>.replaceWith(proxy: ClassProxy) {
if (proxy.proxyUsed) return
this[proxy.originalIndex] = proxy.mutatedClass
}

override fun getClasses(): Set<ClassDef> {
for (proxy in patcherData.classProxies) {
if (!proxy.proxyUsed) continue

patcherData.classes.replaceWith(proxy)
}
for (patch in patcherData.patches) {
Expand Down

0 comments on commit f0f3403

Please sign in to comment.