Search in sources :

Example 1 with MethodGen

use of jadx.core.codegen.MethodGen in project jadx by skylot.

the class DebugUtils method printInsns.

private static void printInsns(MethodNode mth, String indent, IBlock block) {
    for (InsnNode insn : block.getInstructions()) {
        try {
            MethodGen mg = MethodGen.getFallbackMethodGen(mth);
            InsnGen ig = new InsnGen(mg, true);
            CodeWriter code = new CodeWriter();
            ig.makeInsn(insn, code);
            String insnStr = code.toString().substring(CodeWriter.NL.length());
            LOG.debug("{} - {}", indent, insnStr);
        } catch (CodegenException e) {
            LOG.debug("{} - {}", indent, insn);
        }
    }
}
Also used : InsnNode(jadx.core.dex.nodes.InsnNode) InsnGen(jadx.core.codegen.InsnGen) CodegenException(jadx.core.utils.exceptions.CodegenException) CodeWriter(jadx.core.codegen.CodeWriter) MethodGen(jadx.core.codegen.MethodGen)

Aggregations

CodeWriter (jadx.core.codegen.CodeWriter)1 InsnGen (jadx.core.codegen.InsnGen)1 MethodGen (jadx.core.codegen.MethodGen)1 InsnNode (jadx.core.dex.nodes.InsnNode)1 CodegenException (jadx.core.utils.exceptions.CodegenException)1