Skip to content

ActivityAttribute.MainActivity should set exported=true #6196

@jonpryor

Description

@jonpryor

Context: https://aster.cloud/2021/02/23/lets-be-explicit-about-our-intent-filters/

An important change is coming to Android 12 that improves both app and platform security. This change affects all apps that target Android 12.

Activities, services, and broadcast receivers with declared intent-filters now must explicitly declare whether they should be exported or not.

The short version is that many apps may need to update their [Activity] attribute usage to explicitly set ActivityAttribute.Exported.

However, we added ActivityAttribute.MainLauncher, which is also used in our templates:

https://github.com/xamarin/xamarin-android/blob/f7d32102cc3ada67aa12cc0beed2cf97226f41b3/src/Microsoft.Android.Templates/android/MainActivity.cs#L8

We should update our AndroidManifest.xml generation & related code so that when MainLauncher=true, we also automatically set exported=true.

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.needs-triageIssues that need to be assigned.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions