Android 6.0 / Permissions: READ_PHONE_STATE, WRITE_EXTERNAL_STORAGE, GET_ACCOUNTS

Hello,

We received a feedback from Google Play Editorial Team with changes to be done in our game before it gets featured on the store.

On Android 6, three “weird” permissions are popping up (please see the attached images) and none of these are present in the game’s “manifest.xml” file.

Even after an extensive research, we couldn’t fix all the issues as follows:

  1. Fixed: READ_PHONE_STATE (manage phone calls) was added to the APK automatically by Unity (5.3.3) when we called the function “SystemInfo.deviceUniqueIdentifier”. However, we will have to figure out another ways to identify the devices for the analytics tools.

  2. Open: WRITE_EXTERNAL_STORAGE (access photos, media, and files) we have no idea from where it is coming from!

  3. Open: GET_ACCOUNTS (access your contacts) we have no idea from where it is coming from!

Also, the following plugins are in use now:

  • Facebook SDK
  • Google Play Game Services (Prime31)
  • Unibill
  • AppsFlyer, Chartboost, Flurry and Google Analytics

Please help us to identify what are the causes of WRITE_EXTERNAL_STORAGE and GET_ACCOUNTS appearing on the APK during the build process!

Thanks in advance!

Note #1: “Split Application Binary” is OFF;

Note #2: The word “GET_ACCOUNTS” don’t appear in any of the project files, including sources, binaries, manifests, etc.



1 Like

I’m looking for ways to get rid of those two last ones too. In the meantime I found a way to get the device id without using systeminfo:

AndroidJavaClass up = new AndroidJavaClass (“com.unity3d.player.UnityPlayer”);
AndroidJavaObject currentActivity = up.GetStatic (“currentActivity”);
AndroidJavaObject contentResolver = currentActivity.Call (“getContentResolver”);
AndroidJavaClass secure = new AndroidJavaClass (“android.provider.Settings$Secure”);
string android_id = secure.CallStatic (“getString”, contentResolver, “android_id”);

Hi,

You won’t believe but we couldn’t fix this issue and had no support from Unity Support Team to do so.

Basically, we had to change our deployment process to:

  1. Unpack the APK generated by Unity;
  2. Manually remove the permissions from the Manifest;
  3. Repack the APK (sign, zipalign, etc.).

A REAL MESS!!! :-((

Hi, when building the APK inside Unity, in the player settings:
What do you have in install location?
And in write access?
I think that might cause WRITE_EXTERNAL_STORAGE.

Player Settings are:

Install Location = Perfer External
Write Access = Internal Only

Have you asked the plugin developers about this?

Nope but we found no references to the word “GET_ACCOUNTS” within the entire sources / binaries.

Actually someone should make a plugin that REMOVES permissions and earn some extra money on the Asset Store :slight_smile:

Did you ever figure out what was adding GET_ACCOUNTS?

Apparently accessing the Unity Unique ID adds the “Make and manage phone calls” permissions.

I believe this is causing WRITE_EXTERNAL_STORAGE to be asked. The app wouldn’t be able to install on external storage otherwise.

Any news on that?
I have the same problem here…

Same issue here and didn’t find the right tools to unpack, repack, sign and align :confused: @Leekafka can you share with us the tools you used for this solutions please ?

Dealing with this right now, no idea what is causing it. Looks like I’m going to have to add my plugins one by one into a new project to find out.

I’m on 4.7.2

Empty project creates the WRITE_EXTERNAL_STORAGE for API below below 19.

Going to use a maxSdkVersion and see what the feature teams thinks of that:

@Leekafka I have these feedback from Google Play Editor team as well. After you removed those permission manually in manifest file, did your game work correctly? In my case it stopped at my company logo screen.