fix(YouTube - Settings): Move some settings to different menus, adjust default setting values (#3415)

This commit is contained in:
LisoUseInAIKyrios 2024-07-05 21:38:52 +04:00 committed by GitHub
parent cf34a98aa0
commit 7201ac45c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 21 deletions

View file

@ -12,7 +12,7 @@ import app.revanced.util.resultOrThrow
@Patch( @Patch(
name = "Remove background playback restrictions", name = "Remove background playback restrictions",
description = "Removes restrictions on background playback.", description = "Removes restrictions on background playback, including playing kids videos in the background.",
compatiblePackages = [ compatiblePackages = [
CompatiblePackage( CompatiblePackage(
"com.google.android.apps.youtube.music", "com.google.android.apps.youtube.music",

View file

@ -102,7 +102,6 @@ object HideLayoutComponentsPatch : BytecodePatch(
), ),
), ),
SwitchPreference("revanced_hide_emergency_box"), SwitchPreference("revanced_hide_emergency_box"),
SwitchPreference("revanced_hide_expandable_chip"),
SwitchPreference("revanced_hide_info_panels"), SwitchPreference("revanced_hide_info_panels"),
SwitchPreference("revanced_hide_join_membership_button"), SwitchPreference("revanced_hide_join_membership_button"),
SwitchPreference("revanced_disable_like_subscribe_glow"), SwitchPreference("revanced_disable_like_subscribe_glow"),
@ -143,6 +142,7 @@ object HideLayoutComponentsPatch : BytecodePatch(
) )
SettingsPatch.PreferenceScreen.GENERAL_LAYOUT.addPreferences( SettingsPatch.PreferenceScreen.GENERAL_LAYOUT.addPreferences(
SwitchPreference("revanced_hide_expandable_chip"),
SwitchPreference("revanced_hide_gray_separator"), SwitchPreference("revanced_hide_gray_separator"),
PreferenceScreen( PreferenceScreen(
key = "revanced_custom_filter_screen", key = "revanced_custom_filter_screen",
@ -155,10 +155,6 @@ object HideLayoutComponentsPatch : BytecodePatch(
), ),
) )
SettingsPatch.PreferenceScreen.VIDEO.addPreferences(
SwitchPreference("revanced_hide_video_quality_menu_footer"),
)
LithoFilterPatch.addFilter(LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR) LithoFilterPatch.addFilter(LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR)
LithoFilterPatch.addFilter(DESCRIPTION_COMPONENTS_FILTER_CLASS_NAME) LithoFilterPatch.addFilter(DESCRIPTION_COMPONENTS_FILTER_CLASS_NAME)
LithoFilterPatch.addFilter(KEYWORD_FILTER_CLASS_NAME) LithoFilterPatch.addFilter(KEYWORD_FILTER_CLASS_NAME)

View file

@ -74,6 +74,7 @@ object HidePlayerFlyoutMenuPatch : ResourcePatch() {
SwitchPreference("revanced_hide_player_flyout_more_info"), SwitchPreference("revanced_hide_player_flyout_more_info"),
SwitchPreference("revanced_hide_player_flyout_audio_track"), SwitchPreference("revanced_hide_player_flyout_audio_track"),
SwitchPreference("revanced_hide_player_flyout_watch_in_vr"), SwitchPreference("revanced_hide_player_flyout_watch_in_vr"),
SwitchPreference("revanced_hide_video_quality_menu_footer"),
) )
) )
) )

View file

@ -7,12 +7,10 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.all.misc.resources.AddResourcesPatch
import app.revanced.patches.shared.misc.settings.preference.NonInteractivePreference
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.backgroundplayback.fingerprints.KidsBackgroundPlaybackPolicyControllerFingerprint
import app.revanced.patches.youtube.misc.backgroundplayback.fingerprints.BackgroundPlaybackManagerFingerprint import app.revanced.patches.youtube.misc.backgroundplayback.fingerprints.BackgroundPlaybackManagerFingerprint
import app.revanced.patches.youtube.misc.backgroundplayback.fingerprints.BackgroundPlaybackSettingsFingerprint import app.revanced.patches.youtube.misc.backgroundplayback.fingerprints.BackgroundPlaybackSettingsFingerprint
import app.revanced.patches.youtube.misc.backgroundplayback.fingerprints.KidsBackgroundPlaybackPolicyControllerFingerprint
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
import app.revanced.patches.youtube.misc.settings.SettingsPatch import app.revanced.patches.youtube.misc.settings.SettingsPatch
import app.revanced.patches.youtube.video.information.VideoInformationPatch import app.revanced.patches.youtube.video.information.VideoInformationPatch
@ -29,7 +27,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
PlayerTypeHookPatch::class, PlayerTypeHookPatch::class,
VideoInformationPatch::class, VideoInformationPatch::class,
SettingsPatch::class, SettingsPatch::class,
AddResourcesPatch::class
], ],
compatiblePackages = [ compatiblePackages = [
CompatiblePackage( CompatiblePackage(
@ -69,12 +66,6 @@ object BackgroundPlaybackPatch : BytecodePatch(
"Lapp/revanced/integrations/youtube/patches/BackgroundPlaybackPatch;" "Lapp/revanced/integrations/youtube/patches/BackgroundPlaybackPatch;"
override fun execute(context: BytecodeContext) { override fun execute(context: BytecodeContext) {
AddResourcesPatch(this::class)
SettingsPatch.PreferenceScreen.MISC.addPreferences(
NonInteractivePreference("revanced_background_playback")
)
BackgroundPlaybackManagerFingerprint.resultOrThrow().mutableMethod.addInstructions( BackgroundPlaybackManagerFingerprint.resultOrThrow().mutableMethod.addInstructions(
0, 0,
""" """

View file

@ -1064,10 +1064,6 @@ This is because Crowdin requires temporarily flattening this file and removing t
<string name="revanced_external_browser_summary_on">Opening links externally</string> <string name="revanced_external_browser_summary_on">Opening links externally</string>
<string name="revanced_external_browser_summary_off">Opening links in app</string> <string name="revanced_external_browser_summary_off">Opening links in app</string>
</patch> </patch>
<patch id="misc.backgroundplayback.BackgroundPlaybackPatch">
<string name="revanced_background_playback_title">Background playback</string>
<string name="revanced_background_playback_summary">This setting can be found in Settings -&gt; Background</string>
</patch>
<patch id="misc.privacy.RemoveTrackingQueryParameterPatch"> <patch id="misc.privacy.RemoveTrackingQueryParameterPatch">
<string name="revanced_remove_tracking_query_parameter_title">Remove tracking query parameter</string> <string name="revanced_remove_tracking_query_parameter_title">Remove tracking query parameter</string>
<string name="revanced_remove_tracking_query_parameter_summary_on">Tracking query parameter is removed from links</string> <string name="revanced_remove_tracking_query_parameter_summary_on">Tracking query parameter is removed from links</string>