Skip to content

Commit

Permalink
fix(enable-android-debugging): remove json options (ReVanced#2497)
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed Jun 26, 2023
1 parent 4392f10 commit 3e25f5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down

0 comments on commit 3e25f5f

Please sign in to comment.