diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/components/ShortsComponentPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/components/ShortsComponentPatch.kt index abd2fd09b..f10b46690 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/components/ShortsComponentPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/components/ShortsComponentPatch.kt @@ -21,6 +21,7 @@ import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PAC import app.revanced.patches.youtube.utils.fingerprints.TextComponentSpecFingerprint import app.revanced.patches.youtube.utils.integrations.Constants.COMPONENTS_PATH import app.revanced.patches.youtube.utils.integrations.Constants.SHORTS_CLASS_DESCRIPTOR +import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH import app.revanced.patches.youtube.utils.playertype.PlayerTypeHookPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelDynRemix @@ -68,10 +69,15 @@ object ShortsComponentPatch : BaseBytecodePatch( TextComponentSpecFingerprint ) ) { + private const val INTEGRATION_CLASS_DESCRIPTOR = + "$UTILS_PATH/ReturnYouTubeChannelNamePatch;" + private const val BUTTON_FILTER_CLASS_DESCRIPTOR = "$COMPONENTS_PATH/ShortsButtonFilter;" private const val SHELF_FILTER_CLASS_DESCRIPTOR = "$COMPONENTS_PATH/ShortsShelfFilter;" + private const val RETURN_YOUTUBE_CHANNEL_NAME_FILTER_CLASS_DESCRIPTOR = + "$COMPONENTS_PATH/ReturnYouTubeChannelNameFilterPatch;" override fun execute(context: BytecodeContext) { @@ -258,7 +264,7 @@ object ShortsComponentPatch : BaseBytecodePatch( addInstructions( insertIndex + 1, """ - invoke-static {v$conversionContextRegister, v$charSequenceRegister}, $SHORTS_CLASS_DESCRIPTOR->onCharSequenceLoaded(Ljava/lang/Object;Ljava/lang/CharSequence;)Ljava/lang/CharSequence; + invoke-static {v$conversionContextRegister, v$charSequenceRegister}, $INTEGRATION_CLASS_DESCRIPTOR->onCharSequenceLoaded(Ljava/lang/Object;Ljava/lang/CharSequence;)Ljava/lang/CharSequence; move-result-object v$charSequenceRegister invoke-static {v$charSequenceRegister}, $replaceReference """ @@ -267,12 +273,13 @@ object ShortsComponentPatch : BaseBytecodePatch( } } - VideoInformationPatch.hookShorts("$SHORTS_CLASS_DESCRIPTOR->newShortsVideoStarted(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JZ)V") + VideoInformationPatch.hookShorts("$INTEGRATION_CLASS_DESCRIPTOR->newShortsVideoStarted(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JZ)V") // endregion LithoFilterPatch.addFilter(BUTTON_FILTER_CLASS_DESCRIPTOR) LithoFilterPatch.addFilter(SHELF_FILTER_CLASS_DESCRIPTOR) + LithoFilterPatch.addFilter(RETURN_YOUTUBE_CHANNEL_NAME_FILTER_CLASS_DESCRIPTOR) /** * Add settings diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml index e94ec8421..84d0d76ef 100644 --- a/src/main/resources/youtube/settings/host/values/strings.xml +++ b/src/main/resources/youtube/settings/host/values/strings.xml @@ -987,6 +987,10 @@ Limitation: Official headers in search results will be hidden." Return shorts channel name Channel name is used. Channel handle is used. + Fetch from rss feed + "Use the channel name taken from RSS feed. +It may take longer to fetch the channel name." + "Use YouTube's built-in channel name." diff --git a/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/src/main/resources/youtube/settings/xml/revanced_prefs.xml index 77936b35f..7af71c060 100644 --- a/src/main/resources/youtube/settings/xml/revanced_prefs.xml +++ b/src/main/resources/youtube/settings/xml/revanced_prefs.xml @@ -431,6 +431,7 @@ + SETTINGS: SHORTS_COMPONENTS -->