diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/utils/toolbar/ToolBarHookPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/utils/toolbar/ToolBarHookPatch.kt index 262220a64..feee4c16e 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/utils/toolbar/ToolBarHookPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/utils/toolbar/ToolBarHookPatch.kt @@ -11,6 +11,7 @@ import app.revanced.patches.youtube.utils.resourceid.sharedResourceIdPatch import app.revanced.patches.youtube.utils.toolBarButtonFingerprint import app.revanced.util.fingerprint.methodOrThrow import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstructionOrThrow import app.revanced.util.indexOfFirstInstructionReversedOrThrow import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction @@ -44,7 +45,7 @@ val toolBarHookPatch = bytecodePatch( val enumRegister = getInstruction(enumOrdinalIndex).registerD val freeRegister = getInstruction(freeIndex).registerA - val imageViewIndex = indexOfFirstInstructionReversedOrThrow(enumOrdinalIndex) { + val imageViewIndex = indexOfFirstInstructionOrThrow(enumOrdinalIndex) { opcode == Opcode.IGET_OBJECT && getReference()?.type == "Landroid/widget/ImageView;" }