Permissions Manifest weird behaviour

I know there are other threads around here about this. I post my own one because this thing is driving me crazy. Thats mainly, because I tried so many things.

Something keeps putting user permissions back in my manifest. I was able to solve this.

IT WORKED last night and after fixing one little bug I created a new build and its back to put these unwanted user permissions back in my file.

This is my Manifest…

<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:installLocation="preferExternal" package="APP_BUNDLE_ID" android:versionName="2.0" android:versionCode="2">
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <uses-feature android:glEsVersion="0x00020000" />
  <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26" />
  <application tools:replace="android:icon" android:label="@string/app_name" android:debuggable="false" android:icon="@drawable/app_icon" replace="android:icon">
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:launchMode="singleTask" android:screenOrientation="landscape">
      <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
    <activity android:name="com.androidnative.AndroidNativeProxy" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    <activity android:name="com.androidnative.features.social.common.SocialProxyActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    <activity android:name="com.androidnative.OAuthProxyActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    <activity android:name="com.androidnative.billing.core.AN_BillingProxyActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
  </application>
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="com.android.vending.BILLING" />
  <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
</manifest>

But at the end (in my Temp directory) after build, there are several permissions added, so this is the final manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="de.dreixms.CrazyRubberDuck" android:versionCode="54" android:versionName="2.0.54" android:installLocation="preferExternal">
  <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="25" />
  <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" />
  <uses-feature android:glEsVersion="0x00020000" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="com.android.vending.BILLING" />
  <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
  <uses-permission android:name="android.permission.GET_TASKS" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  <uses-permission android:name="com.xiaomi.sdk.permission.PAYMENT" />
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  <uses-permission android:name="android.permission.GET_ACCOUNTS" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  <uses-permission android:name="com.xiaomi.permission.AUTH_SERVICE" />
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  <application tools:replace="android:icon" android:allowBackup="true" android:icon="@drawable/app_icon" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme" tools:replace="android:icon" android:debuggable="false" android:isGame="true">
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:screenOrientation="sensorLandscape" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection">
      <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
      </intent-filter>
    </activity>
    <activity android:name="com.androidnative.AndroidNativeProxy" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="@string/app_name" android:launchMode="singleTask" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    <activity android:name="com.androidnative.features.social.common.SocialProxyActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="@string/app_name" android:launchMode="singleTask" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    <activity android:name="com.androidnative.OAuthProxyActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="@string/app_name" android:launchMode="singleTask" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    <activity android:name="com.androidnative.billing.core.AN_BillingProxyActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="@string/app_name" android:launchMode="singleTask" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    <!-- Xiaomi SDK Need -->
    <activity android:name="com.xiaomi.gamecenter.sdk.ui.MiActivity" android:configChanges="orientation|screenSize" android:screenOrientation="behind" android:theme="@android:style/Theme.Translucent.NoTitleBar">
    </activity>
    <activity android:name="com.xiaomi.gamecenter.sdk.ui.PayListActivity" android:configChanges="orientation|screenSize" android:exported="true" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    <activity android:name="com.xiaomi.gamecenter.alipay.HyAlipayActivity" android:configChanges="orientation|screenSize" android:exported="true" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    <activity android:name="com.xiaomi.account.openauth.AuthorizeActivity" android:configChanges="orientation|screenSize" android:exported="true" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    <activity android:name="com.xiaomi.gamecenter.wxwap.HyWxWappayActivity" android:configChanges="orientation|screenSize" android:exported="true" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    <activity android:name="com.alipay.sdk.app.H5PayActivity" android:configChanges="orientation|keyboardHidden|navigation|screenSize" android:exported="false" android:screenOrientation="behind" android:windowSoftInputMode="adjustResize|stateHidden" />
    <meta-data android:name="unity.build-id" android:value="0dcdc0eb-f894-41ba-9bc8-80e62511ea52" />
    <meta-data android:name="unity.splash-mode" android:value="1" />
    <meta-data android:name="unity.splash-enable" android:value="True" />
  </application>
  <uses-feature android:name="android.hardware.vulkan" android:required="false" />
  <uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>

so as you can see:











are added unwanted.

I changed maxSDKVersion from 26 to 25, I dont have a “res” directory (but AN_res)" … I dont know what else to do. I set back my project to what worked last night and its not working (anymore). Feels like the devil is inside manipulating this thing :smile:

Any more suggestions?

see this answer https://answers.unity.com/questions/1433115/android-how-to-remove-read-phone-state.html?childToView=1474277#answer-1474277