Skip to content

Commit

Permalink
Work in progress fix for wrong fingerprint indexes found when multipl…
Browse files Browse the repository at this point in the history
…e patches modify the same code
  • Loading branch information
LisoUseInAIKyrios committed Jan 27, 2025
1 parent 1dacd3d commit b08ef19
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/kotlin/app/revanced/patcher/Fingerprint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ class Fingerprint internal constructor(
}

classes.forEach { classDef ->
val match = matchOrNull(classDef)
// Must use mutable class/method if it exists, otherwise if multiple patches
// modify the same method then the match indexes can be wrong.
// FIXME: This is too slow.
val classDefToUse = classes.proxyPool.find {
it.immutableClass.type == classDef.type
}?.mutableClass ?: classDef

val match = matchOrNull(classDefToUse)
if (match != null) {
_matchOrNull = match
return match
Expand Down

0 comments on commit b08ef19

Please sign in to comment.