Package jadx.core.dex.regions.loops

Examples of jadx.core.dex.regions.loops.LoopType


    }

    private void regionProcess(MethodNode mth, IRegion region) {
      if (region instanceof LoopRegion) {
        LoopRegion loopRegion = (LoopRegion) region;
        LoopType loopType = loopRegion.getType();
        if (loopType instanceof ForLoop) {
          ForLoop forLoop = (ForLoop) loopType;
          processInsn(forLoop.getInitInsn(), region);
          processInsn(forLoop.getIncrInsn(), region);
        }
View Full Code Here


    }

    // all checks passed
    initInsn.add(AFlag.SKIP);
    incrInsn.add(AFlag.SKIP);
    LoopType arrForEach = checkArrayForEach(mth, initInsn, incrInsn, condition);
    if (arrForEach != null) {
      loopRegion.setType(arrForEach);
      return true;
    }
    loopRegion.setType(new ForLoop(initInsn, incrInsn));
View Full Code Here

      makeRegionIndent(code, region.getBody());
      code.startLine('}');
      return code;
    }
    ConditionGen conditionGen = new ConditionGen(this);
    LoopType type = region.getType();
    if (type != null) {
      if (type instanceof ForLoop) {
        ForLoop forLoop = (ForLoop) type;
        code.startLine("for (");
        makeInsn(forLoop.getInitInsn(), code, Flags.INLINE);
        code.add("; ");
        conditionGen.add(code, condition);
        code.add("; ");
        makeInsn(forLoop.getIncrInsn(), code, Flags.INLINE);
        code.add(") {");
        makeRegionIndent(code, region.getBody());
        code.startLine('}');
        return code;
      }
      if (type instanceof ForEachLoop) {
        ForEachLoop forEachLoop = (ForEachLoop) type;
        code.startLine("for (");
        declareVar(code, forEachLoop.getVarArg());
        code.add(" : ");
        addArg(code, forEachLoop.getIterableArg(), false);
        code.add(") {");
        makeRegionIndent(code, region.getBody());
        code.startLine('}');
        return code;
      }
      throw new JadxRuntimeException("Unknown loop type: " + type.getClass());
    }
    if (region.isConditionAtEnd()) {
      code.startLine("do {");
      makeRegionIndent(code, region.getBody());
      code.startLine("} while (");
View Full Code Here

TOP

Related Classes of jadx.core.dex.regions.loops.LoopType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.