mirror of
https://github.com/revanced/revanced-patches
synced 2025-01-31 18:37:35 +01:00
fix(SoundCloud - Enable offline sync): Stop crashing by reversing order of patching instructions from last to first to retain indices
This commit is contained in:
parent
1fa4d3f4e9
commit
63b6cede5f
@ -73,7 +73,7 @@ object EnableOfflineSyncPatch : BytecodePatch(
|
|||||||
// The first three null checks need to be patched.
|
// The first three null checks need to be patched.
|
||||||
getInstructions().asSequence().filter {
|
getInstructions().asSequence().filter {
|
||||||
it.opcode == Opcode.IF_EQZ
|
it.opcode == Opcode.IF_EQZ
|
||||||
}.take(3).map { it.location.index }.forEach { nullCheckIndex ->
|
}.take(3).toList().map { it.location.index }.asReversed().forEach { nullCheckIndex ->
|
||||||
val headerStringRegister = getInstruction<OneRegisterInstruction>(nullCheckIndex).registerA
|
val headerStringRegister = getInstruction<OneRegisterInstruction>(nullCheckIndex).registerA
|
||||||
|
|
||||||
addInstruction(nullCheckIndex, "const-string v$headerStringRegister, \"\"")
|
addInstruction(nullCheckIndex, "const-string v$headerStringRegister, \"\"")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user