fix: seekbar-tapping toggling (#401)

This commit is contained in:
d4rkk3y 2022-08-29 23:20:25 +07:00 committed by GitHub
parent 6739e7b94c
commit 55502446ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,6 +84,7 @@ class EnableSeekbarTappingPatch : BytecodePatch(
if (instruction.opcode != Opcode.INVOKE_VIRTUAL) return PatchResultError("Could not find the correct register") if (instruction.opcode != Opcode.INVOKE_VIRTUAL) return PatchResultError("Could not find the correct register")
val register = (instruction as Instruction35c).registerC val register = (instruction as Instruction35c).registerC
val elseLabel = implementation.newLabelForIndex(result.patternScanResult!!.endIndex + 1)
// the instructions are written in reverse order. // the instructions are written in reverse order.
result.mutableMethod.addInstructions( result.mutableMethod.addInstructions(
result.patternScanResult!!.endIndex + 1, """ result.patternScanResult!!.endIndex + 1, """
@ -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 // 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( implementation.addInstruction(
result.patternScanResult!!.endIndex + 1, BuilderInstruction21t(Opcode.IF_EQZ, 0, elseLabel) result.patternScanResult!!.endIndex + 1, BuilderInstruction21t(Opcode.IF_EQZ, 0, elseLabel)
) )