Search in sources :

Example 1 with ConditionGen

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

the class DebugUtils method printRegionSpecificInfo.

private static void printRegionSpecificInfo(ICodeWriter cw, String indent, MethodNode mth, IRegion region, boolean printInsns) {
    if (region instanceof LoopRegion) {
        LoopRegion loop = (LoopRegion) region;
        IfCondition condition = loop.getCondition();
        if (printInsns && condition != null) {
            ConditionGen conditionGen = new ConditionGen(new InsnGen(MethodGen.getFallbackMethodGen(mth), true));
            cw.startLine(indent).add("|> ");
            try {
                conditionGen.add(cw, condition);
            } catch (Exception e) {
                cw.startLine(indent).add(">!! ").add(condition.toString());
            }
        }
    }
}
Also used : InsnGen(jadx.core.codegen.InsnGen) ConditionGen(jadx.core.codegen.ConditionGen) LoopRegion(jadx.core.dex.regions.loops.LoopRegion) IfCondition(jadx.core.dex.regions.conditions.IfCondition) JadxException(jadx.core.utils.exceptions.JadxException) CodegenException(jadx.core.utils.exceptions.CodegenException)

Aggregations

ConditionGen (jadx.core.codegen.ConditionGen)1 InsnGen (jadx.core.codegen.InsnGen)1 IfCondition (jadx.core.dex.regions.conditions.IfCondition)1 LoopRegion (jadx.core.dex.regions.loops.LoopRegion)1 CodegenException (jadx.core.utils.exceptions.CodegenException)1 JadxException (jadx.core.utils.exceptions.JadxException)1