Package jadx.core.dex.instructions

Examples of jadx.core.dex.instructions.SwitchNode


      if (insn == null) {
        continue;
      }
      switch (insn.getType()) {
        case SWITCH:
          SwitchNode sw = (SwitchNode) insn;
          for (int target : sw.getTargets()) {
            addJump(insnByOffset, offset, target);
          }
          // default case
          int nextInsnOffset = InsnDecoder.getNextInsnOffset(insnByOffset, offset);
          if (nextInsnOffset != -1) {
View Full Code Here


        code.add("move-exception");
        break;

      case SWITCH:
        assert isFallback();
        SwitchNode sw = (SwitchNode) insn;
        code.add("switch(");
        addArg(code, insn.getArg(0));
        code.add(") {");
        code.incIndent();
        for (int i = 0; i < sw.getCasesCount(); i++) {
          String key = sw.getKeys()[i].toString();
          code.startLine("case ").add(key).add(": goto ");
          code.add(MethodGen.getLabelName(sw.getTargets()[i])).add(';');
        }
        code.startLine("default: goto ");
        code.add(MethodGen.getLabelName(sw.getDefaultCaseOffset())).add(';');
        code.decIndent();
        code.startLine('}');
        break;

      case NEW_INSTANCE:
View Full Code Here

    makeRegionIndent(code, cont.getRegion());
    code.startLine('}');
  }

  private CodeWriter makeSwitch(SwitchRegion sw, CodeWriter code) throws CodegenException {
    SwitchNode insn = (SwitchNode) sw.getHeader().getInstructions().get(0);
    InsnArg arg = insn.getArg(0);
    code.startLine("switch (");
    addArg(code, arg, false);
    code.add(") {");
    code.incIndent();
View Full Code Here

            }
            break;
          }

          case SWITCH:
            SwitchNode sn = (SwitchNode) insn;
            for (int k = 0; k < sn.getCasesCount(); k++) {
              FieldNode f = parentClass.getConstField(sn.getKeys()[k]);
              if (f != null) {
                sn.getKeys()[k] = new IndexInsnNode(InsnType.SGET, f.getFieldInfo(), 0);
              }
            }
            break;

          case RETURN:
View Full Code Here

TOP

Related Classes of jadx.core.dex.instructions.SwitchNode

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.