googleads-mobile-unity icon indicating copy to clipboard operation
googleads-mobile-unity copied to clipboard

v9.2.0 adds unnecessary permissions in manifest

Open ChaserKnight opened this issue 1 year ago • 1 comments

[REQUIRED] Step 1: Describe your environment

  • Unity version: 2022.3.40f1
  • Google Mobile Ads Unity plugin version: 9.2.0
  • Plugin installation method: .unitypackage import
  • Platform: Android
  • Platform OS version: all
  • Any specific devices issue occurs on: all
  • Mediation ad networks used, and their versions: none

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

AdMob plugin latest version 9.2.0 adds unnecessary permissions (mentioned below), these were never added in the past. Users complain if new permissions are added. Why are these added now? Are these required by the plugin?

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

I looked in the "manifest-merger-release-report.txt" file and this is the reason mentioned there, please take a look, please fix this issue. I don't want these weird permissions added.

uses-permission#android.permission.WRITE_EXTERNAL_STORAGE
IMPLIED from /Users/xx/xx/Project/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/src/main/AndroidManifest.xml:2:1-5:12 reason: com.google.unity.ads has a targetSdkVersion < 4
uses-permission#android.permission.READ_PHONE_STATE
IMPLIED from /Users/xx/xx/Project/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/src/main/AndroidManifest.xml:2:1-5:12 reason: com.google.unity.ads has a targetSdkVersion < 4
uses-permission#android.permission.READ_EXTERNAL_STORAGE
IMPLIED from /Users/xx/xx/Project/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/src/main/AndroidManifest.xml:2:1-5:12 reason: com.google.unity.ads requested WRITE_EXTERNAL_STORAGE

ChaserKnight avatar Aug 09 '24 09:08 ChaserKnight

Same issue.

wangping0214 avatar Aug 27 '24 11:08 wangping0214

I was unable to replicate this issue. The Hello world app had the following permissions.

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
<uses-permission android:name="android.permission.ACCESS_ADSERVICES_AD_ID"/>
<uses-permission android:name="android.permission.ACCESS_ADSERVICES_ATTRIBUTION"/>
<uses-permission android:name="android.permission.ACCESS_ADSERVICES_TOPICS"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>

Could this be a separate dependency?

NVentimiglia avatar Sep 05 '24 21:09 NVentimiglia

I also mentioned in the original post about the "manifest-merger-release-report.txt" file, which states the reason behind this. As you can see in the report, "reason: com.google.unity.ads has a targetSdkVersion < 4". It means it is coming from "com.google.unity.ads". I don't have any other plugin beside admob in my app. If it is not happening because of admob, then why does the report states the reason coming from com.google.unity.ads?

ChaserKnight avatar Sep 05 '24 21:09 ChaserKnight

Thanks, I will take a deeper look into this issue and I will get back to you shortly.

NVentimiglia avatar Sep 13 '24 16:09 NVentimiglia

I use Unity 2021.3.39f1 and this problem does not occur. After updating to Unity 2021.3.43f1 this problem occurs in this version of the plugin and also in previous ones, such as GoogleMobileAds-v9.1.0 and GoogleMobileAds-v9.0.0. I had to go back to the old version of Unity. Apparently there is some problem between the plugin and recent versions of Unity.

chicotx56 avatar Sep 17 '24 00:09 chicotx56

im also seeing this. didn't start happening until i added "Google Mobile Ads for Unity" for the first time

Unity 2022.3.46f1 Google Mobile Ads for Unity 9.2.0

AndrewShields avatar Sep 22 '24 06:09 AndrewShields

@AndrewShields Thanks for letting me know about the duplication.

Environment

  • Unity version: 2021.3.43f1
  • Google Mobile Ads Unity plugin version: v9.2.0
  • Plugin installation method: .unitypackage import
  • Minimum API Level: 22
  • Target API Level: 34

READ_PHONE_STATE / READ_EXTERNAL_STORAGE

It may contain libraries for which you have not specified a version.

Note: If both your minSdkVersion and targetSdkVersion values are set to 3 or lower, the system implicitly grants your app this permission. If you don't need this permission, be sure your targetSdkVersion is 4 or higher.

Solving temporary problems

I added the following to AndroidManifest.xml as it is a permission that is definitely not needed for my game.

<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />

IShix-g avatar Sep 22 '24 09:09 IShix-g

The issue related to the extra permissions has been identified and will be fixed in the next release. Thanks for the report!

NVentimiglia avatar Oct 04 '24 22:10 NVentimiglia