mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 09:08:04 +01:00
fix: use instruction index instead of strings list index for StringMatch
This commit is contained in:
parent
9c07ffcc7a
commit
843e62ad29
1 changed files with 4 additions and 4 deletions
|
@ -102,17 +102,17 @@ abstract class MethodFingerprint(
|
|||
|
||||
val stringsList = methodFingerprint.strings.toMutableList()
|
||||
|
||||
implementation.instructions.forEach { instruction ->
|
||||
if (instruction.opcode.ordinal != Opcode.CONST_STRING.ordinal) return@forEach
|
||||
implementation.instructions.forEachIndexed { instructionIndex, instruction ->
|
||||
if (instruction.opcode.ordinal != Opcode.CONST_STRING.ordinal) return@forEachIndexed
|
||||
|
||||
val string = ((instruction as ReferenceInstruction).reference as StringReference).string
|
||||
val index = stringsList.indexOfFirst { it == string }
|
||||
if (index == -1) return@forEach
|
||||
if (index == -1) return@forEachIndexed
|
||||
|
||||
add(
|
||||
StringMatch(
|
||||
string,
|
||||
index
|
||||
instructionIndex
|
||||
)
|
||||
)
|
||||
stringsList.removeAt(index)
|
||||
|
|
Loading…
Reference in a new issue