From 2de51e65f05be8a6364dfdfe9cd36e8fed5737f6 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 2 Oct 2023 00:36:43 +0200 Subject: [PATCH] fix(YouTube - Hide shorts components): Fix hiding navigation bar --- .../layout/hide/shorts/HideShortsComponentsPatch.kt | 6 +++--- .../SetPivotBarVisibilityFingerprint.kt | 13 +++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index 2e22f69a8..c6708c049 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -98,10 +98,10 @@ object HideShortsComponentsPatch : BytecodePatch( SetPivotBarVisibilityFingerprint.result!!.let { result -> result.mutableMethod.apply { - val checkCastIndex = result.scanResult.patternScanResult!!.endIndex - val viewRegister = getInstruction(checkCastIndex).registerA + val insertIndex = result.scanResult.patternScanResult!!.endIndex + val viewRegister = getInstruction(insertIndex - 1).registerA addInstruction( - checkCastIndex + 1, + insertIndex, "sput-object v$viewRegister, $FILTER_CLASS_DESCRIPTOR->pivotBar:" + "Lcom/google/android/libraries/youtube/rendering/ui/pivotbar/PivotBar;" ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/SetPivotBarVisibilityFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/SetPivotBarVisibilityFingerprint.kt index 28171e8ef..464a9eb79 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/SetPivotBarVisibilityFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/SetPivotBarVisibilityFingerprint.kt @@ -1,19 +1,16 @@ package app.revanced.patches.youtube.layout.hide.shorts.fingerprints +import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint +import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode object SetPivotBarVisibilityFingerprint : MethodFingerprint( + returnType = "V", + accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL, parameters = listOf("Z"), opcodes = listOf( - Opcode.IGET_OBJECT, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT, - Opcode.IF_EQZ, - Opcode.RETURN_VOID, - Opcode.IGET_OBJECT, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT_OBJECT, Opcode.CHECK_CAST, + Opcode.IF_EQZ ) ) \ No newline at end of file