mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-29 05:10:20 +02:00
feat(YouTube): integrate Hide double tap overlay filter
patch into the Player components
patch
This commit is contained in:
parent
2683e6bdde
commit
7c9261f3ce
@ -1,26 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.layout.doubletapbackground
|
|
||||||
|
|
||||||
import app.revanced.patcher.data.ResourceContext
|
|
||||||
import app.revanced.patches.shared.overlaybackground.OverlayBackgroundUtils.removeOverlayBackground
|
|
||||||
import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE
|
|
||||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
|
||||||
import app.revanced.util.patch.BaseResourcePatch
|
|
||||||
|
|
||||||
@Suppress("unused")
|
|
||||||
object DoubleTapOverlayBackgroundPatch : BaseResourcePatch(
|
|
||||||
name = "Hide double tap overlay filter",
|
|
||||||
description = "Removes, at compile time, the dark overlay that appears when double-tapping to seek.",
|
|
||||||
dependencies = setOf(SettingsPatch::class),
|
|
||||||
compatiblePackages = COMPATIBLE_PACKAGE,
|
|
||||||
use = false
|
|
||||||
) {
|
|
||||||
override fun execute(context: ResourceContext) {
|
|
||||||
|
|
||||||
context.removeOverlayBackground(
|
|
||||||
arrayOf("quick_seek_overlay.xml"),
|
|
||||||
arrayOf("tap_bloom_view", "dark_background")
|
|
||||||
)
|
|
||||||
|
|
||||||
SettingsPatch.updatePatchStatus(this)
|
|
||||||
}
|
|
||||||
}
|
|
@ -20,6 +20,7 @@ import app.revanced.patches.youtube.player.components.fingerprints.InfoCardsInco
|
|||||||
import app.revanced.patches.youtube.player.components.fingerprints.LayoutCircleFingerprint
|
import app.revanced.patches.youtube.player.components.fingerprints.LayoutCircleFingerprint
|
||||||
import app.revanced.patches.youtube.player.components.fingerprints.LayoutIconFingerprint
|
import app.revanced.patches.youtube.player.components.fingerprints.LayoutIconFingerprint
|
||||||
import app.revanced.patches.youtube.player.components.fingerprints.LayoutVideoFingerprint
|
import app.revanced.patches.youtube.player.components.fingerprints.LayoutVideoFingerprint
|
||||||
|
import app.revanced.patches.youtube.player.components.fingerprints.QuickSeekOverlayFingerprint
|
||||||
import app.revanced.patches.youtube.player.components.fingerprints.SeekEduContainerFingerprint
|
import app.revanced.patches.youtube.player.components.fingerprints.SeekEduContainerFingerprint
|
||||||
import app.revanced.patches.youtube.player.components.fingerprints.SuggestedActionsFingerprint
|
import app.revanced.patches.youtube.player.components.fingerprints.SuggestedActionsFingerprint
|
||||||
import app.revanced.patches.youtube.player.components.fingerprints.TouchAreaOnClickListenerFingerprint
|
import app.revanced.patches.youtube.player.components.fingerprints.TouchAreaOnClickListenerFingerprint
|
||||||
@ -34,14 +35,18 @@ import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH
|
|||||||
import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER_CLASS_DESCRIPTOR
|
import app.revanced.patches.youtube.utils.integrations.Constants.PLAYER_CLASS_DESCRIPTOR
|
||||||
import app.revanced.patches.youtube.utils.playertype.PlayerTypeHookPatch
|
import app.revanced.patches.youtube.utils.playertype.PlayerTypeHookPatch
|
||||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
|
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
|
||||||
|
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.DarkBackground
|
||||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.FadeDurationFast
|
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.FadeDurationFast
|
||||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ScrimOverlay
|
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ScrimOverlay
|
||||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.SeekUndoEduOverlayStub
|
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.SeekUndoEduOverlayStub
|
||||||
|
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.TapBloomView
|
||||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||||
|
import app.revanced.util.REGISTER_TEMPLATE_REPLACEMENT
|
||||||
import app.revanced.util.getTargetIndexOrThrow
|
import app.revanced.util.getTargetIndexOrThrow
|
||||||
import app.revanced.util.getTargetIndexReversedOrThrow
|
import app.revanced.util.getTargetIndexReversedOrThrow
|
||||||
import app.revanced.util.getTargetIndexWithMethodReferenceNameOrThrow
|
import app.revanced.util.getTargetIndexWithMethodReferenceNameOrThrow
|
||||||
import app.revanced.util.getWideLiteralInstructionIndex
|
import app.revanced.util.getWideLiteralInstructionIndex
|
||||||
|
import app.revanced.util.literalInstructionViewHook
|
||||||
import app.revanced.util.patch.BaseBytecodePatch
|
import app.revanced.util.patch.BaseBytecodePatch
|
||||||
import app.revanced.util.resultOrThrow
|
import app.revanced.util.resultOrThrow
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
@ -73,6 +78,7 @@ object PlayerComponentsPatch : BaseBytecodePatch(
|
|||||||
LayoutCircleFingerprint,
|
LayoutCircleFingerprint,
|
||||||
LayoutIconFingerprint,
|
LayoutIconFingerprint,
|
||||||
LayoutVideoFingerprint,
|
LayoutVideoFingerprint,
|
||||||
|
QuickSeekOverlayFingerprint,
|
||||||
SeekEduContainerFingerprint,
|
SeekEduContainerFingerprint,
|
||||||
SuggestedActionsFingerprint,
|
SuggestedActionsFingerprint,
|
||||||
TouchAreaOnClickListenerFingerprint,
|
TouchAreaOnClickListenerFingerprint,
|
||||||
@ -164,6 +170,24 @@ object PlayerComponentsPatch : BaseBytecodePatch(
|
|||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
|
// region patch for hide double-tap overlay filter
|
||||||
|
|
||||||
|
val smaliInstruction = """
|
||||||
|
invoke-static {v$REGISTER_TEMPLATE_REPLACEMENT}, $PLAYER_CLASS_DESCRIPTOR->hideDoubleTapOverlayFilter(Landroid/view/View;)V
|
||||||
|
"""
|
||||||
|
|
||||||
|
arrayOf(
|
||||||
|
DarkBackground,
|
||||||
|
TapBloomView
|
||||||
|
).forEach { literal ->
|
||||||
|
QuickSeekOverlayFingerprint.literalInstructionViewHook(
|
||||||
|
literal,
|
||||||
|
smaliInstruction
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// endregion
|
||||||
|
|
||||||
// region patch for hide end screen cards
|
// region patch for hide end screen cards
|
||||||
|
|
||||||
listOf(
|
listOf(
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
package app.revanced.patches.youtube.player.components.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.DarkBackground
|
||||||
|
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.TapBloomView
|
||||||
|
import app.revanced.util.containsWideLiteralInstructionIndex
|
||||||
|
|
||||||
|
internal object QuickSeekOverlayFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
parameters = emptyList(),
|
||||||
|
customFingerprint = { methodDef, _ ->
|
||||||
|
methodDef.containsWideLiteralInstructionIndex(DarkBackground)
|
||||||
|
&& methodDef.containsWideLiteralInstructionIndex(TapBloomView)
|
||||||
|
},
|
||||||
|
)
|
@ -39,6 +39,7 @@ object SharedResourceIdPatch : ResourcePatch() {
|
|||||||
var CompactLink = -1L
|
var CompactLink = -1L
|
||||||
var CompactListItem = -1L
|
var CompactListItem = -1L
|
||||||
var ControlsLayoutStub = -1L
|
var ControlsLayoutStub = -1L
|
||||||
|
var DarkBackground = -1L
|
||||||
var DarkSplashAnimation = -1L
|
var DarkSplashAnimation = -1L
|
||||||
var DonationCompanion = -1L
|
var DonationCompanion = -1L
|
||||||
var DrawerContentView = -1L
|
var DrawerContentView = -1L
|
||||||
@ -93,6 +94,7 @@ object SharedResourceIdPatch : ResourcePatch() {
|
|||||||
var SlidingDialogAnimation = -1L
|
var SlidingDialogAnimation = -1L
|
||||||
var SubtitleMenuSettingsFooterInfo = -1L
|
var SubtitleMenuSettingsFooterInfo = -1L
|
||||||
var SuggestedAction = -1L
|
var SuggestedAction = -1L
|
||||||
|
var TapBloomView = -1L
|
||||||
var TitleAnchor = -1L
|
var TitleAnchor = -1L
|
||||||
var ToolTipContentView = -1L
|
var ToolTipContentView = -1L
|
||||||
var TotalTime = -1L
|
var TotalTime = -1L
|
||||||
@ -132,6 +134,7 @@ object SharedResourceIdPatch : ResourcePatch() {
|
|||||||
CompactLink = getId(LAYOUT, "compact_link")
|
CompactLink = getId(LAYOUT, "compact_link")
|
||||||
CompactListItem = getId(LAYOUT, "compact_list_item")
|
CompactListItem = getId(LAYOUT, "compact_list_item")
|
||||||
ControlsLayoutStub = getId(ID, "controls_layout_stub")
|
ControlsLayoutStub = getId(ID, "controls_layout_stub")
|
||||||
|
DarkBackground = getId(ID, "dark_background")
|
||||||
DarkSplashAnimation = getId(ID, "dark_splash_animation")
|
DarkSplashAnimation = getId(ID, "dark_splash_animation")
|
||||||
DonationCompanion = getId(LAYOUT, "donation_companion")
|
DonationCompanion = getId(LAYOUT, "donation_companion")
|
||||||
DrawerContentView = getId(ID, "drawer_content_view")
|
DrawerContentView = getId(ID, "drawer_content_view")
|
||||||
@ -189,6 +192,7 @@ object SharedResourceIdPatch : ResourcePatch() {
|
|||||||
SlidingDialogAnimation = getId(STYLE, "SlidingDialogAnimation")
|
SlidingDialogAnimation = getId(STYLE, "SlidingDialogAnimation")
|
||||||
SubtitleMenuSettingsFooterInfo = getId(STRING, "subtitle_menu_settings_footer_info")
|
SubtitleMenuSettingsFooterInfo = getId(STRING, "subtitle_menu_settings_footer_info")
|
||||||
SuggestedAction = getId(LAYOUT, "suggested_action")
|
SuggestedAction = getId(LAYOUT, "suggested_action")
|
||||||
|
TapBloomView = getId(ID, "tap_bloom_view")
|
||||||
TitleAnchor = getId(ID, "title_anchor")
|
TitleAnchor = getId(ID, "title_anchor")
|
||||||
ToolTipContentView = getId(LAYOUT, "tooltip_content_view")
|
ToolTipContentView = getId(LAYOUT, "tooltip_content_view")
|
||||||
TotalTime = getId(STRING, "total_time")
|
TotalTime = getId(STRING, "total_time")
|
||||||
|
@ -520,6 +520,9 @@ Note:
|
|||||||
<string name="revanced_hide_crowdfunding_box_title">Hide crowdfunding box</string>
|
<string name="revanced_hide_crowdfunding_box_title">Hide crowdfunding box</string>
|
||||||
<string name="revanced_hide_crowdfunding_box_summary_on">Crowdfunding box is hidden.</string>
|
<string name="revanced_hide_crowdfunding_box_summary_on">Crowdfunding box is hidden.</string>
|
||||||
<string name="revanced_hide_crowdfunding_box_summary_off">Crowdfunding box is shown.</string>
|
<string name="revanced_hide_crowdfunding_box_summary_off">Crowdfunding box is shown.</string>
|
||||||
|
<string name="revanced_hide_double_tap_overlay_filter_title">Hide double-tap overlay filter</string>
|
||||||
|
<string name="revanced_hide_double_tap_overlay_filter_summary_on">Double-tap overlay filter is hidden.</string>
|
||||||
|
<string name="revanced_hide_double_tap_overlay_filter_summary_off">Double-tap overlay filter is shown.</string>
|
||||||
<string name="revanced_hide_end_screen_cards_title">Hide end screen cards</string>
|
<string name="revanced_hide_end_screen_cards_title">Hide end screen cards</string>
|
||||||
<string name="revanced_hide_end_screen_cards_summary_on">End screen cards are hidden.</string>
|
<string name="revanced_hide_end_screen_cards_summary_on">End screen cards are hidden.</string>
|
||||||
<string name="revanced_hide_end_screen_cards_summary_off">End screen cards are shown.</string>
|
<string name="revanced_hide_end_screen_cards_summary_off">End screen cards are shown.</string>
|
||||||
|
@ -430,6 +430,7 @@
|
|||||||
<app.revanced.integrations.shared.settings.preference.ResettableEditTextPreference android:hint="2.0" android:title="@string/revanced_speed_overlay_value_title" android:key="revanced_speed_overlay_value" android:summary="@string/revanced_speed_overlay_value_summary" android:inputType="numberDecimal" />
|
<app.revanced.integrations.shared.settings.preference.ResettableEditTextPreference android:hint="2.0" android:title="@string/revanced_speed_overlay_value_title" android:key="revanced_speed_overlay_value" android:summary="@string/revanced_speed_overlay_value_summary" android:inputType="numberDecimal" />
|
||||||
<SwitchPreference android:title="@string/revanced_hide_channel_watermark_title" android:key="revanced_hide_channel_watermark" android:summaryOn="@string/revanced_hide_channel_watermark_summary_on" android:summaryOff="@string/revanced_hide_channel_watermark_summary_off" />
|
<SwitchPreference android:title="@string/revanced_hide_channel_watermark_title" android:key="revanced_hide_channel_watermark" android:summaryOn="@string/revanced_hide_channel_watermark_summary_on" android:summaryOff="@string/revanced_hide_channel_watermark_summary_off" />
|
||||||
<SwitchPreference android:title="@string/revanced_hide_crowdfunding_box_title" android:key="revanced_hide_crowdfunding_box" android:summaryOn="@string/revanced_hide_crowdfunding_box_summary_on" android:summaryOff="@string/revanced_hide_crowdfunding_box_summary_off" />
|
<SwitchPreference android:title="@string/revanced_hide_crowdfunding_box_title" android:key="revanced_hide_crowdfunding_box" android:summaryOn="@string/revanced_hide_crowdfunding_box_summary_on" android:summaryOff="@string/revanced_hide_crowdfunding_box_summary_off" />
|
||||||
|
<SwitchPreference android:title="@string/revanced_hide_double_tap_overlay_filter_title" android:key="revanced_hide_double_tap_overlay_filter" android:summaryOn="@string/revanced_hide_double_tap_overlay_filter_summary_on" android:summaryOff="@string/revanced_hide_double_tap_overlay_filter_summary_off" />
|
||||||
<SwitchPreference android:title="@string/revanced_hide_end_screen_cards_title" android:key="revanced_hide_end_screen_cards" android:summaryOn="@string/revanced_hide_end_screen_cards_summary_on" android:summaryOff="@string/revanced_hide_end_screen_cards_summary_off" />
|
<SwitchPreference android:title="@string/revanced_hide_end_screen_cards_title" android:key="revanced_hide_end_screen_cards" android:summaryOn="@string/revanced_hide_end_screen_cards_summary_on" android:summaryOff="@string/revanced_hide_end_screen_cards_summary_off" />
|
||||||
<SwitchPreference android:title="@string/revanced_hide_filmstrip_overlay_title" android:key="revanced_hide_filmstrip_overlay" android:summaryOn="@string/revanced_hide_filmstrip_overlay_summary_on" android:summaryOff="@string/revanced_hide_filmstrip_overlay_summary_off" />
|
<SwitchPreference android:title="@string/revanced_hide_filmstrip_overlay_title" android:key="revanced_hide_filmstrip_overlay" android:summaryOn="@string/revanced_hide_filmstrip_overlay_summary_on" android:summaryOff="@string/revanced_hide_filmstrip_overlay_summary_off" />
|
||||||
<SwitchPreference android:title="@string/revanced_hide_info_cards_title" android:key="revanced_hide_info_cards" android:summaryOn="@string/revanced_hide_info_cards_summary_on" android:summaryOff="@string/revanced_hide_info_cards_summary_off" />
|
<SwitchPreference android:title="@string/revanced_hide_info_cards_title" android:key="revanced_hide_info_cards" android:summaryOn="@string/revanced_hide_info_cards_summary_on" android:summaryOff="@string/revanced_hide_info_cards_summary_off" />
|
||||||
@ -709,7 +710,6 @@
|
|||||||
<Preference android:title="Custom Shorts action buttons" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="Custom Shorts action buttons" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="GmsCore support" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="GmsCore support" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="Hide animated button background" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="Hide animated button background" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="Hide double tap overlay filter" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
|
||||||
<Preference android:title="Hide double tap to like animations" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="Hide double tap to like animations" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="Hide Shorts dimming" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="Hide Shorts dimming" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="Icon" android:summary="@string/revanced_icon_default" android:selectable="false"/>
|
<Preference android:title="Icon" android:summary="@string/revanced_icon_default" android:selectable="false"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user