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
Can SPARK ignore library class? #584
Comments
You can use the -no-bodies-for-excluded option to ensure that Soot never loads the bodies of the excluded classes. In that case, SPARK cannot look into them either. |
@StevenArzt |
Here is the apk file. |
These are not actually library classes according to Soot's definition. They are rather application classes, because these support classes are compiled into the APK file. I have an idea on what to do there. I will commit it together with a couple of other things I'm currently improving once that's ready. |
@StevenArzt |
Can you try the new version? It should ignore the android classes now. |
@StevenArzt |
That was indeed tougher than I first thought. Please update Soot and soot-infoflow-android. When computing the callgraph, make sure to set the appropriate options. The following code snippet works for me with the new version:
|
The soot-infoflow also needs to be updated. |
@StevenArzt |
This can happen if these methods are not reachable from any entry point. In that case, you need to manually load the bodies using SootMethod.retrieveActiveBody(). |
Update: I tested it and I do have method bodies if I use the code from above and then access that class. So you shouldn't need to manually load it. Did you update soot, soot-infoflow, and soot-infoflow-android? |
@StevenArzt |
Should be fixed with secure-software-engineering/soot-infoflow-android@397ddb94f8f13358fd01d1b0e47f76af8ce30d62. Thanks for reporting! |
@StevenArzt |
Slight differences are expected, because the Infoflow class also patches some classes to add support for threads, handlers, etc. These aspects are not yet considered in what SetupApplication computes. Aside from that, the two callgraphs should be similar. Is there anything concrete missing from one of the se callgraphs that is present in the other one? |
@StevenArzt |
@StevenArzt |
@njupt-moon FlowDroid currently does not support fragments, but we will hopefully add this feature soon. Concerning the callgraphs, I have to look into it more closely before I can give you an answer. |
@StevenArzt |
If you just want to enumerate all the Android API methods in the android.jar file, why don't you just run Soot on the JAR alone as a normal Java library? You don't need the Dalvik frontend in this case since you are only interested in the library which is pure Java. Just put it in the process-dir and change the src-prec to Java classes. |
I would like to do the exact opposite, find all classes that call a method in android.support.v4.app.ActivityCompat. Still, it seems to me that soot does not list this class neither in Scene.v().getLibraryClasses() or Scene.v().getApplicationClasses() . |
@njupt-moon Please re-open if this is still relevant. |
@StevenArzt
Hi!
As I see, cg.cha has the phase option "AppOnly" to reduce the call graph edges within library classes. But it seems that there is not any similar options in cg.spark to implement the same function as "AppOnly" does, am I right?
The text was updated successfully, but these errors were encountered: