From bfe1e3808ece85fbb0785a4378ee95591115ac33 Mon Sep 17 00:00:00 2001 From: OxrxL <108184954+OxrxL@users.noreply.github.com> Date: Fri, 30 Sep 2022 00:25:29 +0200 Subject: [PATCH] fix(disable-startup-shorts-player): incorrect offsets, invert branch condition (#672) --- .../startupshortsreset/patch/DisableShortsOnStartupPatch.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/patch/DisableShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/patch/DisableShortsOnStartupPatch.kt index d09a18b42..79149133c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/patch/DisableShortsOnStartupPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/patch/DisableShortsOnStartupPatch.kt @@ -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 @@ -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