mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-13 05:37:40 +02:00
fix(YouTube - Hook download actions, Overlay buttons): Sometimes the AlertDialog does not show
This commit is contained in:
@ -52,3 +52,20 @@ internal fun indexOfSetVideoIdInstruction(method: Method) =
|
||||
opcode == Opcode.IPUT_OBJECT &&
|
||||
getReference<FieldReference>()?.type == "Ljava/lang/String;"
|
||||
}
|
||||
|
||||
internal val setPivotBarVisibilityFingerprint = legacyFingerprint(
|
||||
name = "setPivotBarVisibilityFingerprint",
|
||||
accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL,
|
||||
returnType = "V",
|
||||
parameters = listOf("Z"),
|
||||
opcodes = listOf(
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IF_EQZ,
|
||||
),
|
||||
)
|
||||
|
||||
internal val setPivotBarVisibilityParentFingerprint = legacyFingerprint(
|
||||
name = "setPivotBarVisibilityFingerprint",
|
||||
parameters = listOf("Z"),
|
||||
strings = listOf("FEnotifications_inbox"),
|
||||
)
|
||||
|
@ -1,5 +1,6 @@
|
||||
package app.revanced.patches.youtube.utils.playlist
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
@ -81,5 +82,19 @@ val playlistPatch = bytecodePatch(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
setPivotBarVisibilityFingerprint
|
||||
.matchOrThrow(setPivotBarVisibilityParentFingerprint)
|
||||
.let {
|
||||
it.method.apply {
|
||||
val viewIndex = it.patternMatch!!.startIndex
|
||||
val viewRegister = getInstruction<OneRegisterInstruction>(viewIndex).registerA
|
||||
addInstruction(
|
||||
viewIndex + 1,
|
||||
"invoke-static {v$viewRegister}," +
|
||||
" $EXTENSION_CLASS_DESCRIPTOR->setPivotBar(Lcom/google/android/libraries/youtube/rendering/ui/pivotbar/PivotBar;)V",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user