Package jadx.core.dex.info

Examples of jadx.core.dex.info.ClassInfo


      if (insn.getType() == InsnType.CONSTRUCTOR) {
        ConstructorInsn co = (ConstructorInsn) insn;
        if (insn.getArgsCount() < 2) {
          continue;
        }
        ClassInfo clsInfo = co.getClassType();
        ClassNode constrCls = cls.dex().resolveClass(clsInfo);
        if (constrCls == null) {
          continue;
        }
        if (!clsInfo.equals(cls.getClassInfo()) && !constrCls.getAccessFlags().isEnum()) {
          continue;
        }
        RegisterArg nameArg = (RegisterArg) insn.getArg(0);
        // InsnArg pos = insn.getArg(1);
        // TODO add check: pos == j
View Full Code Here


    }
    // remove fields if it is synthetic and type is a outer class
    for (FieldNode field : cls.getFields()) {
      if (field.getAccessFlags().isSynthetic() && field.getType().isObject()) {
        ClassNode fieldsCls = cls.dex().resolveClass(ClassInfo.fromType(field.getType()));
        ClassInfo parentClass = cls.getClassInfo().getParentClass();
        if (fieldsCls != null
            && parentClass.equals(fieldsCls.getClassInfo())) {
          int found = 0;
          for (MethodNode mth : cls.getMethods()) {
            if (removeFieldUsageFromConstructor(mth, field, fieldsCls)) {
              found++;
            }
          }
          if (found != 0) {
            FieldInfo replace = new FieldInfo(parentClass, "this", parentClass.getType());
            field.addAttr(new FieldReplaceAttr(replace, true));
            field.add(AFlag.DONT_GENERATE);
          }
        }
      }
View Full Code Here

    for (CatchHandler handler : catchBlocks) {
      TryCatchBlock tcBlock = new TryCatchBlock();
      catches.add(tcBlock);
      for (int i = 0; i < handler.getAddresses().length; i++) {
        int addr = handler.getAddresses()[i];
        ClassInfo type = ClassInfo.fromDex(parentClass.dex(), handler.getTypeIndexes()[i]);
        tcBlock.addHandler(this, addr, type);
        addrs.add(addr);
        hc++;
      }
      int addr = handler.getCatchAllAddress();
View Full Code Here

    }
    code.add(field.getName());
  }

  public static void makeStaticFieldAccess(CodeWriter code, FieldInfo field, ClassGen clsGen) {
    ClassInfo declClass = field.getDeclClass();
    boolean fieldFromThisClass = clsGen.getClassNode().getFullName().startsWith(declClass.getFullName());
    if (!fieldFromThisClass) {
      // Android specific resources class handler
      ClassInfo parentClass = declClass.getParentClass();
      if (parentClass != null && parentClass.getShortName().equals("R")) {
        clsGen.useClass(code, parentClass);
        code.add('.');
        code.add(declClass.getShortName());
      } else {
        clsGen.useClass(code, declClass);
View Full Code Here

  private void makeConstructor(ConstructorInsn insn, CodeWriter code)
      throws CodegenException {
    ClassNode cls = mth.dex().resolveClass(insn.getClassType());
    if (cls != null && cls.isAnonymous() && !fallback) {
      // anonymous class construction
      ClassInfo parent;
      if (cls.getInterfaces().size() == 1) {
        parent = cls.getInterfaces().get(0);
      } else {
        parent = cls.getSuperClass();
      }
View Full Code Here

        code.add("super").add('.');
        k++;
        break;

      case STATIC:
        ClassInfo insnCls = mth.getParentClass().getClassInfo();
        ClassInfo declClass = callMth.getDeclClass();
        if (!insnCls.equals(declClass)) {
          useClass(code, declClass);
          code.add('.');
        }
        break;
View Full Code Here

    clsCode.add(cls.getShortName());

    addGenericMap(clsCode, cls.getGenericMap());
    clsCode.add(' ');

    ClassInfo sup = cls.getSuperClass();
    if (sup != null
        && !sup.getFullName().equals(Consts.CLASS_OBJECT)
        && !sup.getFullName().equals(Consts.CLASS_ENUM)) {
      clsCode.add("extends ");
      useClass(clsCode, sup);
      clsCode.add(' ');
    }

    if (!cls.getInterfaces().isEmpty() && !af.isAnnotation()) {
      if (cls.getAccessFlags().isInterface()) {
        clsCode.add("extends ");
      } else {
        clsCode.add("implements ");
      }
      for (Iterator<ClassInfo> it = cls.getInterfaces().iterator(); it.hasNext(); ) {
        ClassInfo interf = it.next();
        useClass(clsCode, interf);
        if (it.hasNext()) {
          clsCode.add(", ");
        }
      }
View Full Code Here

    }
  }

  private static boolean isClassInnerFor(ClassInfo inner, ClassInfo parent) {
    if (inner.isInner()) {
      ClassInfo p = inner.getParentClass();
      return p.equals(parent) || isClassInnerFor(p, parent);
    }
    return false;
  }
View Full Code Here

  }

  public ConstructorInsn(MethodNode mth, InvokeNode invoke) {
    super(InsnType.CONSTRUCTOR, invoke.getArgsCount() - 1);
    this.callMth = invoke.getCallMth();
    ClassInfo classType = callMth.getDeclClass();
    instanceArg = (RegisterArg) invoke.getArg(0);

    if (instanceArg.isThis()) {
      if (classType.equals(mth.getParentClass().getClassInfo())) {
        if (callMth.getShortId().equals(mth.getMethodInfo().getShortId())) {
          // self constructor
          callType = CallType.SELF;
        } else {
          callType = CallType.THIS;
View Full Code Here

    if (type.isObject()) {
      String alias = getAliasForObject(type.getObject());
      if (alias != null) {
        return alias;
      }
      ClassInfo clsInfo = ClassInfo.fromType(type);
      String shortName = clsInfo.getShortName();
      String vName = fromName(shortName);
      if (vName != null) {
        return vName;
      }
    }
View Full Code Here

TOP

Related Classes of jadx.core.dex.info.ClassInfo

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.