您好我想从我的应用程序禁用(删除)这些权限

时间:2017-10-11 04:12:12

标签: java android android-studio

您好我想从我的应用中禁用(删除)这些权限

写外部存储

http://localhost:4200/parent#/upload

并禁用相机和拍照 我的应用程序中的用户权限的源代码,我正在使用android studio。

这是新来源的来源?

    READ_EXTERNAL_STORAGE

    WAKE_LOCK

您好我想从我的应用中禁用(删除)这些权限

写外部存储

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.bpositive"
    android:versionCode="2"
    android:versionName="1.0.3" >
    <uses-sdk
        android:minSdkVersion="15"
        android:targetSdkVersion="25" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-feature
        android:name="android.hardware.camera"
        android:required="true" />
    <uses-feature android:name="android.hardware.camera.autofocus" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.VIBRATE" /> <!-- Permissions required for GCM -->
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />
    <permission
        android:name="com.bpositive.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />
    <uses-permission android:name="com.bpositive.permission.C2D_MESSAGE" />
    <application
        android:name="sample.bpositive.sparkleappz.app.BPlus"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme" >
        <activity
            android:name="sample.bpositive.sparkleappz.activities.SplashActivity"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="stateHidden" >
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data
                    android:host="sparkleappz.com/"
                    android:scheme="http" />
                <data
                    android:host="sparkleappz.com/"
                    android:scheme="https" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="sample.bpositive.sparkleappz.activities.MainActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="stateHidden" >
        </activity>
        <activity
            android:name="sample.bpositive.sparkleappz.activities.ResetPasswordActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="stateHidden" >
        </activity>
        <activity
            android:name="sample.bpositive.sparkleappz.activities.DonateActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="stateHidden" >
        </activity>
        <!--
             The API key for Google Maps-based APIs is defined as a string resource.
             (See the file "res/values/google_maps_api.xml").
             Note that the API key is linked to the encryption key used to sign the APK.
             You need a different API key for each encryption key, including the release key that is used to
             sign the APK for publishing.
             You can define the keys for the debug and release targets in src/debug/ and src/release/.
        -->
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/google_maps_key" />
        <service android:name="sample.bpositive.sparkleappz.MyFirebaseMessagingService" >
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
        <service android:name="sample.bpositive.sparkleappz.MyFirebaseInstanceIDService" >
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>
        <activity
            android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
            android:theme="@style/Theme.AppCompat.Light.DarkActionBar" /> <!-- Include the AdActivity and InAppPurchaseActivity configChanges and themes. -->
        <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent" />
        <activity
            android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
            android:theme="@style/Theme.IAPTheme" />
        <activity
            android:name="com.google.android.gms.appinvite.PreviewActivity"
            android:exported="true"
            android:theme="@style/Theme.AppInvite.Preview" >
            <intent-filter>
                <action android:name="com.google.android.gms.appinvite.ACTION_PREVIEW" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.google.android.gms.common.api.GoogleApiActivity"
            android:exported="false"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
        <!--
 FirebaseMessagingService performs security checks at runtime,
             no need for explicit permissions despite exported="true"
        -->
        <service
            android:name="com.google.firebase.messaging.FirebaseMessagingService"
            android:exported="true" >
            <intent-filter android:priority="-500" >
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
        <receiver
            android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
            android:enabled="true"
            android:exported="false" >
        </receiver>
        <receiver
            android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
            android:enabled="true"
            android:permission="android.permission.INSTALL_PACKAGES" >
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>
        <service
            android:name="com.google.android.gms.measurement.AppMeasurementService"
            android:enabled="true"
            android:exported="false" />
        <receiver
            android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                <category android:name="com.bpositive" />
            </intent-filter>
        </receiver>
        <!--
 Internal (not exported) receiver used by the app to start its own exported services
             without risk of being spoofed.
        -->
        <receiver
            android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
            android:exported="false" />
        <!--
 FirebaseInstanceIdService performs security checks at runtime,
             no need for explicit permissions despite exported="true"
        -->
        <service
            android:name="com.google.firebase.iid.FirebaseInstanceIdService"
            android:exported="true" >
            <intent-filter android:priority="-500" >
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>
        <provider
            android:name="com.google.firebase.provider.FirebaseInitProvider"
            android:authorities="com.bpositive.firebaseinitprovider"
            android:exported="false"
            android:initOrder="100" />
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
    </application>
</manifest>

并禁用相机和拍照 我的应用程序中的用户权限的源代码,我正在使用android studio。

这是什么新来源?

3 个答案:

答案 0 :(得分:2)

您的文件中有一行显示

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

和一个读

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

如果删除它们并重新运行gradle,您的项目现在将不再拥有这些权限。

答案 1 :(得分:0)

中删除此行
  

的AndroidManifest.xml

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

删除权限

答案 2 :(得分:0)

如果权限对于工作或触发用户交互至关重要,例如触摸相机按钮以调用相机并需要相机权限,则您无法删除权限并希望您的应用正常工作。如果该应用需要您删除这些权限的权限,则会出现错误,尤其是针对具有android:targetSdkVersion="25"的Android 6.0以上的应用定位。

如果您希望使用JUST RESKIN发布该应用,则会因为发布垃圾内容应用而获得罢工。您应该对该应用程序进行一些修改,以将其视为已修改的工作。无论您是否被允许,您还应该检查licanse的许可证。