What is the android:exported attribute behavior change introduced in Android 12 for components with intent-filters?
- A.D. The change only applies to BroadcastReceivers; Activities and Services are unaffected
- B.B. Android 12 automatically sets exported=true for all components with intent-filters, making all intents available to external apps
- C.C. Android 12 changed the default from exported=true to exported=false for all components, regardless of intent-filter presence
- D.A. In Android 12, any component that declares an intent-filter must explicitly set android:exported to true or false; apps targeting API 31+ that omit this attribute will fail to install, forcing developers to consciously decide whether components should be externally accessible
Why D is correct
Prior to Android 12, a component with an intent-filter had an implicit default of exported=true. This caused many inadvertent exposures. Android 12 (API 31) made the attribute mandatory for components with intent-filters: the build will fail at compile time (or the app will be rejected at install) if the attribute is missing. This forces developers to make an explicit security decision for each component.
Know someone studying for Mobile Security Fundamentals? Send them this one.