Class DexConstantLibrary
java.lang.Object
com.pnfsoftware.jeb.core.units.code.android.DexConstantLibrary
A manager for constant and pseudo-constant fields of a dex unit.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFieldIndices
(Object value) Retrieve all fields with the provided value.getFieldIndices
(Object value, boolean alsoGetSmaller, boolean alsoGetBigger) Retrieve all fields with the provided value.boolean
Record a field constant (for an internal static final field) or a pseudo constant (attached to an external field reference).
-
Constructor Details
-
DexConstantLibrary
-
-
Method Details
-
setValue
Record a field constant (for an internal static final field) or a pseudo constant (attached to an external field reference).- Parameters:
value
- a non-null value (must be a byte, char, short, int, long, float or double)fieldIndex
- a field index, which can be:
- astatic final
field index initialized to the provided value (note that thedex unit
is responsible for setting those up; clients do not need to do that, unless a constant is to be forcefully changed to another value)
- or any index to a pure field reference (external field) for whom a value is to be attached- Returns:
- true if the value was recorded
-
getFieldIndices
Retrieve all fields with the provided value. Only the fields of the provided type are returned. Example: if value is an Integer, onlyI
-type fields are returned. To retrieve a list of smaller- or bigger- type values, usegetFieldIndices(Object, boolean, boolean)
.- Parameters:
value
- a non-null value (must be a byte, char, short, int, long, float or double)- Returns:
- a collection of dex field indices, possibly empty
-
getFieldIndices
public Collection<Integer> getFieldIndices(Object value, boolean alsoGetSmaller, boolean alsoGetBigger) Retrieve all fields with the provided value.- Parameters:
value
- a non-null value (must be a byte, char, short, int, long, float or double)alsoGetSmaller
- if true, smaller-type values are returnedalsoGetBigger
- if true, bigger-type values are returned- Returns:
- a collection of dex field indices, possibly empty
-