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"
)
}
}