From 3e252d4cb3de4a69877b921d47b9e7f75712cdc8 Mon Sep 17 00:00:00 2001 From: inotia00 Date: Tue, 20 Jun 2023 17:28:16 +0900 Subject: [PATCH] feat(youtube): add `enable-debug-logging` patch --- .../misc/debugging/patch/DebuggingPatch.kt | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/debugging/patch/DebuggingPatch.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/debugging/patch/DebuggingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/debugging/patch/DebuggingPatch.kt new file mode 100644 index 000000000..84f3fca43 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/debugging/patch/DebuggingPatch.kt @@ -0,0 +1,38 @@ +package app.revanced.patches.youtube.misc.debugging.patch + +import app.revanced.patcher.annotation.Description +import app.revanced.patcher.annotation.Name +import app.revanced.patcher.annotation.Version +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.PatchResult +import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.ResourcePatch +import app.revanced.patcher.patch.annotations.DependsOn +import app.revanced.patcher.patch.annotations.Patch +import app.revanced.patches.shared.annotation.YouTubeCompatibility +import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch + +@Patch(false) +@Name("enable-debug-logging") +@Description("Adds debugging options.") +@DependsOn([SettingsPatch::class]) +@YouTubeCompatibility +@Version("0.0.2") +class DebuggingPatch : ResourcePatch { + override fun execute(context: ResourceContext): PatchResult { + + /** + * Add settings + */ + SettingsPatch.addPreference( + arrayOf( + "SETTINGS: ENABLE_DEBUG_LOGGING" + ) + ) + + SettingsPatch.updatePatchStatus("enable-debug-logging") + + + return PatchResultSuccess() + } +}