EddyVerbruggen / Custom-URL-scheme

:link: Launch your Cordova/PhoneGap app by a Custom URL scheme like mycoolapp://
1.03k stars 367 forks source link

Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. #342

Open gsebastianlopezillia opened 2 years ago

gsebastianlopezillia commented 2 years ago

Building an app with voltbuilder targeting API 31, using android-cordova 11 I get this error:

FAILURE: Build failed with an exception.

FYI, the Android Developer site says:

This element sets whether the activity can be launched by components of other applications: If "true", the activity is accessible to any app, and is launchable by its exact class name. If "false", the activity can be launched only by components of the same application, applications with the same user ID, or privileged system components. This is the default value when there are no intent filters.

I manage to fix this on my local, but voltbuild as other tools generate the bundles "some where up there" using the npm packages so if the fix isn't applied to this project all the builds targeting android 12 and higher using this plugin are going to fail. This error can be fixed by adding the property "android:exported" on the ln 66 on plugin.xml replacing:

<config-file target="AndroidManifest.xml" parent="/manifest/application/activity"> by <config-file target="AndroidManifest.xml" android:exported="true" parent="/manifest/application/activity">

I can't promise that I would do a PR with this case so if someone can do it, thanks in advance.