cuplv / TraceRunner

Tool for generating dynamic traces of android applications.
3 stars 0 forks source link

<clinit> is a callback #23

Closed ftc closed 7 years ago

ftc commented 7 years ago

Previously we assumed that all callbacks were non static but technically the static initializer (\<clinit>) of a method is called by the framework and it is static.

This issue comes up in the following code:

class Foo{
    static UriMatcher u = foo();
    static UriMatcher foo(){
        return new UriMatcher(3);
    }
}

This issue was discovered by tracing ContractionTimer (88eacfa6282ad015227b2d6a50d13e4e4f444d94)

ftc commented 7 years ago

Correct fix, will try to have before tomorrow: add logging so that static initializer is logged as a callback.

Quick fix: drop orphan callins within the callback-verification as long as they aren't used by any rules and throw an exception if they are.