feat(YouTube Music): add Remove viewer discretion dialog patch

This commit is contained in:
inotia00 2023-12-30 23:08:47 +09:00
parent 68fdbbb912
commit 63578407d7
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,31 @@
package app.revanced.patches.music.general.dialog
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.music.utils.integrations.Constants.GENERAL
import app.revanced.patches.music.utils.settings.CategoryType
import app.revanced.patches.music.utils.settings.SettingsPatch
import app.revanced.patches.shared.patch.dialog.AbstractRemoveViewerDiscretionDialogPatch
@Patch(
name = "Remove viewer discretion dialog",
description = "Removes the dialog that appears when you try to watch a video that has been age-restricted " +
"by accepting it automatically. This does not bypass the age restriction.",
dependencies = [SettingsPatch::class],
compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")]
)
@Suppress("unused")
object RemoveViewerDiscretionDialogPatch : AbstractRemoveViewerDiscretionDialogPatch(
GENERAL
) {
override fun execute(context: BytecodeContext) {
super.execute(context)
SettingsPatch.addMusicPreference(
CategoryType.GENERAL,
"revanced_remove_viewer_discretion_dialog",
"false"
)
}
}

View File

@ -181,6 +181,9 @@ WARNING: Do not enable new player backgrounds while this is enabled."</string>
<string name="revanced_playback_speed_normal">Normal</string>
<string name="revanced_playlist_dismiss">Already playing official music source.</string>
<string name="revanced_playlist_error">Official music source not available.</string>
<string name="revanced_remove_viewer_discretion_dialog_summary">"Remove viewer discretion dialog.
This does not bypass the age restriction, it just accepts it automatically."</string>
<string name="revanced_remove_viewer_discretion_dialog_title">Remove viewer discretion dialog</string>
<string name="revanced_restart_first_run">Restart to load the layout normally</string>
<string name="revanced_restart_message">Refresh and restart</string>
<string name="revanced_replace_flyout_panel_dismiss_queue_continue_watch_summary">When watching on YouTube, continue watching from the current time.</string>