Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Colliding Permissions That Depend on Package Name #32

Open
c-h- opened this issue May 17, 2016 · 1 comment
Open

Colliding Permissions That Depend on Package Name #32

c-h- opened this issue May 17, 2016 · 1 comment

Comments

@c-h-
Copy link
Contributor

c-h- commented May 17, 2016

Some plugins add permissions that depend on package names. One is Pushwoosh Push Notification Plugin.

Example permission:

<permission android:name="$PACKAGE_NAME.permission.C2D_MESSAGE"  android:protectionLevel="signature" />

As I understand it, the activity io.cordova.reactnative.cordovaplugin is the one actually registering these plugin permissions.

The problem is when multiple apps are installed that use this package to add React Native plugins, since then multiple apps will have the same permission name. When this happens, installation fails.

Do you have any suggestions of how to namespace these permissions better?

Ideas:

  • Access the React Native project's MainActivity package name to set $PACKAGE_NAME somehow
  • Use a variable passed in when installing the plugin to set $PACKAGE_NAME (e.g. /cordova-plugin add ___ --variable PACKAGE_NAME="com.some.package")

I'm not sure how feasible the ideas above are, but if I get some feedback I can look into working on this (I need this resolved myself).

Thanks!

@c-h-
Copy link
Contributor Author

c-h- commented May 17, 2016

My solution so far is to manually update the C2D permissions in:

  • platforms/android/AndroidManifest.xml
  • platforms/android/android.json

To get the correct package ID set.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant