Skip to content

Commit

Permalink
fix(YouTube - Settings): Move some settings to different menus, adjus…
Browse files Browse the repository at this point in the history
…t default setting values (#3415)
  • Loading branch information
LisoUseInAIKyrios authored Jul 5, 2024
1 parent cf34a98 commit 7201ac4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import app.revanced.util.resultOrThrow

@Patch(
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 = [
CompatiblePackage(
"com.google.android.apps.youtube.music",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ object HideLayoutComponentsPatch : BytecodePatch(
),
),
SwitchPreference("revanced_hide_emergency_box"),
SwitchPreference("revanced_hide_expandable_chip"),
SwitchPreference("revanced_hide_info_panels"),
SwitchPreference("revanced_hide_join_membership_button"),
SwitchPreference("revanced_disable_like_subscribe_glow"),
Expand Down Expand Up @@ -143,6 +142,7 @@ object HideLayoutComponentsPatch : BytecodePatch(
)

SettingsPatch.PreferenceScreen.GENERAL_LAYOUT.addPreferences(
SwitchPreference("revanced_hide_expandable_chip"),
SwitchPreference("revanced_hide_gray_separator"),
PreferenceScreen(
key = "revanced_custom_filter_screen",
Expand All @@ -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(DESCRIPTION_COMPONENTS_FILTER_CLASS_NAME)
LithoFilterPatch.addFilter(KEYWORD_FILTER_CLASS_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ object HidePlayerFlyoutMenuPatch : ResourcePatch() {
SwitchPreference("revanced_hide_player_flyout_more_info"),
SwitchPreference("revanced_hide_player_flyout_audio_track"),
SwitchPreference("revanced_hide_player_flyout_watch_in_vr"),
SwitchPreference("revanced_hide_video_quality_menu_footer"),
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
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.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.settings.SettingsPatch
import app.revanced.patches.youtube.video.information.VideoInformationPatch
Expand All @@ -29,7 +27,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
PlayerTypeHookPatch::class,
VideoInformationPatch::class,
SettingsPatch::class,
AddResourcesPatch::class
],
compatiblePackages = [
CompatiblePackage(
Expand Down Expand Up @@ -69,12 +66,6 @@ object BackgroundPlaybackPatch : BytecodePatch(
"Lapp/revanced/integrations/youtube/patches/BackgroundPlaybackPatch;"

override fun execute(context: BytecodeContext) {
AddResourcesPatch(this::class)

SettingsPatch.PreferenceScreen.MISC.addPreferences(
NonInteractivePreference("revanced_background_playback")
)

BackgroundPlaybackManagerFingerprint.resultOrThrow().mutableMethod.addInstructions(
0,
"""
Expand Down
4 changes: 0 additions & 4 deletions src/main/resources/addresources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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_off">Opening links in app</string>
</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">
<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>
Expand Down

0 comments on commit 7201ac4

Please sign in to comment.