New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interprocedural data flow analysis for Java programs #391
Comments
I think maybe you can see /**
* Creates a new instance of the InfoFlow class for analyzing plain Java code
* without any references to APKs or the Android SDK.
*/
public Infoflow() {
super();
} and you can pass |
Thanks for your reply! Looking good but do I still to use libPath and pass an Android.jar into it? |
You can have a look at the JUnit test cases inside the |
Thanks! The test cases are very helpful, still, for pure Java programs with jar files, should the entry point simply be main? Does the libPath for android still matters when we use computeInfoflow()? |
For a normal Java program, the entry point is the |
Hi, thank you all for your patient help, really appreciate it! I have managed to make my small analysis work, however, when I try to find a flow that passes through different external libraries, the result came back as null. The source and sink methods are identified correctly and it worked perfectly well if all classes are within the same package. Do you know how to configure the code to enable analysis across external classes in different packages (I reckon the libpath was correct because the sink method locates in an external class and it got identified)? Thank you so much for your help. |
Is your setup as follows: One main program JAR and some external libraries as additional JARs? Did you put these additional JARs on the library path? Are the sources and sinks all in the main JAR or also in the library JARs? |
Hi! Thanks for the swift reply. |
That is indeed strange, because FlowDroid loads all classes into the same Soot scene. Is the sink in the second library JAR detected correctly? That would indicate that all classes are actually loaded. I'm not sure that the different JARs have anything to do with the issue. That might just be a coincidence. The next step would be to debug the data flow analysis. If you know the call chain between source and sink, you can try to see where the flow is lost. Have a look at method |
Hi, very sorry to bother you again... I did some tests on the code again. The data flow should be A->B->C->D, A and D are in main while B and C are from external JARs. It works simply as D(C(B(A))). I tried to simply just define one source in main (A) and let all the rest methods just be sinks (hopefully to find all potential flows). Infoflow did identify the source and many sinks, but it only outputs one direct flow which is A->B, everything after B is somehow missed. But if I list B as a source, then B->C is reported. I suspect maybe I did miss some parts of the settings. Since sources and sinks are correctly identified, I assume
The output: |
The methods The library path seems strange. You need to put the individual JARs, not a directory. Can you try this out? |
Thanks a lot! I tried to combine these two JARs together into one and pointed that JAR to the path and it worked :) Thanks again for the patient reply! |
Hi! First I want to thank you all for developing such a handy tool for flow analysis.
Since I saw you mentioned FlowDroid is also able to compute data flows for Java programs, just wondering is there any documentation on how to analyse Jar file (from a Java program) solely instead of including an Android JAR? I saw that soot-infoflow was implemented for Java programs but are there any documentation/guide on how to do a pure Java implementation with it? Sorry for the naive question :)
Thanks a lot!
The text was updated successfully, but these errors were encountered: