2023-09-20 05:33:02 +02:00
|
|
|
package app.revanced.patches.youtube.misc.debugging
|
2022-07-04 18:10:49 +02:00
|
|
|
|
2022-10-05 04:03:10 +02:00
|
|
|
import app.revanced.patcher.data.ResourceContext
|
2023-04-24 03:12:09 +02:00
|
|
|
import app.revanced.patcher.patch.ResourcePatch
|
2023-09-20 05:33:02 +02:00
|
|
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
|
|
|
import app.revanced.patcher.patch.annotation.Patch
|
2024-01-27 02:34:01 +01:00
|
|
|
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
|
|
|
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
2024-03-02 08:27:05 +01:00
|
|
|
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen.Sorting
|
2024-01-27 02:34:01 +01:00
|
|
|
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
2023-09-20 05:33:02 +02:00
|
|
|
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
|
|
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
2022-07-04 18:10:49 +02:00
|
|
|
|
2023-09-20 05:33:02 +02:00
|
|
|
@Patch(
|
|
|
|
name = "Enable debugging",
|
2024-01-01 16:30:04 +01:00
|
|
|
description = "Adds options for debugging.",
|
2024-01-27 02:34:01 +01:00
|
|
|
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
2024-03-02 08:27:05 +01:00
|
|
|
compatiblePackages = [CompatiblePackage("com.google.android.youtube")],
|
2023-09-20 05:33:02 +02:00
|
|
|
)
|
|
|
|
@Suppress("unused")
|
|
|
|
object DebuggingPatch : ResourcePatch() {
|
2023-08-27 21:40:49 +02:00
|
|
|
override fun execute(context: ResourceContext) {
|
2024-01-27 02:34:01 +01:00
|
|
|
AddResourcesPatch(this::class)
|
|
|
|
|
2022-08-27 03:21:53 +02:00
|
|
|
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
2024-01-27 02:34:01 +01:00
|
|
|
PreferenceScreen(
|
2024-03-02 08:27:05 +01:00
|
|
|
key = "revanced_debug_screen",
|
|
|
|
sorting = Sorting.UNSORTED,
|
2024-01-27 02:34:01 +01:00
|
|
|
preferences = setOf(
|
|
|
|
SwitchPreference("revanced_debug"),
|
|
|
|
SwitchPreference("revanced_debug_protobuffer"),
|
|
|
|
SwitchPreference("revanced_debug_stacktrace"),
|
2024-03-02 08:27:05 +01:00
|
|
|
SwitchPreference("revanced_debug_toast_on_error"),
|
|
|
|
),
|
|
|
|
),
|
2022-08-27 03:21:53 +02:00
|
|
|
)
|
2022-07-04 18:10:49 +02:00
|
|
|
}
|
2022-07-08 06:30:59 +02:00
|
|
|
}
|