Skip to content

Commit

Permalink
fix(disable-startup-shorts-player): incorrect offsets, invert branch …
Browse files Browse the repository at this point in the history
…condition (#672)
  • Loading branch information
OxrxL committed Sep 29, 2022
1 parent b1bc6d4 commit 95cb6e8
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class DisableShortsOnStartupPatch : BytecodePatch(
val actionOpenShortsMethod = actionOpenShortsResult!!.mutableMethod
val actionOpenShortsInstructions = actionOpenShortsMethod.implementation!!.instructions

val moveResultIndex = actionOpenShortsResult.scanResult.stringsScanResult!!.matches.first().index + 5
val iPutBooleanIndex = moveResultIndex + 6
val moveResultIndex = actionOpenShortsResult.scanResult.stringsScanResult!!.matches.first().index + 4
val iPutBooleanIndex = moveResultIndex + 2

val moveResultRegister = (actionOpenShortsInstructions[moveResultIndex] as OneRegisterInstruction).registerA
val iPutBooleanRegister = (actionOpenShortsInstructions[iPutBooleanIndex] as TwoRegisterInstruction).registerA
Expand All @@ -56,7 +56,7 @@ class DisableShortsOnStartupPatch : BytecodePatch(
moveResultIndex + 1, """
invoke-static { }, Lapp/revanced/integrations/patches/DisableStartupShortsPlayerPatch;->disableStartupShortsPlayer()Z
move-result v$moveResultRegister
if-nez v$moveResultRegister, :cond_startup_shorts_reset
if-eqz v$moveResultRegister, :cond_startup_shorts_reset
const/4 v$iPutBooleanRegister, 0x0
:cond_startup_shorts_reset
nop
Expand Down

0 comments on commit 95cb6e8

Please sign in to comment.