mirror of
https://github.com/revanced/revanced-patches
synced 2024-11-09 16:17:04 +01:00
fix(enable-android-debugging): remove json options (#2497)
This commit is contained in:
parent
4392f108ed
commit
3e25f5f8df
@ -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.",
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user