mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-03 14:14:26 +02:00
fix: use instruction index instead of strings list index for StringMatch
This commit is contained in:
parent
9c07ffcc7a
commit
843e62ad29
@ -102,17 +102,17 @@ abstract class MethodFingerprint(
|
|||||||
|
|
||||||
val stringsList = methodFingerprint.strings.toMutableList()
|
val stringsList = methodFingerprint.strings.toMutableList()
|
||||||
|
|
||||||
implementation.instructions.forEach { instruction ->
|
implementation.instructions.forEachIndexed { instructionIndex, instruction ->
|
||||||
if (instruction.opcode.ordinal != Opcode.CONST_STRING.ordinal) return@forEach
|
if (instruction.opcode.ordinal != Opcode.CONST_STRING.ordinal) return@forEachIndexed
|
||||||
|
|
||||||
val string = ((instruction as ReferenceInstruction).reference as StringReference).string
|
val string = ((instruction as ReferenceInstruction).reference as StringReference).string
|
||||||
val index = stringsList.indexOfFirst { it == string }
|
val index = stringsList.indexOfFirst { it == string }
|
||||||
if (index == -1) return@forEach
|
if (index == -1) return@forEachIndexed
|
||||||
|
|
||||||
add(
|
add(
|
||||||
StringMatch(
|
StringMatch(
|
||||||
string,
|
string,
|
||||||
index
|
instructionIndex
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
stringsList.removeAt(index)
|
stringsList.removeAt(index)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user