Skip to content

Commit

Permalink
fix: seekbar-tapping toggling (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rkk3y committed Aug 29, 2022
1 parent fd09a3c commit 33ece5b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class EnableSeekbarTappingPatch : BytecodePatch(
if (instruction.opcode != Opcode.INVOKE_VIRTUAL) return PatchResultError("Could not find the correct register")
val register = (instruction as Instruction35c).registerC

val elseLabel = implementation.newLabelForIndex(result.patternScanResult!!.endIndex + 1)
// the instructions are written in reverse order.
result.mutableMethod.addInstructions(
result.patternScanResult!!.endIndex + 1, """
Expand All @@ -93,7 +94,6 @@ class EnableSeekbarTappingPatch : BytecodePatch(
)

// if tap-seeking is disabled, do not invoke the two methods above by jumping to the else label
val elseLabel = implementation.newLabelForIndex(result.patternScanResult!!.endIndex + 1)
implementation.addInstruction(
result.patternScanResult!!.endIndex + 1, BuilderInstruction21t(Opcode.IF_EQZ, 0, elseLabel)
)
Expand Down

0 comments on commit 33ece5b

Please sign in to comment.