diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/animated/ForceAnimatedButtonBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/animated/ForceAnimatedButtonBackgroundPatch.kt new file mode 100644 index 0000000000..ee89033e54 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/animated/ForceAnimatedButtonBackgroundPatch.kt @@ -0,0 +1,33 @@ +package app.revanced.patches.youtube.layout.animated + +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.ResourcePatch +import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE +import app.revanced.patches.youtube.utils.settings.SettingsPatch +import app.revanced.util.copyResources +import app.revanced.util.ResourceGroup + +@Suppress("unused") +object ForceAnimatedButtonBackgroundPatch : ResourcePatch( + name = "Force hide animated button background", + description = "Hides the background of the pause and play animated buttons in the Shorts player at compile time.", + dependencies = setOf(SettingsPatch::class), + compatiblePackages = COMPATIBLE_PACKAGE, + use = false +) { + override fun execute(context: ResourceContext) { + /** + * Copy json + */ + context.copyResources( + "youtube/animated", + ResourceGroup( + "raw", + "pause_tap_feedback.json", + "play_tap_feedback.json" + ) + ) + + SettingsPatch.updatePatchStatus("Hide animated button background") + } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/animated/ForceAnimatedLikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/animated/ForceAnimatedLikePatch.kt new file mode 100644 index 0000000000..b74ad95d88 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/animated/ForceAnimatedLikePatch.kt @@ -0,0 +1,33 @@ +package app.revanced.patches.youtube.layout.animated + +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.ResourcePatch +import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE +import app.revanced.patches.youtube.utils.settings.SettingsPatch +import app.revanced.util.ResourceGroup +import app.revanced.util.copyResources + + +@Suppress("unused") +object ForceAnimatedLikePatch : ResourcePatch( + name = "Force hide double tap to like animations", + description = "Hide the like animations when double tap the screen in the Shorts player at compile time.", + dependencies = setOf(SettingsPatch::class), + compatiblePackages = COMPATIBLE_PACKAGE, + use = false +) { + override fun execute(context: ResourceContext) { + /** + * Copy json + */ + context.copyResources( + "youtube/animated", + ResourceGroup( + "raw", + "like_tap_feedback.json" + ) + ) + + SettingsPatch.updatePatchStatus("Hide double tap to like animations") + } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/playerbuttonbg/PlayerButtonBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/playerbuttonbg/PlayerButtonBackgroundPatch.kt index 0e6ad19c87..3fb42259cf 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/playerbuttonbg/PlayerButtonBackgroundPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/playerbuttonbg/PlayerButtonBackgroundPatch.kt @@ -7,10 +7,10 @@ import app.revanced.util.doRecursively import app.revanced.util.patch.BaseResourcePatch import org.w3c.dom.Element -@Suppress("DEPRECATION", "unused") -object PlayerButtonBackgroundPatch : BaseResourcePatch( - name = "Hide player button background", - description = "Hides the dark background surrounding the video player controls.", +@Suppress("Deprecation", "unused") +object ForcePlayerButtonBackgroundPatch : BaseResourcePatch( + name = "Force hide player buttons background", + description = "Hide the dark background surrounding the video player controls at compile time.", dependencies = setOf(SettingsPatch::class), compatiblePackages = COMPATIBLE_PACKAGE, use = false diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/dimming/ForceDisableShortsDimPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/dimming/ForceDisableShortsDimPatch.kt new file mode 100644 index 0000000000..5f783ab8a1 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/dimming/ForceDisableShortsDimPatch.kt @@ -0,0 +1,43 @@ +package app.revanced.patches.youtube.shorts.dimming + +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.ResourcePatch +import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE +import app.revanced.patches.youtube.utils.settings.SettingsPatch +import app.revanced.util.doRecursively +import org.w3c.dom.Element + +@Suppress("Deprecation", "unused") +object ForceDisableShortsDimPatch : ResourcePatch( + name = "Force disable Shorts dim", + description = "Hide the dimming effect on the top and bottom of Shorts video at compile time.", + dependencies = setOf(SettingsPatch::class), + compatiblePackages = COMPATIBLE_PACKAGE, + use = false +) { + override fun execute(context: ResourceContext) { + val hide = "0.0dip" + + fun hideLayoutAttributes(layoutFile: String, targetId: String) { + context.xmlEditor[layoutFile].use { editor -> + editor.file.doRecursively { node -> + if (node !is Element) return@doRecursively + + when (node.getAttributeNode("android:id")?.textContent) { + targetId -> { + node.apply { + setAttribute("android:layout_height", hide) + setAttribute("android:layout_width", hide) + } + } + } + } + } + } + + hideLayoutAttributes("res/layout/reel_player_overlay_scrims.xml", "@id/reel_player_overlay_v2_scrims_vertical") + hideLayoutAttributes("res/layout/reel_watch_fragment.xml", "@id/reel_scrim_shorts_while_top") + + SettingsPatch.updatePatchStatus("Force disable Shorts dim") + } +} diff --git a/src/main/resources/youtube/animated/raw/like_tap_feedback.json b/src/main/resources/youtube/animated/raw/like_tap_feedback.json new file mode 100644 index 0000000000..3960203106 --- /dev/null +++ b/src/main/resources/youtube/animated/raw/like_tap_feedback.json @@ -0,0 +1 @@ +{"nm":"empty","ddd":0,"h":500,"w":500,"meta":{"g":"@lottiefiles/creator 1.2.0"},"layers":[],"v":"5.7.0","fr":30,"op":30,"ip":0,"assets":[]} \ No newline at end of file diff --git a/src/main/resources/youtube/animated/raw/pause_tap_feedback.json b/src/main/resources/youtube/animated/raw/pause_tap_feedback.json new file mode 100644 index 0000000000..56a712df04 --- /dev/null +++ b/src/main/resources/youtube/animated/raw/pause_tap_feedback.json @@ -0,0 +1 @@ +{"v":"5.7.5","fr":100,"ip":0,"op":203.33333333333331,"w":96,"h":96,"nm":"Comp 1","ddd":0,"assets":[{"id":"0","layers":[{"ddd":0,"ind":0,"ty":4,"nm":"Group 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":2},"r":{"a":0,"k":0,"ix":2},"p":{"a":0,"k":[10000,10000],"ix":2},"a":{"a":0,"k":[0,0],"ix":2},"s":{"a":0,"k":[100,100],"ix":2}},"ao":0,"hd":false,"shapes":[{"ty":"gr","hd":false,"it":[{"ty":"sh","hd":false,"d":1,"ks":{"a":0,"k":{"c":false,"v":[[-1,-9],[1,-9],[2,-8],[2,8],[1,9],[-1,9],[-2,8],[-2,-8],[-1,-9]],"i":[[-0.553,0],[0,0],[0,-0.552],[0,0],[0.553,0],[0,0],[0,0.553],[0,0],[-0.553,0]],"o":[[0,0],[0.553,0],[0,0],[0,0.553],[0,0],[-0.553,0],[0,0],[0,-0.552],[0,0]]}}},{"ty":"fl","c":{"a":0,"k":[1,1,1],"ix":2},"o":{"a":0,"k":100,"ix":2},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":2},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":2},"m":1,"hd":false},{"ty":"tr","hd":false,"p":{"a":0,"k":[21,16],"ix":2},"a":{"a":0,"k":[0,0],"ix":2},"s":{"a":0,"k":[100,100],"ix":2},"r":{"a":0,"k":0,"ix":2},"o":{"a":0,"k":100,"ix":2},"sk":{"a":0,"k":0,"ix":2},"sa":{"a":0,"k":0,"ix":2}}]}],"ip":0,"op":203.33333333333331,"st":0,"bm":0},{"ddd":0,"ind":1,"ty":4,"nm":"Group 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":2},"r":{"a":0,"k":0,"ix":2},"p":{"a":0,"k":[10000,10000],"ix":2},"a":{"a":0,"k":[0,0],"ix":2},"s":{"a":0,"k":[100,100],"ix":2}},"ao":0,"hd":false,"shapes":[{"ty":"gr","hd":false,"it":[{"ty":"sh","hd":false,"d":1,"ks":{"a":0,"k":{"c":false,"v":[[-1,-9],[1,-9],[2,-8],[2,8],[1,9],[-1,9],[-2,8],[-2,-8],[-1,-9]],"i":[[-0.552,0],[0,0],[0,-0.552],[0,0],[0.552,0],[0,0],[0,0.553],[0,0],[-0.552,0]],"o":[[0,0],[0.552,0],[0,0],[0,0.553],[0,0],[-0.552,0],[0,0],[0,-0.552],[0,0]]}}},{"ty":"fl","c":{"a":0,"k":[1,1,1],"ix":2},"o":{"a":0,"k":100,"ix":2},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":2},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":2},"m":1,"hd":false},{"ty":"tr","hd":false,"p":{"a":0,"k":[11,16],"ix":2},"a":{"a":0,"k":[0,0],"ix":2},"s":{"a":0,"k":[100,100],"ix":2},"r":{"a":0,"k":0,"ix":2},"o":{"a":0,"k":100,"ix":2},"sk":{"a":0,"k":0,"ix":2},"sa":{"a":0,"k":0,"ix":2}}]}],"ip":0,"op":203.33333333333331,"st":0,"bm":0}]}],"layers":[{"ddd":0,"refId":"0","w":20000,"h":20000,"ind":2,"ty":0,"nm":"pause Outlines","sr":1,"ks":{"o":{"a":1,"k":[{"t":83,"s":[100],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":100,"s":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}],"ix":2},"r":{"a":0,"k":0,"ix":2},"p":{"a":0,"k":[48,48],"ix":2},"a":{"a":0,"k":[10016,10016],"ix":2},"s":{"a":1,"k":[{"t":0,"s":[0,0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":13,"s":[130,130],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":43,"s":[100,100],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":83,"s":[100,100],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":120,"s":[0,0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}],"ix":2}},"ao":0,"ip":0,"op":203.33333333333331,"st":0,"bm":0,"hd":false},{"ddd":0,"ind":3,"ty":4,"nm":"Ellipse Path 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":2},"r":{"a":0,"k":0,"ix":2},"p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":2},"s":{"a":0,"k":[100,100],"ix":2}},"ao":0,"hd":false,"shapes":[{"ty":"gr","hd":false,"it":[{"ty":"el","hd":false,"d":1,"s":{"a":0,"k":[72,72],"ix":2},"p":{"a":0,"k":[0,0],"ix":2}},{"ty":"st","c":{"a":0,"k":[1,1,1],"ix":2},"o":{"a":0,"k":100,"ix":2},"w":{"a":0,"k":0,"ix":2},"hd":false,"lc":2,"lj":2},{"ty":"fl","c":{"a":0,"k":[0,0,0],"ix":2},"o":{"a":1,"k":[{"t":0,"s":[60],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":2,"s":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":10,"s":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":13,"s":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":40,"s":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}],"ix":2},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":2},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":2},"m":1,"hd":false},{"ty":"tr","hd":false,"p":{"a":0,"k":[48,48],"ix":2},"a":{"a":0,"k":[0,0],"ix":2},"s":{"a":1,"k":[{"t":0,"s":[0,0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":13,"s":[110.00000000000001,110.00000000000001],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":43,"s":[100,100],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":83,"s":[100,100],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":120,"s":[0,0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}],"ix":2},"r":{"a":0,"k":0,"ix":2},"o":{"a":1,"k":[{"t":83,"s":[100],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":100,"s":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}],"ix":2},"sk":{"a":0,"k":0,"ix":2},"sa":{"a":0,"k":0,"ix":2}}]}],"ip":0,"op":203.33333333333331,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/src/main/resources/youtube/animated/raw/play_tap_feedback.json b/src/main/resources/youtube/animated/raw/play_tap_feedback.json new file mode 100644 index 0000000000..59696b8744 --- /dev/null +++ b/src/main/resources/youtube/animated/raw/play_tap_feedback.json @@ -0,0 +1 @@ +{"v":"5.7.5","fr":100,"ip":0,"op":203.33333333333331,"w":96,"h":96,"nm":"Comp 1","ddd":0,"assets":[{"id":"0","layers":[{"ddd":0,"ind":0,"ty":4,"nm":"Group 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":2},"r":{"a":0,"k":0,"ix":2},"p":{"a":0,"k":[10000,10000],"ix":2},"a":{"a":0,"k":[0,0],"ix":2},"s":{"a":0,"k":[100,100],"ix":2}},"ao":0,"hd":false,"shapes":[{"ty":"gr","hd":false,"it":[{"ty":"sh","hd":false,"d":1,"ks":{"a":0,"k":{"c":false,"v":[[-9.5,-9.266],[-7.999,-10.13],[9.5,0.001],[-7.999,10.13],[-9.5,9.266],[-9.5,-9.266]],"i":[[0,0],[-0.667,-0.386],[0,0],[0,0],[0,0.771],[0,0]],"o":[[0,-0.77],[0,0],[0,0],[-0.667,0.386],[0,0],[0,-0.77]]}}},{"ty":"fl","c":{"a":0,"k":[1,1,1],"ix":2},"o":{"a":0,"k":100,"ix":2},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":2},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":2},"m":1,"hd":false},{"ty":"tr","hd":false,"p":{"a":0,"k":[17.5,16],"ix":2},"a":{"a":0,"k":[0,0],"ix":2},"s":{"a":0,"k":[100,100],"ix":2},"r":{"a":0,"k":0,"ix":2},"o":{"a":0,"k":100,"ix":2},"sk":{"a":0,"k":0,"ix":2},"sa":{"a":0,"k":0,"ix":2}}]}],"ip":0,"op":203.33333333333331,"st":0,"bm":0}]}],"layers":[{"ddd":0,"refId":"0","w":20000,"h":20000,"ind":1,"ty":0,"nm":"play Outlines","sr":1,"ks":{"o":{"a":1,"k":[{"t":57,"s":[100],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":73,"s":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}],"ix":2},"r":{"a":0,"k":0,"ix":2},"p":{"a":0,"k":[48,48],"ix":2},"a":{"a":0,"k":[10016,10016],"ix":2},"s":{"a":1,"k":[{"t":0,"s":[0,0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":13,"s":[130,130],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":43,"s":[100,100],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":57,"s":[100,100],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":93,"s":[0,0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}],"ix":2}},"ao":0,"ip":0,"op":203.33333333333331,"st":0,"bm":0,"hd":false},{"ddd":0,"ind":2,"ty":4,"nm":"Ellipse Path 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":2},"r":{"a":0,"k":0,"ix":2},"p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":2},"s":{"a":0,"k":[100,100],"ix":2}},"ao":0,"hd":false,"shapes":[{"ty":"gr","hd":false,"it":[{"ty":"el","hd":false,"d":1,"s":{"a":0,"k":[72,72],"ix":2},"p":{"a":0,"k":[0,0],"ix":2}},{"ty":"st","c":{"a":0,"k":[1,1,1],"ix":2},"o":{"a":0,"k":100,"ix":2},"w":{"a":0,"k":0,"ix":2},"hd":false,"lc":2,"lj":2},{"ty":"fl","c":{"a":0,"k":[0,0,0],"ix":2},"o":{"a":1,"k":[{"t":0,"s":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":5,"s":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":11,"s":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":38,"s":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}],"ix":2},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":2},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":2},"m":1,"hd":false},{"ty":"tr","hd":false,"p":{"a":0,"k":[48,48],"ix":2},"a":{"a":0,"k":[0,0],"ix":2},"s":{"a":1,"k":[{"t":0,"s":[0,0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":11,"s":[110.00000000000001,110.00000000000001],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":41,"s":[100,100],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":57,"s":[100,100],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":93,"s":[0,0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}],"ix":2},"r":{"a":0,"k":0,"ix":2},"o":{"a":1,"k":[{"t":57,"s":[100],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}},{"t":73,"s":[0],"i":{"x":[1],"y":[1]},"o":{"x":[0],"y":[0]}}],"ix":2},"sk":{"a":0,"k":0,"ix":2},"sa":{"a":0,"k":0,"ix":2}}]}],"ip":0,"op":203.33333333333331,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/src/main/resources/youtube/settings/xml/revanced_prefs.xml index 5f4b50cd10..3d5f99c719 100644 --- a/src/main/resources/youtube/settings/xml/revanced_prefs.xml +++ b/src/main/resources/youtube/settings/xml/revanced_prefs.xml @@ -646,8 +646,10 @@ + +