Package jadx.core.dex.attributes.nodes

Examples of jadx.core.dex.attributes.nodes.EnumMapAttr


    return null;
  }

  private static EnumMapAttr.KeyValueMap getEnumMap(MethodNode mth, FieldNode field) {
    ClassNode syntheticClass = field.getParentClass();
    EnumMapAttr mapAttr = syntheticClass.get(AType.ENUM_MAP);
    if (mapAttr != null) {
      return mapAttr.getMap(field);
    }
    mapAttr = new EnumMapAttr();
    syntheticClass.addAttr(mapAttr);

    MethodNode clsInitMth = syntheticClass.searchMethodByName("<clinit>()V");
    if (clsInitMth == null || clsInitMth.isNoCode()) {
      return null;
    }
    if (clsInitMth.getBasicBlocks() == null) {
      try {
        clsInitMth.load();
      } catch (DecodeException e) {
        LOG.error("Load failed", e);
        return null;
      }
      if (clsInitMth.getBasicBlocks() == null) {
        // TODO:
        return null;
      }
    }
    for (BlockNode block : clsInitMth.getBasicBlocks()) {
      for (InsnNode insn : block.getInstructions()) {
        if (insn.getType() == InsnType.APUT) {
          addToEnumMap(mth, mapAttr, insn);
        }
      }
    }
    return mapAttr.getMap(field);
  }
View Full Code Here

TOP

Related Classes of jadx.core.dex.attributes.nodes.EnumMapAttr

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.