READ_PHONE_STATE permission since 5.1

since 5.1 i my apps asking for READ_PHONE_STATE permission, which gives bad reputation and is unacceptable.
no, i didnt change my manifest at all
someone with the same issue/concerns?

An answer from Yury on the on the forums http://forum.unity3d.com/threads/unity-5-1-adds-android-permission-read_phone_state-automatically-how-to-remove-it.333431/#post-2202146;

"The Android build enforces READ_PHONE_STATE if the code has references to SystemInfo.deviceUniqueIdentifier.
INTERNET is added when any network classes are referenced.
ACCESS_NETWORK_STATE is added when calling Application.internetReachability.

There is no bug in Android code, just the new services dlls are calling different API enforcing these “unnecessary” permissions. There might be an issue with the services’ dlls though.

In addition, there is always a workaround - you can export the project, modify it as you wish and build in Eclipse/Android Studio.

Of course the code won’t crash if the permission is missing. Just some functionality may be unavailable."

They already answered. It wasn’t intentional and they’ll fix it.
Nice folks and very helpful.

In the meantime i helped myself with other tools to change the manifest and it works

For whom are using Android SDK tools higher than 26.x.x, found my solution.

  1. Uninstall the latest Android SDK tools. (Using SDK manager or deleting the tools folder within your sdk directory)
  2. Download Android SDK tools 25.2.5 . (Android SDK Offline: Android SDK Tools/Manager)
  3. Copy the tools folder into HOME/Library/Android/sdk/
  4. Enjoy your day :slight_smile:

I had the same problem with READ_PHONE_STATE being added to my Android manifest when I upgraded from Unity 4.3.4f1 to 5.1.1f1.

It turns out the permission is added due to a line of code in a library I’m using (Futile 2D):

   isOpenGL = SystemInfo.graphicsDeviceVersion.Contains("OpenGL");​

I changed the code as follows:

   #if UNITY_ANDROID
      isOpenGL = true;​
   #else
      isOpenGL = SystemInfo.graphicsDeviceVersion.Contains("OpenGL");​
   #endif​

Now my Android build no longer including READ_PHONE_STATE, which is a relief - users can find that permission a bit suspicious.

EDIT: I thought this had worked, but actually I was mistaken; the READ_PHONE_STATE permission crept back in :frowning:

For remove READ_PHONE_STATE permission on android in UNITY, you need to put in all manifests

 <uses-sdk android:minSdkVersion="14"/>

Posted this elsewhere but hope this helps someone:

So this is a really crappy change in the manifest merger, cause it seems to be responding to files which have nothing to do with the manifest.

I made a blank project and copied across my plugins folder to reproduce, and it did. I then went to remove anything which could cause be affected, and it turns out it wasnt any of the actual plugins, it was /plugins/Android/res/, which was simply a collection of xml files containing localised strings, and png files.

what the actual F is this manifest merger doing?

Anyway, easy way to find out what is putting Read State into your config, is trial and error with a copied version of your project, keep deleting stuff in plugins till read state disappears. Bit of Scientific method always does the trick.