Please help Ukrainian armed forces! Official Fundraising

How to fix Android warning: Exported activity does not require permission

1 1 1 1 1 How to fix Android warning: Exported activity does not require permission5.00Rating 5.00 (534 Votes)

Go to your project and open Android Manifest file. Lets assume that your manifest file contains an activity that has the details as follows

<activity 
  android:name=".MainActivity">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <data android:scheme="http" android:host="example.com" />
    </intent-filter>
</activity>

Add the following lines as shown below.

<activity
android:name=".MainActivity"
android:exported="false">
<intent-filter>

         <action android:name="android.intent.action.MAIN" />
         <data android:scheme="http" android:host="example.com" />

    </intent-filter>
</activity>

Wonder why we did this? Well… It means that other (arbitrary) applications the user has on his phone can bind to your Service and call whatever method they please that is exposed through your AIDL interface.

Source: http://syedasaraahmed.wordpress.com/2012/09/27/android-warning-exported-activity-does-not-require-permission/

You have no rights to post comments

Friday the 1st.