From 42a5a387da3c53c579234a44c124ab0ba26117cb Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 7 May 2023 18:57:54 +0200 Subject: [PATCH] fix: incorrect instruction offsets --- .../misc/fix/verticalscroll/patch/VerticalScrollPatch.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/shared/misc/fix/verticalscroll/patch/VerticalScrollPatch.kt b/src/main/kotlin/app/revanced/patches/shared/misc/fix/verticalscroll/patch/VerticalScrollPatch.kt index 1096e7fe3..296ba4e28 100644 --- a/src/main/kotlin/app/revanced/patches/shared/misc/fix/verticalscroll/patch/VerticalScrollPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/misc/fix/verticalscroll/patch/VerticalScrollPatch.kt @@ -22,9 +22,10 @@ class VerticalScrollPatch : BytecodePatch( override fun execute(context: BytecodeContext): PatchResult { CanScrollVerticallyFingerprint.result?.let { it.mutableMethod.apply { - val insertIndex = it.scanResult.patternScanResult!!.endIndex - val moveResultRegister = instruction(insertIndex - 1).registerA + val moveResultIndex = it.scanResult.patternScanResult!!.endIndex + val moveResultRegister = instruction(moveResultIndex).registerA + val insertIndex = moveResultIndex + 1 addInstruction( insertIndex, "const/4 v$moveResultRegister, 0x0"