cuplv / droidel

Framework model for static analysis of Android
Apache License 2.0
46 stars 14 forks source link

Handle getLast/onRetainNonConfigurationInstance via bytecode transformation #16

Open sblackshear opened 9 years ago

sblackshear commented 9 years ago

The programmer can save state across instances of an Activity by returning the desired object in onRetainNonConfigurationInstance and can retrieve the saved state by calling getLastNonConfigurationInstance. The mechanism for saving this state inside the Android library is quite complicated, but we could model this saving mechanism in a simple way using a special static field that is written in onRetainNonConfigurationInstance and read instead of calling getLastNonConfigurationInstance. We should add an automated bytecode instrumentation pass that implements this transformation.