Files
jadx/jadx-plugins/jadx-script/examples/scripts/hello.jadx.kts
T
2023-04-20 19:01:29 +03:00

30 lines
656 B
Kotlin

// logger is preferred for output
log.info { "Hello from jadx script!" }
// println will also work (will be redirected to logger)
println("println from script '$scriptName'")
// get jadx decompiler script instance
val jadx = getJadxInstance()
// adjust options if needed
jadx.args.isDeobfuscationOn = false
// change names
jadx.rename.all { name ->
when (name) {
"HelloWorld" -> "HelloJadx"
else -> null
}
}
// run some code after loading is finished
jadx.afterLoad {
println("Loaded classes: ${jadx.classes.size}")
// print first class code
jadx.classes.firstOrNull()?.let { cls ->
println("Class: '${cls.name}'")
println(cls.code)
}
}