[Soot-list] loosing reflection precision with spark

Ivan Postolski ivan.postolski at gmail.com
Fri Dec 5 14:41:55 EST 2014


Hi guys,

Is there a way to enable or increase the reflection support when creating a
call graph using spark?

Let me show you an example. I want to analyze a code like the following:

public class FieldInjectionMain {

    private WiredInterface wired;

    public static void main(String[] args) throws NoSuchFieldException,
IllegalAccessException {
        FieldInjectionMain main = new FieldInjectionMain();
        Field wiredField = main.getClass().getDeclaredField("wired");
        wiredField.setAccessible(true);
        wiredField.set(main,new WiredImpl());
        assert main.doSomething() == 2014;
    }

    public int doSomething() {
        return wired.doSomething();
    }
}

So a call graph aware of reflection will know that the following is a
feasible path

FieldInjectionMain.main(..) -> FieldInjectionMain.doSomething() ->
WiredImpl.doSomething()

And in fact using default call graph, the path is there. But when I enable
spark is not longer there.

Cheers

Ivan.-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20141205/cceb1c7f/attachment.html 


More information about the Soot-list mailing list