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 Jun 5, 2022
1 parent 338bd9f commit 4178a1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/kotlin/app/revanced/patcher/Patcher.kt
Original file line number Diff line number Diff line change
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 4178a1e

Please sign in to comment.