mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-11 21:48:28 +01:00
fix(Duolingo - Unlock Super): Get correct instruction offset (#3023)
This commit is contained in:
parent
0e0b73521c
commit
5146de872a
@ -54,8 +54,8 @@ object UnlockDuolingoSuperPatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun MutableMethod.indexOfReference(reference: Reference) = getInstructions()
|
private fun MutableMethod.indexOfReference(reference: Reference) = getInstructions()
|
||||||
.filterIsInstance<BuilderInstruction22c>()
|
.indexOfFirst { it is BuilderInstruction22c && it.opcode == Opcode.IPUT_BOOLEAN && it.reference == reference }
|
||||||
.filter { it.opcode == Opcode.IPUT_BOOLEAN }.indexOfFirst { it.reference == reference }.let {
|
.let {
|
||||||
if (it == -1) throw PatchException("Could not find index of instruction with supplied reference.")
|
if (it == -1) throw PatchException("Could not find index of instruction with supplied reference.")
|
||||||
else it
|
else it
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user