I am a beginner in learning soot and I was tormented by this strange problem: I create a instance of a class and I cannot find its methodcalls.
Here is the source code that I want to analyze:
`package com.example.hello;
public class TestInputMain {
public static void main(String[] args) {
Calculator calc = new Calculator(); // another class in same package, written by me.
int result = calc.add(10, 20); // I CANNOT FIND IT!!!
System.out.println("The result of adding 10 and 20 is " + result);
}
}`
Here is part of soot codes that I use:
`……
//SET UP CALL GRAPH
String[] sootArgs = {
"-pp",
"-process-dir", jarFilePath, //I put them in a jar. The result is same without a jar
"-allow-phantom-refs",
"-no-bodies-for-excluded",
"-whole-program",
"-verbose",
"-p", "cg.cha", "enabled:true",
"-dynamic-dir", jarFilePath,
};
Options.v().parse(sootArgs);
……
//PRINT EVERY EDGE IN CALLGRAPH
CallGraph callgraph = Scene.v().getCallGraph();
Iterator edgesdebug = callgraph.iterator();
while (edgesdebug.hasNext()) {
Edge it = edgesdebug.next();
System.out.println("??????" + it.src() + " =>> " + it.tgt());
}`
The situation is, even if I print every edge in callgraph, including all kinds of lib functions, I still cannot find "add".
I am a beginner in learning soot and I was tormented by this strange problem: I create a instance of a class and I cannot find its methodcalls.
Here is the source code that I want to analyze: `package com.example.hello;
public class TestInputMain { public static void main(String[] args) {
}`
Here is part of soot codes that I use: `…… //SET UP CALL GRAPH String[] sootArgs = { "-pp", "-process-dir", jarFilePath, //I put them in a jar. The result is same without a jar "-allow-phantom-refs", "-no-bodies-for-excluded", "-whole-program", "-verbose", "-p", "cg.cha", "enabled:true", "-dynamic-dir", jarFilePath, }; Options.v().parse(sootArgs);
…… //PRINT EVERY EDGE IN CALLGRAPH CallGraph callgraph = Scene.v().getCallGraph(); Iterator edgesdebug = callgraph.iterator();
while (edgesdebug.hasNext()) {
Edge it = edgesdebug.next();
System.out.println("??????" + it.src() + " =>> " + it.tgt());
}`
The situation is, even if I print every edge in callgraph, including all kinds of lib functions, I still cannot find "add".