上传apk中的权限多于清单文件中的权限

时间:2015-09-18 08:01:15

标签: android permissions google-play android-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和网络访问权限。其他权限来自哪里?在应用程序中,我还使用了一些谷歌播放服务,如多人游戏和排行榜。我之前对该版本所做的唯一更改是一些版本更新(gradle,play-services,appcompat)和一些xml修改。

1 个答案:

答案 0 :(得分:5)

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

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

请点击此处了解如何操作: 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'