user3341338
user3341338

Reputation: 433

Call graph nodes missing in android analysis using WALA

I am using WALA to build the call graph for the "onCreate" method for a simple android application. Here are the code snippets:

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Camera mCamera = Camera.open();
    mCamera.release();
}

However, there are some missing nodes in the call graph. The call graph is like this:

onCreate(...)

-onCreate(...)

-setContentView(...)

-open(...)

As you can see the release() is missing.

How can it happen? Any suggestions are welcomed.

Upvotes: 3

Views: 442

Answers (1)

Jon
Jon

Reputation: 36

You will need to include in your analysis the android.jar (supplied with the SDK). In order for WALA to be able to recognize all packages. Be sure to use the android.jar version that matches your code level.

You can add it as an extra primordial or application nodes depends on your needs.

However if you are planning on analyzing the android API as well, you will need to find a full android.jar as the one supplied in the SDK has only stub methods. This project has some full android.jar ready. The android.jar from the SDK will do if all you need is to analyze the application code alone without the API calls.

Upvotes: 1

Related Questions