More Permissions in uploaded apk than in manifest file(上传的 apk 中的权限多于清单文件中的权限)

本文介绍了上传的 apk 中的权限多于清单文件中的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更新我的应用,但在上传后我注意到我在清单中没有提到其他权限:

I wanted to update my app but after uploading I noticed that there were additional permissions which I don't mention in my manifest:

android.permission.ACCESS_NETWORK_STATE
android.permission.GET_ACCOUNTS
android.permission.INTERNET
android.permission.READ_EXTERNAL_STORAGE
android.permission.USE_CREDENTIALS
android.permission.WRITE_EXTERNAL_STORAGE
com.google.android.c2dm.permission.RECEIVE

我的清单看起来像这样

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.stepscience.yahtzee" >

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/Theme.App" >
    <meta-data
        android:name="com.google.android.gms.games.APP_ID"
        android:value="@string/app_id" />

    <activity
        android:name=".StartActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <activity
        android:name="com.google.android.gms.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
        android:theme="@android:style/Theme.Translucent" />


</application>

我只使用 Internet 和网络访问权限.其他权限从何而来?在应用程序中,我还使用了一些 google play 服务,例如多人游戏和排行榜.我之前对版本所做的唯一更改是一些版本更新(gradle、play-services、appcompat)和一些 xml 修改.

I only use the permissions for Internet and Network access. Where do the other permissions come from? In the app I use also some google play services like multiplayer and leaderboards. The only changes that I made to the version before were some version updates (gradle,play-services,appcompat) and some xml modifications.

推荐答案

Google Play 服务正在添加一些权限.

Some permissions are being added by Google Play Services.

您可以通过仅包含您实际需要的组件来减少它添加的权限.例如 Google Cast、Google Drive 等

You can reduce the permissions it adds by only including the components that you actually need. e.g Google Cast, Google Drive etc

请参阅此处了解如何执行此操作:https://developers.google.com/android/guides/setup

See here for how to do that: https://developers.google.com/android/guides/setup

示例 gradle:

完整的播放服务

compile 'com.google.android.gms:play-services:7.8.0'

仅限游戏服务

compile 'com.google.android.gms:play-services-games:7.8.0'

这篇关于上传的 apk 中的权限多于清单文件中的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!