Search in sources :

Example 1 with ClspGraph

use of jadx.core.clsp.ClspGraph in project jadx by skylot.

the class JadxClasspathTest method initClsp.

@Before
public void initClsp() throws IOException, DecodeException {
    clsp = new ClspGraph();
    clsp.load();
    dex = mock(DexNode.class);
    RootNode rootNode = mock(RootNode.class);
    when(rootNode.getClsp()).thenReturn(clsp);
    when(dex.root()).thenReturn(rootNode);
}
Also used : RootNode(jadx.core.dex.nodes.RootNode) DexNode(jadx.core.dex.nodes.DexNode) ClspGraph(jadx.core.clsp.ClspGraph) Before(org.junit.Before)

Example 2 with ClspGraph

use of jadx.core.clsp.ClspGraph in project jadx by skylot.

the class TypeMergeTest method initClsp.

@Before
public void initClsp() throws IOException, DecodeException {
    ClspGraph clsp = new ClspGraph();
    clsp.load();
    dex = mock(DexNode.class);
    RootNode rootNode = mock(RootNode.class);
    when(rootNode.getClsp()).thenReturn(clsp);
    when(dex.root()).thenReturn(rootNode);
}
Also used : RootNode(jadx.core.dex.nodes.RootNode) DexNode(jadx.core.dex.nodes.DexNode) ClspGraph(jadx.core.clsp.ClspGraph) Before(org.junit.Before)

Example 3 with ClspGraph

use of jadx.core.clsp.ClspGraph in project jadx by skylot.

the class RootNode method initClassPath.

public void initClassPath() throws DecodeException {
    try {
        if (this.clsp == null) {
            ClspGraph clsp = new ClspGraph();
            clsp.load();
            List<ClassNode> classes = new ArrayList<ClassNode>();
            for (DexNode dexNode : dexNodes) {
                classes.addAll(dexNode.getClasses());
            }
            clsp.addApp(classes);
            this.clsp = clsp;
        }
    } catch (IOException e) {
        throw new DecodeException("Error loading classpath", e);
    }
}
Also used : ArrayList(java.util.ArrayList) ClspGraph(jadx.core.clsp.ClspGraph) IOException(java.io.IOException) DecodeException(jadx.core.utils.exceptions.DecodeException)

Aggregations

ClspGraph (jadx.core.clsp.ClspGraph)3 DexNode (jadx.core.dex.nodes.DexNode)2 RootNode (jadx.core.dex.nodes.RootNode)2 Before (org.junit.Before)2 DecodeException (jadx.core.utils.exceptions.DecodeException)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1