Unity 5.1 adds android permission READ_PHONE_STATE automatically, how to remove it?

I can’t vote for it because it’s marked as “Won’t Fix” :eyes: :face_with_spiral_eyes: What’s up with that?

2 Likes

Here is another more specific bug report that is still open:
http://fogbugz.unity3d.com/default.asp?705138_9rutj7lcuolffk15

Could they not have added a comment as to why it was closed with “Won’t Fix”? Are they really not going to fix it? Shouldn’t it be marked “Duplicate” if there is another bug dealing with it?

I hope that closing the bug was a mistake as this is a nasty permission. Some developers say it is unacceptable.
@anon_36705745 you say that you ‘democratise game development’, then please listen to the worries of your users and remove this permission as it kills their business.

If it was not a mistake then they should:

  1. explain why they won’t fix it.
  2. explain why Unity needs it even if the developer does not need it and doesn’t want it.
  3. describe in detail what it is used for and update their privacy policy so that developers can update their privacy policy and refer to it.
    We are responsible for what we publish, we have to comply with the laws of the countries where we publish, e.g. COPPA.
2 Likes

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.

Can I please have the list of “many problems with Android”? Thank you!

1 Like

Thanks for the solid explanation finally we maybe able to rest this one.

I think what he means by many problems and I let him speak,
but my list would be

  • Black Screen on some Android devices
  • Performance issues / FPS drops
    But please note this is specific to Unity 5 only.

We are also conducting tests on Unity 5.2 beta to see if any changes, although there is performance improvements, they not at the point of 4.6. There is a long thread about this on the Android forums. Also in terms the black screen I know you cannot reach out to the thousands of Android devices out there, but I think its based on the chipsets.

So you need to understand peoples frustration all of a sudden…but to be honest Android is the most corrupt market place and hard to weed out the real issues…

Could this be added to the script reference docs?

Why was the bug marked as “Won’t Fix”? I can’t see this not getting fixed. Whether it’s a bug for the android team or a bug for one of the services teams, it doesn’t matter to us. It just needs to get fixed as soon as possible.

1 Like

Thanks for your explanation.

To us (developers) Unity is a black box and we cannot see where the permissions are added.
A project with an empty scene had the permission.

You say that there might be an issue with the services’ dlls.
Do you mean that the READ_PHONE_STATE permission is not enforced intentionally and that it shouldn’t be there when no additional services (like Ads and Analytics) are used?

I read about the workaround but when I build my app the automatic build process generates 28 different apps. I cannot do that by hand.

In addition to the problems listed by MrEsquire I had a weird text rendering problem all characters were rendered as blocks. I have seen it several times but I have not been able to reproduce it. Someone else describes the issue here:

This is correct. None of the Android permission management code has changed during recent versions so far. It works late in the build process, analyzing managed DLLs and build configuration.

Today I asked our lead QA to take a closer look at the bug report # 705138 (which is basically the same as the one closed as “won’t fix”). We will try to find a solution here.

1 Like

Thank you very much Yury.

I’d hazard a guess that it’s Unity Analytics that accesses the device identifier, forcing this permission. IMHO analytics should never use the device ID, unless explicitly requested by the (API) user, so hopefully you guys sort this out and remove the device ID usage, or at least make it optional.

Speaking from experience, I can tell that many users are very paranoid about this READ_PHONE_STATE -permission; “why does your game want to access my phone calls!??”…

1 Like

Hi all -
As Yury Habets mentioned in the earlier post the workaround he suggested is a solution to the issue currently.

Also the READ_PHONE_STATE permission is in the process of being resolved for 5.2 release. Finally Unity Analytics only collects anonymized user ID. Please read below on what this entails:

1. What information does Unity Analytics collect?
In order to provide analytics for your games, Unity Analytics collects and uses in each game built with Unity Editor an anonymized user ID. Each ID is unique to users on each developer’s apps. These IDs cannot be used to track users across apps built by other developers and cannot be mapped between different services, devices, or even different browsers on the same computer. For further information, please review the Unity Privacy Policy: Privacy Policy Hub.

2. What is the anonymized user ID used for?
The anonymized user ID is used to track the activities of game players in order to help developers: (i) provide game usage and performance analytics; (ii) understand game performance and monitor game health and areas of crashing; (iii) improve game design and green lighting; (iv) deploy future game development resources based on game performance; (v) maintain or analyze the functioning of games, including through maintenance, analysis and analytics; (vi) protect the security and integrity of game players; (vii) serve contextual advertising and cap the frequency of advertising; and (viii) ensure legal or regulatory compliance.

Are the INTERNET and ACCESS_NETWORK_STATE permissions going to be fixed as well in 5.2?

I think that the INTERNET permission is intentional and used by Unity to obtain device information to improve Unity and for statistics. Earlier versions had a setting to opt out but it was removed.

INTERNET permission is highly unlikely to be removed.

I’m not sure why Unity would force us, as developers, to include permissions we do not want. This will hurt our marketability. Maybe a detailed explanation of why Unity wants to use our apps to gather this information would help ease the bitter taste. In my humble and often ignored opinion, permissions should be added solely by the developer and not by the engine designer. Following this line of thinking, promotes trust along the whole development chain. From engine developer, to app developer, to end user. If my user doesn’t trust me, then how can I trust my engine maker? It begs the question, are there any other hidden lines of code waiting to surface? Just an opinion.

We don’t force permissions, we just set it with accordance to what APIs you call or which build settings you have selected.

INTERNET permission is required by networking and analytics modules, IIRC. If they can be excluded - then the permissions will not be forced.

The upcoming Android M release is supposed to add more granular control over the permissions.

I refer to my original post which states:

Prior to updating, these permissions were not required. Nothing has changed in the app project. No additional code was written.

I didn’t add anything, so why do I have these permission requirements. I just want them gone. Please tell me what I need to do.

As you may have read -

Nothing has changed as well in the Unity Android code with regard to permissions. Sounds like a deadlock? :slight_smile:

I have also written that you can try exporting project from Unity, opening it in Android Studio, modifying the manifest and building it.

Hello,

I’m quite a new to Unity, so I may not be aware of all the details about the parts of the API I’m using, but I’m in a similar situation as PhoenixTalon; my application required no permissions when building 5.0, but does now (since 5.1.something).

To be clear, the last version I deployed a few weeks ago, built with 5.0, required no permissions at all.

But, after some weeks of not working on it (I had to cope with some belgian fiscal obligations, which might trigger sympathy from anyone knowing about Belgium ;-p), coming back recently to install the updates to 5.1.something and making only (relatively) minor changes (mostly using more functionalities of Unity 5’s UI and PlayerPrefs), I now get the these permission requests added in the final APK; READ_PHONE_STATE (as discussed before, which should be fixed soon), INTERNET and ACCESS_NETWORK_STATE (also as discussed before).

The thing is, I’ve no knowledge of adding anything network-related and I’ve no idea of what I could remove to have these two latter permissions removed (I like to have my Android applications permissions-free ;-).

Would anyone have any tips on that?
Should I look for classes with specific names or being found in specific packages?

[Edit]
After a bit of (better) reading, I understood that the Internet access might be required due to Unity Analytics, which can only be disabled on the pro version of Unity. Is that correct?

Thank you!