From 3e25f5f8df24a585dc1097aa16877841f0c6b74a Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 26 Jun 2023 23:01:34 +0400 Subject: [PATCH] fix(enable-android-debugging): remove json options (#2497) --- .../patch/EnableAndroidDebuggingPatch.kt | 26 +++++-------------- .../misc/debugging/patch/DebuggingPatch.kt | 3 +-- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/all/misc/debugging/patch/EnableAndroidDebuggingPatch.kt b/src/main/kotlin/app/revanced/patches/all/misc/debugging/patch/EnableAndroidDebuggingPatch.kt index 88199d0367..af75803d19 100644 --- a/src/main/kotlin/app/revanced/patches/all/misc/debugging/patch/EnableAndroidDebuggingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/all/misc/debugging/patch/EnableAndroidDebuggingPatch.kt @@ -14,29 +14,17 @@ import org.w3c.dom.Element @Version("0.0.1") class EnableAndroidDebuggingPatch : ResourcePatch { override fun execute(context: ResourceContext): PatchResult { - if (debuggable == true) { - context.xmlEditor["AndroidManifest.xml"].use { dom -> - val applicationNode = dom - .file - .getElementsByTagName("application") - .item(0) as Element + context.xmlEditor["AndroidManifest.xml"].use { dom -> + val applicationNode = dom + .file + .getElementsByTagName("application") + .item(0) as Element - // set application as debuggable - applicationNode.setAttribute("android:debuggable", "true") - } + // set application as debuggable + applicationNode.setAttribute("android:debuggable", "true") } return PatchResultSuccess() } - companion object : OptionsContainer() { - var debuggable: Boolean? by option( - PatchOption.BooleanOption( - key = "debuggable", - default = false, - title = "App debugging", - description = "Whether to make the app debuggable on Android.", - ) - ) - } } 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 index d5f279458f..c26dfa59e0 100644 --- 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 @@ -9,7 +9,6 @@ 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.all.misc.debugging.patch.EnableAndroidDebuggingPatch import app.revanced.patches.shared.settings.preference.impl.StringResource import app.revanced.patches.shared.settings.preference.impl.SwitchPreference import app.revanced.patches.youtube.misc.debugging.annotations.DebuggingCompatibility @@ -18,7 +17,7 @@ import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch @Patch @Name("enable-debugging") -@DependsOn([IntegrationsPatch::class, SettingsPatch::class, EnableAndroidDebuggingPatch::class]) +@DependsOn([IntegrationsPatch::class, SettingsPatch::class]) @Description("Adds debugging options.") @DebuggingCompatibility @Version("0.0.2")