mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 13:17:46 +02:00
feat(YouTube/Shorts components): add Hide paused header
setting https://github.com/inotia00/ReVanced_Extended/issues/2213
This commit is contained in:
@ -13,6 +13,7 @@ import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.litho.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ShortsButtonFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ShortsPaidPromotionFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ShortsPausedHeaderFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ShortsPivotLegacyFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ShortsSubscriptionsTabletFingerprint
|
||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ShortsSubscriptionsTabletParentFingerprint
|
||||
@ -37,6 +38,7 @@ import app.revanced.util.REGISTER_TEMPLATE_REPLACEMENT
|
||||
import app.revanced.util.getTargetIndexOrThrow
|
||||
import app.revanced.util.getTargetIndexReversedOrThrow
|
||||
import app.revanced.util.getTargetIndexWithReferenceOrThrow
|
||||
import app.revanced.util.getWalkerMethod
|
||||
import app.revanced.util.getWideLiteralInstructionIndex
|
||||
import app.revanced.util.literalInstructionHook
|
||||
import app.revanced.util.patch.BaseBytecodePatch
|
||||
@ -68,6 +70,7 @@ object ShortsComponentPatch : BaseBytecodePatch(
|
||||
fingerprints = setOf(
|
||||
ShortsButtonFingerprint,
|
||||
ShortsPaidPromotionFingerprint,
|
||||
ShortsPausedHeaderFingerprint,
|
||||
ShortsPivotLegacyFingerprint,
|
||||
ShortsSubscriptionsTabletParentFingerprint,
|
||||
TextComponentSpecFingerprint
|
||||
@ -273,6 +276,26 @@ object ShortsComponentPatch : BaseBytecodePatch(
|
||||
|
||||
// endregion
|
||||
|
||||
// region patch for hide paused header
|
||||
|
||||
ShortsPausedHeaderFingerprint.resultOrThrow().let {
|
||||
val targetMethod = it.getWalkerMethod(context, it.scanResult.patternScanResult!!.endIndex)
|
||||
|
||||
targetMethod.apply {
|
||||
addInstructionsWithLabels(
|
||||
0,
|
||||
"""
|
||||
invoke-static {}, $SHORTS_CLASS_DESCRIPTOR->hideShortsPausedHeader()Z
|
||||
move-result v0
|
||||
if-nez v0, :hide
|
||||
""",
|
||||
ExternalLabel("hide", getInstruction(implementation!!.instructions.lastIndex))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
// region patch for return shorts channel name
|
||||
|
||||
TextComponentSpecFingerprint.resultOrThrow().let {
|
||||
|
@ -3,7 +3,7 @@ package app.revanced.patches.youtube.shorts.components.fingerprints
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
internal object ToolBarBannerFingerprint : MethodFingerprint(
|
||||
internal object ShortsPausedHeaderFingerprint : MethodFingerprint(
|
||||
returnType = "Landroid/view/View;",
|
||||
opcodes = listOf(
|
||||
Opcode.IF_NEZ,
|
Reference in New Issue
Block a user