mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 13:17:46 +02:00
feat(YouTube Music): add Remove viewer discretion dialog
patch
This commit is contained in:
@ -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"
|
||||
)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user