Open zhouyuhao1018 opened 2 years ago
Have a look at InfoflowConfiguration.sootIntegrationMode
. There is an option UseExistingCallgraph
.
Have a look at
InfoflowConfiguration.sootIntegrationMode
. There is an optionUseExistingCallgraph
.
Thanks for your reply !
After receiving your suggestion, I looked back the source code again.
The first time I setupApplication=new SetupApplication(androidJar, apkFilePath)
, the SetupApplication
constructor will call InfoflowAndroidConfiguration
constructor, which extends InfoflowConfiguration and also calls InfoflowConfiguration
constructor. As a result, InfoflowConfiguration.SootIntegrationMode
is CreateNewInstance
by default, right?
So, after setupApplication.constructCallgraph()
and Scene.v().setCallGraph(cg)
with an improved callgraph, I only need to setupApplication.getConfig().setSootIntegrationMode()
with the option UseExistingCallgraph
before I call runInfoflow()
. Am I right ?
PS: I notice that the three options‘ explanations in SootIntegrationMode
mention the word 'FlowDroid its own Soot instance'. So I am confused about that can there exist two Soot instance in my project? Because I use Soot and initialize it to get jimple codes where I try to find some stmts and locals for constructing StatementSourceSinkDefinition
. So, the Soot instance I used myself and the Soot instance when I new SetupApplication(androidJar, apkFilePath)
, are they two independent instances?Or, the initializeSoot() in SetupApplication
will overwrite the previous one that I used?
Your sequence of calls is correct. You set the correct flag before calling runInfoflow
.
There is only one Soot instance. The wording is misleading. Essentially, FlowDroid can create a new Soot instance (and throw away what might have existed before), use the existing Soot instance and create a callgraph (and throw away any potential previous callgraph), or don't touch scene and callgraph and just run the data flow analysis.
Thanks a lot ! Your reply answered my question so clearly!
Best wishes
Dear, After
setupApplication.constructCallgraph();
, I get a call graph bycg = Scene.v().getCallGraph();
. Then I add some new edges to this call graphcg
and callScene.v().setCallGraph(cg);
.Then, I call
runInfoflow()
with a custom implementation of anISourceSinkDefinitionProvider
. How can I make FlowDroid use the existing and improved call graph for data flow analysis? Could you give me some advice? Thanks a lot.Best Zhou