fix(script): add example script for resources rename (#2126)

This commit is contained in:
Skylot
2024-03-20 18:46:44 +00:00
parent 463d2b90fa
commit 2807dc5090
3 changed files with 50 additions and 1 deletions
@@ -3,11 +3,22 @@ package jadx.plugins.script.runtime.data
import jadx.core.dex.nodes.BlockNode
import jadx.core.dex.nodes.InsnNode
import jadx.core.dex.nodes.MethodNode
import jadx.core.dex.nodes.RootNode
import jadx.core.dex.regions.Region
import jadx.plugins.script.runtime.JadxScriptInstance
class Stages(private val jadx: JadxScriptInstance) {
fun prepare(block: (RootNode) -> Unit) {
jadx.addPass(object : ScriptPreparePass(jadx, "StagePrepare") {
override fun init(root: RootNode) {
jadx.debug.catchExceptions("Prepare init block") {
block.invoke(root)
}
}
})
}
fun rawInsns(block: (MethodNode, Array<InsnNode?>) -> Unit) {
jadx.addPass(object : ScriptOrderedDecompilePass(
jadx,