fix: replaceWith not replacing classes with used class proxies

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
oSumAtrIX 2022-04-14 11:00:25 +02:00
parent 560c485ab0
commit f0f34031dd
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4

View file

@ -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) {