Skip to content

Cannot get the inner class/implicit calls CFG from Flowdroid #212

@99zikke

Description

@99zikke

I have tried to get the CFG of the codes below. But Flowdroid can only get the CFG of outer class.

public class MainActivity extends AppCompatActivity {
    ...

    public class MyHandler extends Handler {
        ...
        

        public void handleMessage(Message msg) {
                         ...something I want to detect
                  }
        }
}

My codes used to get the CGF are as below

SetupApplication analyzer = new SetupApplication
                ("D:\\android_sdk\\android-sdk_r24.4.1-windows\\platforms",
                        "C:\\Users\\xxx.apk");

        analyzer.constructCallgraph();
        for(int i = 1; i > 19; i ++){
            int a  = 1;
        }
        // Iterate over the callgraph
        for(Iterator<Edge> edgeIt = Scene.v().getCallGraph().iterator(); edgeIt.hasNext(); )
        {
            Edge edge = edgeIt.next();

            SootMethod smSrc = edge.src();
            Unit uSrc = edge.srcStmt();
            SootMethod smDest = edge.tgt();

            System.out.println("Edge from " + uSrc + " in " + smSrc + " to " + smDest);
        }

I can find the jimple of

public void handleMessage(Message msg) {
                        ...something I want to detect
                 }

but I couldn't get them in the CFG. What should I do?
I'd be really grateful for your answer!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions