Skip to content

Commit

Permalink
fix(sponsorblock): dynamically insert setSponsorBarRect call (#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rkk3y committed Sep 27, 2022
1 parent ec1eb2e commit 12af4b1
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ class SponsorBlockBytecodePatch : BytecodePatch(
/*
Get the instance of the seekbar rectangle
*/
seekbarMethod.addInstruction(
1,
"invoke-static {v0}, Lapp/revanced/integrations/sponsorblock/PlayerController;->setSponsorBarRect(Ljava/lang/Object;)V"
)
for ((index, instruction) in seekbarMethodInstructions.withIndex()) {
if (instruction.opcode != Opcode.MOVE_OBJECT_FROM16) continue
seekbarMethod.addInstruction(
index + 1,
"invoke-static {v0}, Lapp/revanced/integrations/sponsorblock/PlayerController;->setSponsorBarRect(Ljava/lang/Object;)V"
)
break
}

for ((index, instruction) in seekbarMethodInstructions.withIndex()) {
if (instruction.opcode != Opcode.INVOKE_STATIC) continue
Expand Down

0 comments on commit 12af4b1

Please sign in to comment.