Package jadx.core.dex.instructions.args

Examples of jadx.core.dex.instructions.args.ArgType


    loopRegion.setType(new ForEachLoop(iterVar, iterableArg));
    return true;
  }

  private static boolean fixIterableType(InsnArg iterableArg, RegisterArg iterVar) {
    ArgType type = iterableArg.getType();
    if (type.isGeneric()) {
      ArgType[] genericTypes = type.getGenericTypes();
      if (genericTypes != null && genericTypes.length == 1) {
        ArgType gType = genericTypes[0];
        if (ArgType.isInstanceOf(gType, iterVar.getType())) {
          return true;
        } else {
          LOG.warn("Generic type differs: {} and {}", type, iterVar.getType());
        }
View Full Code Here


      genericMap = sp.consumeGenericMap();
      // parse super class signature
      superClass = ClassInfo.fromType(sp.consumeType());
      // parse interfaces signatures
      for (int i = 0; i < interfaces.size(); i++) {
        ArgType type = sp.consumeType();
        if (type != null) {
          interfaces.set(i, ClassInfo.fromType(type));
        } else {
          break;
        }
View Full Code Here

  private void setFieldsTypesFromSignature() {
    for (FieldNode field : fields) {
      SignatureParser sp = SignatureParser.fromNode(field);
      if (sp != null) {
        try {
          ArgType gType = sp.consumeType();
          if (gType != null) {
            field.setType(gType);
          }
        } catch (JadxRuntimeException e) {
          LOG.error("Field signature parse error: {}", field, e);
View Full Code Here

  private int endAddr;

  public LocalVar(DexNode dex, int rn, int nameId, int typeId, int signId) {
    this.regNum = rn;
    String name = nameId == DexNode.NO_INDEX ? null : dex.getString(nameId);
    ArgType type = typeId == DexNode.NO_INDEX ? null : dex.getType(typeId);
    String sign = signId == DexNode.NO_INDEX ? null : dex.getString(signId);

    init(name, type, sign);
  }
View Full Code Here

  }

  private void init(String name, ArgType type, String sign) {
    if (sign != null) {
      try {
        ArgType gType = ArgType.generic(sign);
        if (checkSignature(type, sign, gType)) {
          type = gType;
        }
      } catch (Exception e) {
        LOG.error("Can't parse signature for local variable: {}", sign, e);
View Full Code Here

    this.type = type;
  }

  private boolean checkSignature(ArgType type, String sign, ArgType gType) {
    boolean apply;
    ArgType el = gType.getArrayRootElement();
    if (el.isGeneric()) {
      if (!type.getArrayRootElement().getObject().equals(el.getObject())) {
        LOG.warn("Generic type in debug info not equals: {} != {}", type, gType);
      }
      apply = true;
    } else {
      apply = el.isGenericType();
    }
    return apply;
  }
View Full Code Here

  public ArgType consumeType() {
    char ch = next();
    mark();
    switch (ch) {
      case 'L':
        ArgType obj = consumeObjectType(false);
        if (obj != null) {
          return obj;
        }
        break;
      case 'T':
        next();
        mark();
        if (forwardTo(';')) {
          return ArgType.genericType(slice());
        }
        break;
      case '[':
        return ArgType.array(consumeType());

      case STOP_CHAR:
        return null;

      default:
        // primitive type (one char)
        ArgType type = ArgType.parse(ch);
        if (type != null) {
          return type;
        }
        break;
    }
View Full Code Here

        obj += ";";
      }
      ArgType[] genArr = consumeGenericArgs();
      consume('>');

      ArgType genericType = ArgType.generic(obj, genArr);
      if (lookAhead('.')) {
        consume('.');
        next();
        // type parsing not completed, proceed to inner class
        ArgType inner = consumeObjectType(true);
        return ArgType.genericInner(genericType, inner.getObject(), inner.getGenericTypes());
      } else {
        consume(';');
        return genericType;
      }
    }
View Full Code Here

    }
  }

  private ArgType[] consumeGenericArgs() {
    List<ArgType> list = new LinkedList<ArgType>();
    ArgType type;
    do {
      if (lookAhead('*')) {
        next();
        type = ArgType.wildcard();
      } else if (lookAhead('+')) {
View Full Code Here

   */
  private List<ArgType> consumeExtendsTypesList() {
    List<ArgType> types = Collections.emptyList();
    boolean next;
    do {
      ArgType argType = consumeType();
      if (!argType.equals(ArgType.OBJECT)) {
        if (types.isEmpty()) {
          types = new LinkedList<ArgType>();
        }
        types.add(argType);
      }
View Full Code Here

TOP

Related Classes of jadx.core.dex.instructions.args.ArgType

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.