cuplv / TraceRunner

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

Callins should not occur on synthetic callbacks #16

Closed ftc closed 7 years ago

ftc commented 7 years ago

When instrumenting a trace there are 4 steps:

This ordering means that the required super call from the override all overrideable methods is logged as a callin when the application never made this callin.

Corner case: if an overridden method is called as a callin from the application we still need to log it as a callin. The current mechanism looks at where the call resolves to and if its framework its logged, this doesn't work with the override so look into how to make this work.

Possible solution: reorder as follows:

And then make sure that calling a method from the app that has been overridden still logs as callin.

[58] [CB] void plv.colorado.edu.mediaplayerexample.MainActivity.onCreate(android.os.Bundle) (17252cf4,NULL) 
  [59] [CI] void android.support.v7.app.AppCompatActivity.onCreate(android.os.Bundle) (17252cf4,NULL) 
  [60] [CB] android.support.v7.app.AppCompatDelegate plv.colorado.edu.mediaplayerexample.MainActivity.getDelegate() (17252cf4) 
  [61] [CI] android.support.v7.app.AppCompatDelegate android.support.v7.app.AppCompatActivity.getDelegate() (17252cf4) 
  [62] [CB] android.view.Window plv.colorado.edu.mediaplayerexample.MainActivity.getWindow() (17252cf4) 
  [63] [CI] android.view.Window android.app.Activity.getWindow() (17252cf4) 
  [66] [CB] android.content.res.Resources$Theme plv.colorado.edu.mediaplayerexample.MainActivity.getTheme() (17252cf4) 
  [67] [CI] android.content.res.Resources$Theme android.view.ContextThemeWrapper.getTheme() (17252cf4) 
  [70] [CB] android.content.res.Resources plv.colorado.edu.mediaplayerexample.MainActivity.getResources() (17252cf4) 
  [71] [CI] android.content.res.Resources android.support.v7.app.AppCompatActivity.getResources() (17252cf4) 
  [74] [CB] android.content.res.Resources$Theme plv.colorado.edu.mediaplayerexample.MainActivity.getTheme() (17252cf4) 
  [75] [CI] android.content.res.Resources$Theme android.view.ContextThemeWrapper.getTheme() (17252cf4) 
ftc commented 7 years ago
ftc commented 7 years ago

Discussion Dec 19 with Evan Sergio Shawn and Edmund:

Upshot is that the super call should be left in as this is the desired behavior.

Arguments for keeping the callins:

Arguments for removing the callins:

My suggestion action: Leave super calls but label "artificial" callbacks in the trace so if we decide to change the behavior later retracing is not necessary.