- Home /
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?
Yes, I am waiting for answer. I posted a question some days ago and created a thread in the android forum. Someone else has created a bug report. I make games for kids and this permission leads to bad ratings and many questions. I hope that it is a bug as it is not mentioned in the 5.1 release notes. Only Unity can explain why this permission has been added but so far, there has been no word from them. I don't understand why it takes so long, it is not a difficult question for Unity.
I'm sure you can appreciate that they're likely getting thousands of questions daily, for probably much more serious things.
Are you able to change the manifest and remove the permission? That would at least give you a workaround.
yes there are ways to modify a apk, google was my friend and helped me alot. if someone has a question about modifying feel free to message me. about those 'thousands of questions' sure i guess they get many but if i am not completely wrong i read a statement somewhere that unity is the most used engine for mobileplatform. if that's the case i doubt the 'much more serious things'
Answer by Aurore · Jul 13, 2015 at 02:59 PM
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."
I'm using Unity 5.6.2 and think this is not true anymore, The problem must be related to this issue.
Answer by Xyxn · Jun 18, 2015 at 12:59 PM
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
I am getting this issue too after upgrading to Unity 5.1
Waiting for a solution.
Yes - waiting on answer myself! Have Unity officially stated they'll fix it?
Can you specify what "other tools" did you use to remove these permissions. I'm trying to export the project to Android Studio and build it there but we rely heavily on third party SD$$anonymous$$s that have a lot of problems with this.
Answer by RINNUXEI · Sep 11, 2017 at 03:55 AM
For whom are using Android SDK tools higher than 26.x.x, found my solution.
Uninstall the latest Android SDK tools. (Using SDK manager or deleting the tools folder within your sdk directory)
Download Android SDK tools 25.2.5 . (https://androidsdkoffline.blogspot.jp/p/android-sdk-tools.html)
Copy the tools folder into HOME/Library/Android/sdk/
Enjoy your day :)
Answer by eekgames · Jul 10, 2015 at 02:54 PM
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 :(
this is interesting, I am not using Futile2D library, but am wondering if there is a similar fix, somehere, but I am totally lost as to where to start with that!
Rougelkon, my fix didn't work after all, I was mistaken; sorry to lead you astray with my foolishness :(
Unity should have a document on what functions require READ_PHONE_STATE!
I'm using Unity 5.6.2 and think this is not true anymore, The problem must be related to this issue.
Answer by lucks17 · Sep 15, 2017 at 05:00 AM
For remove READ_PHONE_STATE permission on android in UNITY, you need to put in all manifests
<uses-sdk android:minSdkVersion="14"/>