Package jadx.core.dex.instructions.args

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


  public static boolean process(MethodNode mth, InsnNode insn) {
    switch (insn.getType()) {
      case CONST:
        RegisterArg res = insn.getResult();
        LiteralArg litArg = (LiteralArg) insn.getArg(0);
        if (res.getType().isObject()) {
          long lit = litArg.getLiteral();
          if (lit != 0) {
            // incorrect literal value for object
            ArgType type = lit == 1 ? ArgType.BOOLEAN : ArgType.INT;
            // can't merge with object -> force it
            litArg.setType(type);
            res.getSVar().setType(type);
            return true;
          }
        }
        return litArg.merge(res);

      case MOVE: {
        boolean change = false;
        if (insn.getResult().merge(insn.getArg(0))) {
          change = true;
View Full Code Here


//      }
      InsnNode useInsn = arg.getParentInsn();
      if (useInsn.getType() == InsnType.PHI) {
        continue;
      }
      LiteralArg litArg;
      if (use.size() == 1 || arg.isTypeImmutable()) {
        // arg used only in one place
        litArg = InsnArg.lit(literal, arg.getType());
      } else if (useInsn.getType() == InsnType.MOVE
          && !useInsn.getResult().getType().isTypeKnown()) {
View Full Code Here

        useType(code, clsType);
        code.add(".class");
        break;

      case CONST:
        LiteralArg arg = (LiteralArg) insn.getArg(0);
        code.add(lit(arg));
        break;

      case MOVE:
        addArg(code, insn.getArg(0), false);
View Full Code Here

  private void makeArithOneArg(ArithNode insn, CodeWriter code) throws CodegenException {
    ArithOp op = insn.getOp();
    InsnArg arg = insn.getArg(1);
    // "++" or "--"
    if (arg.isLiteral() && (op == ArithOp.ADD || op == ArithOp.SUB)) {
      LiteralArg lit = (LiteralArg) arg;
      if (lit.isInteger() && lit.getLiteral() == 1) {
        assignVar(code, insn);
        String opSymbol = op.getSymbol();
        code.add(opSymbol).add(opSymbol);
        return;
      }
View Full Code Here

            }
            break;

          case RETURN:
            if (insn.getArgsCount() > 0 && insn.getArg(0).isLiteral()) {
              LiteralArg arg = (LiteralArg) insn.getArg(0);
              FieldNode f = parentClass.getConstFieldByLiteralArg(arg);
              if (f != null) {
                arg.wrapInstruction(new IndexInsnNode(InsnType.SGET, f.getFieldInfo(), 0));
              }
            }
            break;

          default:
View Full Code Here

  }

  private static boolean allArgsNull(InsnNode insn) {
    for (InsnArg insnArg : insn.getArguments()) {
      if (insnArg.isLiteral()) {
        LiteralArg lit = (LiteralArg) insnArg;
        if (lit.getLiteral() != 0) {
          return false;
        }
      } else if (!insnArg.isThis()) {
        return false;
      }
View Full Code Here

    InsnArg firstArg = compare.getA();
    InsnArg secondArg = compare.getB();
    if (firstArg.getType().equals(ArgType.BOOLEAN)
        && secondArg.isLiteral()
        && secondArg.getType().equals(ArgType.BOOLEAN)) {
      LiteralArg lit = (LiteralArg) secondArg;
      if (lit.getLiteral() == 0) {
        op = op.invert();
      }
      if (op == IfOp.EQ) {
        // == true
        if (stack.getStack().size() == 1) {
View Full Code Here

TOP

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

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.