1

Is possible to have a conditional permission on android according to the build flavor from gradle?

I release my apps through google play and also in the official website, but I would like to have different permissions in the manifest deployed to the different repositories. It is basically the SMS related features since Google forbids me to have them

So I have two app flavors with different constants that I would like to use to declare permissions and load them

PS. Why I want all this? I hate the laziness of Google to release the apps (recently they took 96hours to release a critical correction to my app that took me 5 to realise and fix the code). Also it is impossible to request SMS related permissions now because google think that developers are evil and users are dumb. I have some non-critical features in my app that would enhanced if i can read users SMS and as a matter of facts the phone owner should be the one with the final decision... not Google.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Rafael Lima
  • 3,079
  • 3
  • 41
  • 105

1 Answers1

0

If you're using Gradle Flavors you can use something like in this answer which is for your Google Flavor to use:

<uses-permission
   android:name="android.permission.SEND_SMS" 
   tools:node="remove"/>

So that it doesn't exist on Google but it does on the APK of the official website.

If you need more info on Flavor do tell :)

Biscuit
  • 4,840
  • 4
  • 26
  • 54