1

In my final AndroidManifest, found under Droid\obj\Debug\android\manifest\AndroidManifest.xml, I have

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

However, my main project does not have those permissions listed. In fact, the word "Internet" doesn't appear anywhere in my entire solution!

According to this forum post,

Any library can set permissions that it needs, which automatically get added during compilation

But I have no idea how to tell which library is adding them! So how can I figure out which library is adding permissions to my app?

BlueRaja - Danny Pflughoeft
  • 84,206
  • 33
  • 197
  • 283
  • Wen you compile in Debug conf, storage and internetbare automatically added. Can make a release build and see if they arevstill there? – Kai Brummund Aug 20 '16 at 14:26

1 Answers1

1

The path to the Manifest you postet shows that you are compiling in Debug Configuration.

In Debug mode, Internet and Storage are automatically added, as documented here (last paragraph).

Try compiling a Release Build and they should be gone.


The additional permissions are added by putting an UsesPermissionAttribute into the AssemblyInfos.cs.

You can read those using reflection, like in this answer.

I don't know how to see those attributes in VS just from the compiled assembly. If someone gives a hint, I'll add it here.

Community
  • 1
  • 1
Kai Brummund
  • 3,538
  • 3
  • 23
  • 33
  • For further reference, this is specifically in the `ManifestDocument.cs` code of `xamarin-android`: https://github.com/xamarin/xamarin-android/blob/a8f7db057334be3124cabccd2cb2fd7dcf45f458/src/Xamarin.Android.Build.Tasks/Utilities/ManifestDocument.cs#L298-L302 – Jon Douglas Aug 20 '16 at 15:05
  • That was it, thanks! But, for future googlers who find this question, do you know the answer to the title-question? – BlueRaja - Danny Pflughoeft Aug 20 '16 at 20:14
  • Using reflection, by looking for the permission. I updated the answer. – Kai Brummund Aug 20 '16 at 20:49