From 04d159f77bc96b6903c818ff306e0f59d1eb23d4 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 5 Oct 2024 18:47:51 -0400 Subject: [PATCH 1/7] feat(YouTube - Hide layout components): Hide Yoodles (YouTube Doodles) --- api/revanced-patches.api | 1 + .../layout/hide/yoodles/YoodlesPatch.kt | 76 +++++++++++++++++++ .../hide/yoodles/YoodlesResourcePatch.kt | 17 +++++ .../YoodlesImageViewFingerprint.kt | 13 ++++ .../kotlin/app/revanced/util/BytecodeUtils.kt | 13 +++- .../resources/addresources/values/strings.xml | 5 ++ 6 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesPatch.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesResourcePatch.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/fingerprints/YoodlesImageViewFingerprint.kt diff --git a/api/revanced-patches.api b/api/revanced-patches.api index ad04ff075e..d5a6ed0525 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -2178,6 +2178,7 @@ public final class app/revanced/util/BytecodeUtilsKt { public static final fun containsWideLiteralInstructionValue (Lcom/android/tools/smali/dexlib2/iface/Method;J)Z public static final fun findMutableMethodOf (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableClass;Lcom/android/tools/smali/dexlib2/iface/Method;)Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod; public static final fun findOpcodeIndicesReversed (Lcom/android/tools/smali/dexlib2/iface/Method;Lcom/android/tools/smali/dexlib2/Opcode;)Ljava/util/List; + public static final fun findOpcodeIndicesReversed (Lcom/android/tools/smali/dexlib2/iface/Method;Lkotlin/jvm/functions/Function1;)Ljava/util/List; public static final fun getException (Lapp/revanced/patcher/fingerprint/MethodFingerprint;)Lapp/revanced/patcher/patch/PatchException; public static final fun indexOfFirstInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;ILkotlin/jvm/functions/Function1;)I public static final fun indexOfFirstInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;Lkotlin/jvm/functions/Function1;)I diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesPatch.kt new file mode 100644 index 0000000000..ff4b19d14b --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesPatch.kt @@ -0,0 +1,76 @@ +package app.revanced.patches.youtube.layout.hide.yoodles + +import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction +import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.annotation.CompatiblePackage +import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.all.misc.resources.AddResourcesPatch +import app.revanced.patches.shared.misc.settings.preference.SwitchPreference +import app.revanced.patches.youtube.layout.hide.yoodles.fingerprints.YoodlesImageViewFingerprint +import app.revanced.patches.youtube.misc.settings.SettingsPatch +import app.revanced.util.findOpcodeIndicesReversed +import app.revanced.util.getReference +import app.revanced.util.resultOrThrow +import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.iface.reference.MethodReference + +// Yes, YouTube gave this feature the goofy name of "Yoodles". +// https://logos.fandom.com/wiki/YouTube/Yoodles +@Patch( + name = "Hide Yoodles", + description = "Adds options to hide the YouTube doodle that sometimes replaces the YouTube logo beside the search bar.", + dependencies = [ + YoodlesResourcePatch::class, + SettingsPatch::class, + AddResourcesPatch::class + ], + compatiblePackages = [ + CompatiblePackage( + "com.google.android.youtube", + [ + "18.48.39", + "18.49.37", + "19.01.34", + "19.02.39", + "19.03.36", + "19.04.38", + "19.05.36", + "19.06.39", + "19.07.40", + "19.08.36", + "19.09.38", + "19.10.39", + "19.11.43", + "19.12.41", + "19.13.37", + "19.14.43", + "19.15.36", + "19.16.39", + ], + ), + ], +) +@Suppress("unused") +object YoodlesPatch : BytecodePatch(setOf(YoodlesImageViewFingerprint)) { + + private const val INTEGRATIONS_CLASS_DESCRIPTOR = + "Lapp/revanced/integrations/youtube/patches/yoodles/YoodlesPatch;" + + override fun execute(context: BytecodeContext) { + AddResourcesPatch(this::class) + + SettingsPatch.PreferenceScreen.FEED.addPreferences( + SwitchPreference("revanced_hide_yoodles"), + ) + + YoodlesImageViewFingerprint.resultOrThrow().mutableMethod.apply { + findOpcodeIndicesReversed{ + opcode == Opcode.INVOKE_VIRTUAL + && getReference()?.name == "setImageDrawable" + }.forEach { + removeInstruction(it) + } + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesResourcePatch.kt new file mode 100644 index 0000000000..c4dc6b8787 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesResourcePatch.kt @@ -0,0 +1,17 @@ +package app.revanced.patches.youtube.layout.hide.yoodles + +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.ResourcePatch +import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch + +internal object YoodlesResourcePatch : ResourcePatch() { + + var youTubeLogo = -1L + + override fun execute(context: ResourceContext) { + youTubeLogo = ResourceMappingPatch[ + "id", + "youtube_logo" + ] + } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/fingerprints/YoodlesImageViewFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/fingerprints/YoodlesImageViewFingerprint.kt new file mode 100644 index 0000000000..90b926ccee --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/fingerprints/YoodlesImageViewFingerprint.kt @@ -0,0 +1,13 @@ +package app.revanced.patches.youtube.layout.hide.yoodles.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patches.youtube.layout.hide.yoodles.YoodlesResourcePatch +import app.revanced.util.patch.LiteralValueFingerprint +import com.android.tools.smali.dexlib2.AccessFlags + +internal object YoodlesImageViewFingerprint : LiteralValueFingerprint( + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + parameters = listOf("L", "L"), + returnType = "Landroid/view/View;", + literalSupplier = { YoodlesResourcePatch.youTubeLogo } +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt index d22bfbdbe0..d8e9467556 100644 --- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt +++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt @@ -224,18 +224,25 @@ fun Method.indexOfFirstInstructionOrThrow(startIndex: Int = 0, predicate: Instru /** * @return The list of indices of the opcode in reverse order. */ -fun Method.findOpcodeIndicesReversed(opcode: Opcode): List { +fun Method.findOpcodeIndicesReversed(opcode: Opcode): List = + findOpcodeIndicesReversed { this.opcode == opcode } + +/** + * @return The list of indices of the opcode in reverse order. + */ +fun Method.findOpcodeIndicesReversed(filter: Instruction.() -> Boolean): List { val indexes = implementation!!.instructions .withIndex() - .filter { (_, instruction) -> instruction.opcode == opcode } + .filter { (_, instruction) -> filter.invoke(instruction) } .map { (index, _) -> index } .reversed() - if (indexes.isEmpty()) throw PatchException("No ${opcode.name} instructions found in: $this") + if (indexes.isEmpty()) throw PatchException("No matching instructions found in: $this") return indexes } + /** * Return the resolved method early. */ diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 7ed20f9ee5..7e913e6092 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -689,6 +689,11 @@ This is because Crowdin requires temporarily flattening this file and removing t Timestamp is hidden Timestamp is shown + + Hide Yoodles (YouTube Doodles) + Search bar yoodles are hidden + Search bar yoodles will be periodically shown + Hide player popup panels Player popup panels are hidden From e69fa8e59f322fba31566920c0ebb9f636972863 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 5 Oct 2024 19:06:42 -0400 Subject: [PATCH 2/7] refactor: Move to `Hide layout components` patch --- .../hide/general/HideLayoutComponentsPatch.kt | 38 +++++++++- .../HideLayoutComponentsResourcePatch.kt | 7 ++ .../YoodlesImageViewFingerprint.kt | 6 +- .../layout/hide/yoodles/YoodlesPatch.kt | 76 ------------------- .../hide/yoodles/YoodlesResourcePatch.kt | 17 ----- .../resources/addresources/values/strings.xml | 7 ++ 6 files changed, 54 insertions(+), 97 deletions(-) rename src/main/kotlin/app/revanced/patches/youtube/layout/hide/{yoodles => general}/fingerprints/YoodlesImageViewFingerprint.kt (61%) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesPatch.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesResourcePatch.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index a505497b13..966314ffe3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -18,13 +18,18 @@ import app.revanced.patches.youtube.layout.hide.general.fingerprints.HideShowMor import app.revanced.patches.youtube.layout.hide.general.fingerprints.ParseElementFromBufferFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.PlayerOverlayFingerprint import app.revanced.patches.youtube.layout.hide.general.fingerprints.ShowWatermarkFingerprint +import app.revanced.patches.youtube.layout.hide.general.fingerprints.YoodlesImageViewFingerprint import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch import app.revanced.patches.youtube.misc.navigation.NavigationBarHookPatch import app.revanced.patches.youtube.misc.settings.SettingsPatch +import app.revanced.util.findOpcodeIndicesReversed +import app.revanced.util.getReference import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction +import com.android.tools.smali.dexlib2.iface.reference.MethodReference @Patch( name = "Hide layout components", @@ -70,7 +75,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction ) @Suppress("unused") object HideLayoutComponentsPatch : BytecodePatch( - setOf(ParseElementFromBufferFingerprint, PlayerOverlayFingerprint, HideShowMoreButtonFingerprint), + setOf( + ParseElementFromBufferFingerprint, + PlayerOverlayFingerprint, + HideShowMoreButtonFingerprint, + YoodlesImageViewFingerprint, + ), ) { private const val LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/components/LayoutComponentsFilter;" @@ -128,6 +138,7 @@ object HideLayoutComponentsPatch : BytecodePatch( SwitchPreference("revanced_hide_search_result_recommendations"), SwitchPreference("revanced_hide_search_result_shelf_header"), SwitchPreference("revanced_hide_show_more_button"), + SwitchPreference("revanced_hide_yoodles"), PreferenceScreen( key = "revanced_hide_keyword_content_screen", sorting = Sorting.UNSORTED, @@ -226,5 +237,30 @@ object HideLayoutComponentsPatch : BytecodePatch( } // endregion + + // region 'Yoodles' + + println("method: " + YoodlesImageViewFingerprint.resultOrThrow().method) + + YoodlesImageViewFingerprint.resultOrThrow().mutableMethod.apply { + findOpcodeIndicesReversed{ + opcode == Opcode.INVOKE_VIRTUAL + && getReference()?.name == "setImageDrawable" + }.forEach { insertIndex -> + val register = getInstruction(insertIndex).registerD + + addInstructionsWithLabels( + insertIndex, + """ + invoke-static { v$register }, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->hideYoodles(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable; + move-result-object v$register + if-eqz v$register, :enabled + """, + ExternalLabel("enabled", getInstruction(insertIndex + 1)), + ) + } + } + + // endregion } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt index c7b60d544e..24dcbb3f19 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsResourcePatch.kt @@ -17,10 +17,17 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch internal object HideLayoutComponentsResourcePatch : ResourcePatch() { internal var expandButtonDownId: Long = -1 + var youTubeLogo = -1L + override fun execute(context: ResourceContext) { expandButtonDownId = ResourceMappingPatch[ "layout", "expand_button_down", ] + + youTubeLogo = ResourceMappingPatch[ + "id", + "youtube_logo" + ] } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/fingerprints/YoodlesImageViewFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/YoodlesImageViewFingerprint.kt similarity index 61% rename from src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/fingerprints/YoodlesImageViewFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/YoodlesImageViewFingerprint.kt index 90b926ccee..092b5110b4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/fingerprints/YoodlesImageViewFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/fingerprints/YoodlesImageViewFingerprint.kt @@ -1,7 +1,7 @@ -package app.revanced.patches.youtube.layout.hide.yoodles.fingerprints +package app.revanced.patches.youtube.layout.hide.general.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patches.youtube.layout.hide.yoodles.YoodlesResourcePatch +import app.revanced.patches.youtube.layout.hide.general.HideLayoutComponentsResourcePatch import app.revanced.util.patch.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags @@ -9,5 +9,5 @@ internal object YoodlesImageViewFingerprint : LiteralValueFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("L", "L"), returnType = "Landroid/view/View;", - literalSupplier = { YoodlesResourcePatch.youTubeLogo } + literalSupplier = { HideLayoutComponentsResourcePatch.youTubeLogo } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesPatch.kt deleted file mode 100644 index ff4b19d14b..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesPatch.kt +++ /dev/null @@ -1,76 +0,0 @@ -package app.revanced.patches.youtube.layout.hide.yoodles - -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.all.misc.resources.AddResourcesPatch -import app.revanced.patches.shared.misc.settings.preference.SwitchPreference -import app.revanced.patches.youtube.layout.hide.yoodles.fingerprints.YoodlesImageViewFingerprint -import app.revanced.patches.youtube.misc.settings.SettingsPatch -import app.revanced.util.findOpcodeIndicesReversed -import app.revanced.util.getReference -import app.revanced.util.resultOrThrow -import com.android.tools.smali.dexlib2.Opcode -import com.android.tools.smali.dexlib2.iface.reference.MethodReference - -// Yes, YouTube gave this feature the goofy name of "Yoodles". -// https://logos.fandom.com/wiki/YouTube/Yoodles -@Patch( - name = "Hide Yoodles", - description = "Adds options to hide the YouTube doodle that sometimes replaces the YouTube logo beside the search bar.", - dependencies = [ - YoodlesResourcePatch::class, - SettingsPatch::class, - AddResourcesPatch::class - ], - compatiblePackages = [ - CompatiblePackage( - "com.google.android.youtube", - [ - "18.48.39", - "18.49.37", - "19.01.34", - "19.02.39", - "19.03.36", - "19.04.38", - "19.05.36", - "19.06.39", - "19.07.40", - "19.08.36", - "19.09.38", - "19.10.39", - "19.11.43", - "19.12.41", - "19.13.37", - "19.14.43", - "19.15.36", - "19.16.39", - ], - ), - ], -) -@Suppress("unused") -object YoodlesPatch : BytecodePatch(setOf(YoodlesImageViewFingerprint)) { - - private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/youtube/patches/yoodles/YoodlesPatch;" - - override fun execute(context: BytecodeContext) { - AddResourcesPatch(this::class) - - SettingsPatch.PreferenceScreen.FEED.addPreferences( - SwitchPreference("revanced_hide_yoodles"), - ) - - YoodlesImageViewFingerprint.resultOrThrow().mutableMethod.apply { - findOpcodeIndicesReversed{ - opcode == Opcode.INVOKE_VIRTUAL - && getReference()?.name == "setImageDrawable" - }.forEach { - removeInstruction(it) - } - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesResourcePatch.kt deleted file mode 100644 index c4dc6b8787..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/yoodles/YoodlesResourcePatch.kt +++ /dev/null @@ -1,17 +0,0 @@ -package app.revanced.patches.youtube.layout.hide.yoodles - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch - -internal object YoodlesResourcePatch : ResourcePatch() { - - var youTubeLogo = -1L - - override fun execute(context: ResourceContext) { - youTubeLogo = ResourceMappingPatch[ - "id", - "youtube_logo" - ] - } -} \ No newline at end of file diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 7e913e6092..d15e51017f 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -231,6 +231,12 @@ This is because Crowdin requires temporarily flattening this file and removing t Transcript section is shown Video description Hide or show video description components + + + Hide Yoodles (YouTube Doodles) + Search bar Yoodles are hidden + Search bar Yoodles will be periodically shown + Custom filter Hide components using custom filters Enable custom filter @@ -240,6 +246,7 @@ This is because Crowdin requires temporarily flattening this file and removing t List of component path builder strings to filter separated by new line Invalid custom filter: %s + Hide keyword content Hide search and feed videos using keyword filters Hide home videos by keywords From 4075089935f3c1b7f4c76e7cb8d0aa1ccbcab3e7 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 5 Oct 2024 19:17:39 -0400 Subject: [PATCH 3/7] Update src/main/kotlin/app/revanced/util/BytecodeUtils.kt Co-authored-by: oSumAtrIX --- src/main/kotlin/app/revanced/util/BytecodeUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt index d8e9467556..98ec71428e 100644 --- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt +++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt @@ -233,7 +233,7 @@ fun Method.findOpcodeIndicesReversed(opcode: Opcode): List = fun Method.findOpcodeIndicesReversed(filter: Instruction.() -> Boolean): List { val indexes = implementation!!.instructions .withIndex() - .filter { (_, instruction) -> filter.invoke(instruction) } + .filter { (_, instruction) -> filter(instruction) } .map { (index, _) -> index } .reversed() From 0efbcd09b5f9e79058158d070368d2a676b812b8 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 5 Oct 2024 19:19:55 -0400 Subject: [PATCH 4/7] fix: remove duplicate strings --- src/main/resources/addresources/values/strings.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index d15e51017f..f93755a61e 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -696,11 +696,6 @@ This is because Crowdin requires temporarily flattening this file and removing t Timestamp is hidden Timestamp is shown - - Hide Yoodles (YouTube Doodles) - Search bar yoodles are hidden - Search bar yoodles will be periodically shown - Hide player popup panels Player popup panels are hidden From 62635fd77c5fc57cc04a915d6dc78509b4a4b3e3 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 5 Oct 2024 19:46:13 -0400 Subject: [PATCH 5/7] refactor --- .../youtube/layout/hide/general/HideLayoutComponentsPatch.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index 966314ffe3..1c12f3c561 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -254,9 +254,9 @@ object HideLayoutComponentsPatch : BytecodePatch( """ invoke-static { v$register }, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->hideYoodles(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable; move-result-object v$register - if-eqz v$register, :enabled + if-eqz v$register, :hide """, - ExternalLabel("enabled", getInstruction(insertIndex + 1)), + ExternalLabel("hide", getInstruction(insertIndex + 1)), ) } } From 94be55a93a7db36791ee8764db524d813af82bbc Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 5 Oct 2024 19:58:11 -0400 Subject: [PATCH 6/7] fix: Set to default off, add disclaimer about filter bar --- src/main/resources/addresources/values/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index f93755a61e..645f24cc34 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -236,6 +236,7 @@ This is because Crowdin requires temporarily flattening this file and removing t Hide Yoodles (YouTube Doodles) Search bar Yoodles are hidden Search bar Yoodles will be periodically shown + YouTube Yoodles show up a few days each year.\n\nIf a Yoodle is currently showing in your region and this hide setting is on, then the filter bar below the search bar will also be hidden. Custom filter Hide components using custom filters From 1f7f9d944f1855717523082a64f3dcb04d6be70a Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 5 Oct 2024 19:59:33 -0400 Subject: [PATCH 7/7] fix: Remove debugging code --- .../youtube/layout/hide/general/HideLayoutComponentsPatch.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index 1c12f3c561..4f2e832d8f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -240,8 +240,6 @@ object HideLayoutComponentsPatch : BytecodePatch( // region 'Yoodles' - println("method: " + YoodlesImageViewFingerprint.resultOrThrow().method) - YoodlesImageViewFingerprint.resultOrThrow().mutableMethod.apply { findOpcodeIndicesReversed{ opcode == Opcode.INVOKE_VIRTUAL