Hitesh Ghuge
Hitesh Ghuge

Reputation: 823

User permissions

I am new to android, I want to know whether android.permission.READ_EXTERNAL_STORAGE and android.permission.WRITE_EXTERNAL_STORAGE have default permissions ???

This is my manifest.xml file

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="com.sample.test" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:supportsRtl="true">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
</manifest>

But it still show <user-permission> as

Uses Permissions:

  1. android.permission.INTERNET
  2. android.permission.READ_EXTERNAL_STORAGE
  3. android.permission.WRITE_EXTERNAL_STORAGE

Defines Permissions:

  1. None

Is there any other way to define such permissions

I am using drozer to check vulnerability in my app Thanks.

Upvotes: 0

Views: 1422

Answers (2)

Tobias Uhmann
Tobias Uhmann

Reputation: 3037

Apps didn't need WRITE_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE in the past to access external storage. But that will change in the near future (see 'Caution' section in the referenced guide). So, previously apps were able to write to external storage by default. Also, WRITE_EXTERNAL_STORAGE includes READ_EXTERNAL_STORAGE so you don't need to obtain both.

Here's the relevant user guide: https://developer.android.com/training/basics/data-storage/files.html#GetWritePermission

So, for devices with API level 23 and later add the respective permission to your manifest:

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

Upvotes: 1

MalcolmMcFly
MalcolmMcFly

Reputation: 402

According to the documentation: A basic Android application has no permissions associated with it by default. See the section labeled Using Permissions.

Upvotes: 1

Related Questions