diff --git a/src/main/kotlin/app/revanced/patches/youtube/navigation/navigationbuttons/NavigationButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/navigation/navigationbuttons/NavigationButtonsPatch.kt
index 66fe6410e..b20ed613b 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/navigation/navigationbuttons/NavigationButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/navigation/navigationbuttons/NavigationButtonsPatch.kt
@@ -13,6 +13,7 @@ import app.revanced.patches.youtube.navigation.navigationbuttons.fingerprints.Pi
import app.revanced.patches.youtube.navigation.navigationbuttons.fingerprints.PivotBarShortsButtonViewFingerprint
import app.revanced.patches.youtube.utils.fingerprints.PivotBarCreateButtonViewFingerprint
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
+import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.AvatarImageWithTextTab
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ImageOnlyTab
import app.revanced.patches.youtube.utils.settings.SettingsPatch
import app.revanced.util.bytecode.getWideLiteralIndex
@@ -94,17 +95,22 @@ object NavigationButtonsPatch : BytecodePatch(
}
/**
- * Create Button
+ * Create, You Button
*/
parentResult.mutableMethod.apply {
- val insertIndex = implementation!!.instructions.let {
- val scanStart = getWideLiteralIndex(ImageOnlyTab)
+ mapOf(
+ CREATE_BUTTON_HOOK to ImageOnlyTab,
+ YOU_BUTTON_HOOK to AvatarImageWithTextTab
+ ).forEach { (hook, resourceId) ->
+ val insertIndex = implementation!!.instructions.let {
+ val scanStart = getWideLiteralIndex(resourceId)
- scanStart + it.subList(scanStart, it.size - 1).indexOfFirst { instruction ->
- instruction.opcode == Opcode.INVOKE_VIRTUAL
- }
- } + 2
- injectHook(CREATE_BUTTON_HOOK, insertIndex)
+ scanStart + it.subList(scanStart, it.size - 1).indexOfFirst { instruction ->
+ instruction.opcode == Opcode.INVOKE_VIRTUAL
+ }
+ } + 2
+ injectHook(hook, insertIndex)
+ }
}
} ?: throw PivotBarCreateButtonViewFingerprint.exception
@@ -154,4 +160,9 @@ object NavigationButtonsPatch : BytecodePatch(
"invoke-static { v$REGISTER_TEMPLATE_REPLACEMENT }, $NAVIGATION" +
"->" +
"hideCreateButton(Landroid/view/View;)V"
+
+ private const val YOU_BUTTON_HOOK =
+ "invoke-static { v$REGISTER_TEMPLATE_REPLACEMENT }, $NAVIGATION" +
+ "->" +
+ "hideYouButton(Landroid/view/View;)V"
}
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/resourceid/SharedResourceIdPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/resourceid/SharedResourceIdPatch.kt
index 315906a62..7614f2179 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/utils/resourceid/SharedResourceIdPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/utils/resourceid/SharedResourceIdPatch.kt
@@ -23,6 +23,7 @@ object SharedResourceIdPatch : ResourcePatch() {
var AppRelatedEndScreenResults: Long = -1
var AutoNavPreviewStub: Long = -1
var AutoNavToggle: Long = -1
+ var AvatarImageWithTextTab: Long = -1
var BackgroundCategory: Long = -1
var Bar: Long = -1
var BarContainerHeight: Long = -1
@@ -103,6 +104,7 @@ object SharedResourceIdPatch : ResourcePatch() {
AppRelatedEndScreenResults = find(LAYOUT, "app_related_endscreen_results")
AutoNavPreviewStub = find(ID, "autonav_preview_stub")
AutoNavToggle = find(ID, "autonav_toggle")
+ AvatarImageWithTextTab = find(LAYOUT, "avatar_image_with_text_tab")
BackgroundCategory = find(STRING, "pref_background_and_offline_category")
Bar = find(LAYOUT, "bar")
BarContainerHeight = find(DIMEN, "bar_container_height")
diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml
index 25273a66e..69570d3eb 100644
--- a/src/main/resources/youtube/settings/host/values/strings.xml
+++ b/src/main/resources/youtube/settings/host/values/strings.xml
@@ -578,9 +578,9 @@ Known issue: Autoplay does not work"
Layout
Miscellaneous
Navigation
- Library is not opened at app startup
- Library is opened at app startup
- Open library on app startup
+ Library(You) is not opened at app startup
+ Library(You) is opened at app startup
+ Open library(You) on app startup
Others
Overlay button
"Tap to toggle always repeat states