Skip to content

Commit 82c76f0

Browse files
committed
feat(YouTube): Add Tuck away preferences for force hide elements from main settings
1 parent fd296f3 commit 82c76f0

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

src/main/kotlin/app/revanced/patches/youtube/layout/settings/HideSettingsPrefsPatch.kt

+18-9
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@ import app.revanced.patches.youtube.utils.settings.SettingsPatch
1010
import org.w3c.dom.Element
1111

1212
@Patch(
13-
name = "Hide settings preferences",
14-
description = "Force to hide settings menu elements. Prefs \"About\" (it won't add ReVanced/SB/RYD settings) and \"Account\" (it will crash the app) will be ignored if you add them.",
13+
name = "Tuck away preferences",
14+
description = "Force to hide settings menu elements. Prefs \"Account\" and \"Your data in YouTube\" will be ignored if you add them as they may cause a crash.",
1515
compatiblePackages = [CompatiblePackage("com.google.android.youtube")]
1616
)
1717
@Suppress("unused")
1818
object HideSettingsPrefsPatch : ResourcePatch() {
1919

20-
private const val DEFAULT_ELEMENTS = "General, Data saving, Autoplay, " +
21-
"Video quality preferences, Background, Watch on TV, History & privacy, " +
22-
"Try experimental new features, Notifications, Captions, Accessibility"
20+
private const val DEFAULT_ELEMENTS = "Data saving, Video quality preferences, Background, Watch on TV, " +
21+
"Manage all history, Privacy, Try experimental new features, " +
22+
"Purchases and memberships, Billing & payments, Notifications, Captions, Connected apps, " +
23+
"Live chat, Accessibility, About"
2324

2425
private val SettingElements by stringPatchOption(
2526
key = "SettingElements",
@@ -30,17 +31,25 @@ object HideSettingsPrefsPatch : ResourcePatch() {
3031

3132
private val DEFAULT_ELEMENTS_MAP = mapOf(
3233
"General" to "general_key",
33-
"Account" to "account_switcher_key",
34+
// "Account" to "account_switcher_key",
3435
"Data saving" to "data_saving_settings_key",
3536
"Autoplay" to "auto_play_key",
3637
"Video quality preferences" to "video_quality_settings_key",
37-
"Background" to "offline_key", // no
38+
"Background" to "offline_key",
3839
"Watch on TV" to "pair_with_tv_key",
40+
"Manage all history" to "history_key",
41+
// "Your data in YouTube" to "your_data_key",
42+
"Privacy" to "privacy_key",
3943
"History & privacy" to "privacy_key",
4044
"Try experimental new features" to "premium_early_access_browse_page_key",
45+
"Purchases and memberships" to "yt_unlimited_post_purchase_key",
46+
"Billing & payments" to "billing_and_payment_key",
4147
"Notifications" to "notification_key",
48+
"Connected apps" to "connected_accounts_browse_page_key",
49+
"Live chat" to "live_chat_key",
4250
"Captions" to "captions_key",
43-
"Accessibility" to "accessibility_settings_key"
51+
"Accessibility" to "accessibility_settings_key",
52+
"About" to "about_key"
4453
)
4554

4655
// Function to parse comma-separated string into a list of strings
@@ -73,6 +82,6 @@ object HideSettingsPrefsPatch : ResourcePatch() {
7382
}
7483
}
7584

76-
SettingsPatch.updatePatchStatus("Hide settings preferences")
85+
SettingsPatch.updatePatchStatus("Tuck away preferences")
7786
}
7887
}

src/main/resources/youtube/settings/xml/revanced_prefs.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -712,12 +712,12 @@
712712
<Preference android:title="Hide load more button" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
713713
<Preference android:title="Hide mix playlists" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
714714
<Preference android:title="Hide search term thumbnail" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
715-
<Preference android:title="Hide settings preferences" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
716715
<Preference android:title="Hide snack bar" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
717716
<Preference android:title="Hide suggestions shelf" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
718717
<Preference android:title="Hide toolbar button" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
719718
<Preference android:title="Hide trending searches" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
720719
<Preference android:title="Remove viewer discretion dialog" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
720+
<Preference android:title="Tuck away preferences" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
721721

722722
<Preference android:title=" " android:selectable="false" android:summary="@string/revanced_misc" />
723723
<Preference android:title="Ambient mode switch" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>

0 commit comments

Comments
 (0)