У меня есть проект Android (он находится в Xamarin Forms, но я не уверен, имеет ли это значение), который зависит от многих NuGet.
Когда я обновил все свои NuGets до последней стабильной версии а затем повторно развернули в Google Play. У меня появилось предупреждение, что я запрашиваю новое разрешение READ_PHONE_STATE и что пользователи могут решить не устанавливать приложение.
Я думал, что это потому, что я включил Xamarin.Essentials, но Нет. Только вернувшись к предыдущему коду и медленно обновив многие NuGet, я смог определить, что когда я пытался обновить googleplayservices.maps или казалось что-то, связанное с Google Play Services или Google Firebase, полученные двоичные файлы режима выпуска включали READ_PHONE_STATE в свои проявляется, хотя я явно не запрашиваю разрешение в моем коде.
Может ли кто-нибудь объяснить, является ли это проблемой с Xamarin, мошеннической зависимостью в NuGets или чем-то намеренным со стороны Google из-за некоторых своего рода изменение политики безопасности?
Обновление googleplayservices.maps с 71.1610.0 до 71.1610.1 (на один выпуск исправления) приводит к добавлению READ_PHONE_STATE в манифесты сборки выпуска, то же самое при обновлении до 71.1610.4
Сразу после обновления NuGet и создания релизной сборки я поискал комплекты и обнаружил, что READ_PHONE_STATE введено в android манифест (4 архитектуры).
например,
grep -r "READ_PHONE_STATE" /Users/rob/GitHub/myproject/app/MyApp/MyApp.Droid
привело к ... * 10 16 *
/Users/rob/GitHub/mycompany-myappname-appv2/app/myappname/myappname.Droid/obj/Release/android/manifest/AndroidManifest.xml: <uses-permission android:name="android.permission.READ_PHONE_STATE" />
/Users/rob/GitHub/mycompany-myappname-appv2/app/myappname/myappname.Droid/obj/Release/android/armeabi-v7a/AndroidManifest.xml: <uses-permission android:name="android.permission.READ_PHONE_STATE" />
/Users/rob/GitHub/mycompany-myappname-appv2/app/myappname/myappname.Droid/obj/Release/android/x86/AndroidManifest.xml: <uses-permission android:name="android.permission.READ_PHONE_STATE" />
/Users/rob/GitHub/mycompany-myappname-appv2/app/myappname/myappname.Droid/obj/Release/android/arm64-v8a/AndroidManifest.xml: <uses-permission android:name="android.permission.READ_PHONE_STATE" />
/Users/rob/GitHub/mycompany-myappname-appv2/app/myappname/myappname.Droid/obj/Release/android/AndroidManifest.xml: <uses-permission android:name="android.permission.READ_PHONE_STATE" />
/Users/rob/GitHub/mycompany-myappname-appv2/app/myappname/myappname.Droid/obj/Release/android/x86_64/AndroidManifest.xml: <uses-permission android:name="android.permission.READ_PHONE_STATE" />
Я включаю пример журнала обновления пакета NuGet, который должен помочь показать зависимости.
Attempting to gather dependency information for multiple packages with respect to project 'myappname.Droid', targeting 'MonoAndroid,Version=v9.0'
GET https://api.nuget.org/v3/registration5-gz-semver2/xamarin.googleplayservices.maps/index.json
OK https://api.nuget.org/v3/registration5-gz-semver2/xamarin.googleplayservices.maps/index.json 587ms
GET https://api.nuget.org/v3/registration5-gz-semver2/xamarin.build.download/index.json GET https://api.nuget.org/v3/registration5-gz-semver2/xamarin.googleplayservices.basement/index.json GET https://api.nuget.org/v3/registration5-gz-semver2/xamarin.forms.maps/index.json GET https://api.nuget.org/v3/registration5-gz-semver2/xamarin.googleplayservices.base/index.json
...
Total number of results gathered : 349
Gathering dependency information took 6.51 sec
Summary of time taken to gather dependencies per source :
/Users/rob/GitHub/mycompany-myappname-appv2/app/packages - 445 ms
https://api.nuget.org/v3/index.json - 43.78 sec
Attempting to resolve dependencies for multiple packages.
Resolving dependency information took 0 ms
Resolving actions install multiple packages
Retrieving package 'Xamarin.GooglePlayServices.Base 71.1610.1' from 'nuget.org'.
Retrieving package 'Xamarin.GooglePlayServices.Basement 71.1620.2' from 'nuget.org'.
Retrieving package 'Xamarin.GooglePlayServices.Maps 71.1610.1' from 'nuget.org'.
Retrieving package 'Xamarin.GooglePlayServices.Tasks 71.1601.1' from 'nuget.org'.
GET https://api.nuget.org/v3-flatcontainer/xamarin.googleplayservices.maps/71.1610.1/xamarin.googleplayservices.maps.71.1610.1.nupkg
Removed package 'Xamarin.GooglePlayServices.Maps 71.1610.0' from 'packages.config'
OK https://api.nuget.org/v3-flatcontainer/xamarin.googleplayservices.maps/71.1610.1/xamarin.googleplayservices.maps.71.1610.1.nupkg 29ms
Acquiring lock for the installation of Xamarin.GooglePlayServices.Maps 71.1610.1
Added file 'packages.config' to project 'myappname.Droid'.
Acquired lock for the installation of Xamarin.GooglePlayServices.Maps 71.1610.1
Installing Xamarin.GooglePlayServices.Maps 71.1610.1.
Removed reference 'Xamarin.GooglePlayServices.Maps' from project 'myappname.Droid'.
Completed installation of Xamarin.GooglePlayServices.Maps 71.1610.1
Successfully uninstalled 'Xamarin.GooglePlayServices.Maps 71.1610.0' from myappname.Droid
Removed package 'Xamarin.GooglePlayServices.Base 71.1610.0' from 'packages.config'
Added file 'packages.config' to project 'myappname.Droid'.
Removed reference 'Xamarin.GooglePlayServices.Base' from project 'myappname.Droid'.
Successfully uninstalled 'Xamarin.GooglePlayServices.Base 71.1610.0' from myappname.Droid
Removed package 'Xamarin.GooglePlayServices.Tasks 71.1601.0' from 'packages.config'
Added file 'packages.config' to project 'myappname.Droid'.
Removed reference 'Xamarin.GooglePlayServices.Tasks' from project 'myappname.Droid'.
Successfully uninstalled 'Xamarin.GooglePlayServices.Tasks 71.1601.0' from myappname.Droid
Removed package 'Xamarin.GooglePlayServices.Basement 71.1620.0' from 'packages.config'
Added file 'packages.config' to project 'myappname.Droid'.
Removed reference 'Xamarin.GooglePlayServices.Basement' from project 'myappname.Droid'.
Successfully uninstalled 'Xamarin.GooglePlayServices.Basement 71.1620.0' from myappname.Droid
For adding package 'Xamarin.GooglePlayServices.Basement.71.1620.2' to project 'myappname.Droid' that targets 'monoandroid90'.
For adding package 'Xamarin.GooglePlayServices.Basement.71.1620.2' to project 'myappname.Droid' that targets 'monoandroid90'.
Adding package 'Xamarin.GooglePlayServices.Basement.71.1620.2' to folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Added package 'Xamarin.GooglePlayServices.Basement.71.1620.2' to folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Added package 'Xamarin.GooglePlayServices.Basement.71.1620.2' to folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages' from source 'https://api.nuget.org/v3/index.json'
Added reference 'Xamarin.GooglePlayServices.Basement' to project 'myappname.Droid'.
Added package 'Xamarin.GooglePlayServices.Basement.71.1620.2' to 'packages.config'
Added file 'packages.config' to project 'myappname.Droid'.
Successfully installed 'Xamarin.GooglePlayServices.Basement 71.1620.2' to myappname.Droid
For adding package 'Xamarin.GooglePlayServices.Tasks.71.1601.1' to project 'myappname.Droid' that targets 'monoandroid90'.
For adding package 'Xamarin.GooglePlayServices.Tasks.71.1601.1' to project 'myappname.Droid' that targets 'monoandroid90'.
Adding package 'Xamarin.GooglePlayServices.Tasks.71.1601.1' to folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Added package 'Xamarin.GooglePlayServices.Tasks.71.1601.1' to folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Added package 'Xamarin.GooglePlayServices.Tasks.71.1601.1' to folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages' from source 'https://api.nuget.org/v3/index.json'
Added reference 'Xamarin.GooglePlayServices.Tasks' to project 'myappname.Droid'.
Added package 'Xamarin.GooglePlayServices.Tasks.71.1601.1' to 'packages.config'
Added file 'packages.config' to project 'myappname.Droid'.
Successfully installed 'Xamarin.GooglePlayServices.Tasks 71.1601.1' to myappname.Droid
For adding package 'Xamarin.GooglePlayServices.Base.71.1610.1' to project 'myappname.Droid' that targets 'monoandroid90'.
For adding package 'Xamarin.GooglePlayServices.Base.71.1610.1' to project 'myappname.Droid' that targets 'monoandroid90'.
Adding package 'Xamarin.GooglePlayServices.Base.71.1610.1' to folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Added package 'Xamarin.GooglePlayServices.Base.71.1610.1' to folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Added package 'Xamarin.GooglePlayServices.Base.71.1610.1' to folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages' from source 'https://api.nuget.org/v3/index.json'
Added reference 'Xamarin.GooglePlayServices.Base' to project 'myappname.Droid'.
Added package 'Xamarin.GooglePlayServices.Base.71.1610.1' to 'packages.config'
Added file 'packages.config' to project 'myappname.Droid'.
Successfully installed 'Xamarin.GooglePlayServices.Base 71.1610.1' to myappname.Droid
For adding package 'Xamarin.GooglePlayServices.Maps.71.1610.1' to project 'myappname.Droid' that targets 'monoandroid90'.
For adding package 'Xamarin.GooglePlayServices.Maps.71.1610.1' to project 'myappname.Droid' that targets 'monoandroid90'.
Adding package 'Xamarin.GooglePlayServices.Maps.71.1610.1' to folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Added package 'Xamarin.GooglePlayServices.Maps.71.1610.1' to folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Added package 'Xamarin.GooglePlayServices.Maps.71.1610.1' to folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages' from source 'https://api.nuget.org/v3/index.json'
Added reference 'Xamarin.GooglePlayServices.Maps' to project 'myappname.Droid'.
Added package 'Xamarin.GooglePlayServices.Maps.71.1610.1' to 'packages.config'
Added file 'packages.config' to project 'myappname.Droid'.
Successfully installed 'Xamarin.GooglePlayServices.Maps 71.1610.1' to myappname.Droid
Removing package 'Xamarin.GooglePlayServices.Maps 71.1610.0' from folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Maps.71.1610.0/build/MonoAndroid90'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Maps.71.1610.0/lib/monoandroid90'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Maps.71.1610.0/build'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Maps.71.1610.0/lib'.
Removed file 'Xamarin.GooglePlayServices.Maps.71.1610.0.nupkg' from folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Maps.71.1610.0'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Maps.71.1610.0'.
Removed package 'Xamarin.GooglePlayServices.Maps 71.1610.0' from folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Removing package 'Xamarin.GooglePlayServices.Base 71.1610.0' from folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Base.71.1610.0/proguard/MonoAndroid90'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Base.71.1610.0/build/MonoAndroid90'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Base.71.1610.0/lib/monoandroid90'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Base.71.1610.0/proguard'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Base.71.1610.0/build'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Base.71.1610.0/lib'.
Removed file 'Xamarin.GooglePlayServices.Base.71.1610.0.nupkg' from folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Base.71.1610.0'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Base.71.1610.0'.
Removed package 'Xamarin.GooglePlayServices.Base 71.1610.0' from folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Removing package 'Xamarin.GooglePlayServices.Tasks 71.1601.0' from folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Tasks.71.1601.0/build/MonoAndroid90'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Tasks.71.1601.0/lib/monoandroid90'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Tasks.71.1601.0/build'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Tasks.71.1601.0/lib'.
Removed file 'Xamarin.GooglePlayServices.Tasks.71.1601.0.nupkg' from folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Tasks.71.1601.0'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Tasks.71.1601.0'.
Removed package 'Xamarin.GooglePlayServices.Tasks 71.1601.0' from folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Removing package 'Xamarin.GooglePlayServices.Basement 71.1620.0' from folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Basement.71.1620.0/proguard/MonoAndroid90'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Basement.71.1620.0/build/MonoAndroid90'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Basement.71.1620.0/lib/monoandroid90'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Basement.71.1620.0/proguard'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Basement.71.1620.0/build'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Basement.71.1620.0/lib'.
Removed file 'Xamarin.GooglePlayServices.Basement.71.1620.0.nupkg' from folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Basement.71.1620.0'.
Removed folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages/Xamarin.GooglePlayServices.Basement.71.1620.0'.
Removed package 'Xamarin.GooglePlayServices.Basement 71.1620.0' from folder '/Users/rob/GitHub/mycompany-myappname-appv2/app/packages'
Executing nuget actions took 1.27 sec
Xamarin.GooglePlayServices.Maps successfully updated.