public interface

IDOperation

implements IDExpression
com.pnfsoftware.jeb.core.units.code.android.ir.IDOperation
Known Indirect Subclasses

Class Overview

dexdec IR operation expression. Operations include: arithmetic and bitwise operations, logical expressions, the ternary (conditional) expression, cast operations, etc.

An operation is made of one operator and 1, 2, or 3 operands:
- 1 operand for unary expressions, e.g a cast
- 2 operands for duary expressions, e.g. an addition
- 3 operands for ternary expressions, e.g. a conditional

Examples:

 c = a + 1;
     ^^^^^

 e = x ? c: d;
     ^^^^^^^^
     
 s = (short)x;
     ^^^^^^^^
        
 list = (List)obj;
        ^^^^^^^^^
 

Summary

[Expand]
Inherited Constants
From interface com.pnfsoftware.jeb.core.units.code.android.ir.IDElement
Public Methods
abstract IDOperation duplicate()
Duplicate this element.
abstract IDExpression getCondFalseExpression()
If this IR is a conditional operation, retrieve the conditional's true expression.
abstract IDPredicate getCondPredicate()
If this IR is a conditional operation, retrieve the conditional's predicate.
abstract IDExpression getCondTrueExpression()
If this IR is a conditional operation, retrieve the conditional's true expression.
abstract IDExpression getLeft()
abstract IDExpression getOperand1()
Retrieve the first operand.
abstract IDExpression getOperand2()
Retrieve the second operand.
abstract IJavaOperator getOperator()
Get the expression's operator.
abstract JavaOperatorType getOperatorType()
This convenience method can be used to retrieve the operator type.
abstract IDPredicate getPredicate()
This method is deprecated. use getCondPredicate() instead
abstract IDExpression getRight()
abstract boolean isCast()
Convenience operation to determine whether this is operation is a cast.
abstract boolean isCast(IJavaType wantedType)
Convenience operation to determine whether this is operation is a cast to the provided type.
abstract boolean isConditional()
Convenience operation to determine whether this is the tertiary conditional expression.
abstract boolean isUnary()
Convenience operation to determine whether this is a unary expression.
abstract void setLeft(IDExpression exp)
abstract void setOperand1(IDExpression exp)
Set the first operand.
abstract void setOperand2(IDExpression exp)
Set the second operand.
abstract void setOperator(JavaOperatorType operatorType, IJavaOperatorFactory of)
Set the expression operator.
abstract void setOperator(IJavaOperator operator)
Set the expression operator.
abstract void setRight(IDExpression exp)
abstract void updateConversionOperators(DTypeInfo ti, IDGlobalContext gctx)
Upgrade temporary conversion operators to legal cast operators.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.units.code.IInstructionOperand
From interface com.pnfsoftware.jeb.core.units.code.android.ir.IDElement
From interface com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression

Public Methods

public abstract IDOperation duplicate ()

Duplicate this element.

Returns
  • a deep copy of this element; the type of the duplicated element should be the same as this element's type

public abstract IDExpression getCondFalseExpression ()

If this IR is a conditional operation, retrieve the conditional's true expression. The same as getRight().

public abstract IDPredicate getCondPredicate ()

If this IR is a conditional operation, retrieve the conditional's predicate.

Returns
  • null for non conditional expressions

public abstract IDExpression getCondTrueExpression ()

If this IR is a conditional operation, retrieve the conditional's true expression. The same as getLeft().

public abstract IDExpression getLeft ()

Returns
  • null for unary expressions

public abstract IDExpression getOperand1 ()

Retrieve the first operand. Same as getLeft().

Returns
  • null for unary expressions

public abstract IDExpression getOperand2 ()

Retrieve the second operand. Same as getRight().

Returns
  • never null

public abstract IJavaOperator getOperator ()

Get the expression's operator.

Returns
  • the operator object

public abstract JavaOperatorType getOperatorType ()

This convenience method can be used to retrieve the operator type. It is the same as getOperator().getOperatorType().

Returns
  • an operator type enumerated constant

public abstract IDPredicate getPredicate ()

This method is deprecated.
use getCondPredicate() instead

public abstract IDExpression getRight ()

Returns
  • never null

public abstract boolean isCast ()

Convenience operation to determine whether this is operation is a cast.

Returns
  • true if this operation is a cast operation

public abstract boolean isCast (IJavaType wantedType)

Convenience operation to determine whether this is operation is a cast to the provided type.

Parameters
wantedType checked cast type
Returns
  • true if this operation is a cast to wantedType

public abstract boolean isConditional ()

Convenience operation to determine whether this is the tertiary conditional expression.

public abstract boolean isUnary ()

Convenience operation to determine whether this is a unary expression.

public abstract void setLeft (IDExpression exp)

public abstract void setOperand1 (IDExpression exp)

Set the first operand. Same as setLeft(IDExpression).

public abstract void setOperand2 (IDExpression exp)

Set the second operand. Same as setRight(IDExpression).

public abstract void setOperator (JavaOperatorType operatorType, IJavaOperatorFactory of)

Set the expression operator. Alternate method.

public abstract void setOperator (IJavaOperator operator)

Set the expression operator.

public abstract void setRight (IDExpression exp)

public abstract void updateConversionOperators (DTypeInfo ti, IDGlobalContext gctx)

Upgrade temporary conversion operators to legal cast operators. Ths method should be called once only, on a low-level IR. It is reserved for internal use.

Parameters
ti optional type information object, used to record type updates and conflicts
gctx global IR context (mandatory)