You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider a simple application with only one Activity (named MainActivity) declared in its AndroidManifest file. The code of the Activity is shown below:
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Intent i = new Intent();
context.startActivity(i);
}
};
}
}
The intent that is being sent above is shown in Epicc's output, but not in IC3's output.
The destination of this intent is irrelevant - regardless of its destination,
Epicc shows in its output that an intent is sent in MainActivity$1.onReceive,
but there is no related entry in IC3's output (even if the destination is statically resolvable).
The bug occurs when:
The receiver of a method that sends an intent is a method parameter.
AND
The intent is sent within an anonymous class.
(only one of them was not enough to reproduce the bug).
The text was updated successfully, but these errors were encountered:
Thank you for the report. There is indeed a bug, but not exactly for the code shown in your report.
First, IC3 is right not to report anything for the code shown above. The receiver is never registered and thus onReceive() can never be reached.
However, even if you add registerReceiver(receiver, new IntentFilter()) at the end of onCreate(), then IC3 still won't show anything, which is not normal. In its call graph construction, when it is creating the dummyMain to simulate the application lifecycle, IC3 should detect the registerReceiver method and then generate the lifecycle for the receiver argument. The problem is that IC3 relies on the FlowDroid lifecycle generation, which does not support this yet.
Thus, we need to add this to FlowDroid and then pull the latest lifecycle creation procedure from FlowDroid into IC3.
Thank you for the fast reply. I agree with you that a registerReceiver call is necessary.
ps: Epicc will still report that an Intent is sent in MainActivity$1.onReceive, even without a registerReceiver call, but this seems to be another issue.
Consider a simple application with only one Activity (named MainActivity) declared in its AndroidManifest file. The code of the Activity is shown below:
The intent that is being sent above is shown in Epicc's output, but not in IC3's output.
The destination of this intent is irrelevant - regardless of its destination,
Epicc shows in its output that an intent is sent in MainActivity$1.onReceive,
but there is no related entry in IC3's output (even if the destination is statically resolvable).
The bug occurs when:
AND
(only one of them was not enough to reproduce the bug).
The text was updated successfully, but these errors were encountered: