public class DexReferences
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.Comparator<DexElementNode> |
NODE_COMPARATOR |
| Constructor and Description |
|---|
DexReferences(org.jf.dexlib2.dexbacked.DexBackedDexFile[] files) |
| Modifier and Type | Method and Description |
|---|---|
void |
addReferencesForNode(DexElementNode node,
boolean shallow)
Finds references to
referenced and attaches them as tree nodes under node |
DexElementNode |
getReferenceTreeFor(org.jf.dexlib2.iface.reference.Reference referenced)
Build a full reference tree for the given DEX reference.
|
DexElementNode |
getReferenceTreeFor(org.jf.dexlib2.iface.reference.Reference referenced,
boolean shallow)
Build a reference tree for the given DEX reference.
|
static boolean |
isAlreadyLoaded(DexElementNode node)
Checks if the specified dex reference tree node has had its references evaluated and attached
(if any) or if it still needs to be passed to
#addReferencesForNode(DexElementNode,
Reference, boolean) for lazy evaluation |
public static final java.util.Comparator<DexElementNode> NODE_COMPARATOR
public DexReferences(org.jf.dexlib2.dexbacked.DexBackedDexFile[] files)
public DexElementNode getReferenceTreeFor(@NonNull org.jf.dexlib2.iface.reference.Reference referenced)
referenced - the dex element you wish to find references forpublic DexElementNode getReferenceTreeFor(@NonNull org.jf.dexlib2.iface.reference.Reference referenced, boolean shallow)
shallow
parameter this returns the full tree root or just the root with first level references
evaluated.
You can then lazy load deeper references using #addReferencesForNode(DexElementNode
node, Reference referenced, boolean shallow).
To check if references were already loaded for a node use isAlreadyLoaded(DexElementNode)
referenced - the dex element you wish to find references forshallow - false to to build the full tree, true to evaluate just the first levelpublic void addReferencesForNode(@NonNull
DexElementNode node,
boolean shallow)
referenced and attaches them as tree nodes under node
Depending on the shallow parameter this attaches the full reference tree or stops
evaluation at the first level
node - the root node under which you wish to attach referencesshallow - false to to build the full tree, true to evaluate just the first levelpublic static boolean isAlreadyLoaded(DexElementNode node)
#addReferencesForNode(DexElementNode,
Reference, boolean) for lazy evaluationnode - the reference tree node to check