Reputation: 469
Good day,
In my simple Andorid app which is really just a webview app, I added android:exported="false"
in Android Manifest to avoid the Exported service without permissions
warning / vulnerability. However when I run it on my device it would give App is not installed
error, unless I change it to android:exported="true"
, then the app would launch fine on my device.
I then tried to add a permission tag as follows to avoid the "Exported service without permissions" warning but the app would not run again. What would be best to have the app running correctly? I don't really need to export any service. The internet permissions is for some annotation links in my app which would open in an external browser.
Sorry if I'm missing something basic as I'm new to Android development, thanks for any pointers.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package=com.mymundane.app">
<uses-permission android:name="android.permission.INTERNET" />
<permission android:name=com.mymundane.app.mypermission"
android:label="mypermission" android:protectionLevel="signature">
</permission>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label=com.mymundane.app"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:fullBackupContent="@xml/backup_descriptor">
<activity android:name=com.mymundane.app.MainActivity"
android:exported="true" android:screenOrientation="portrait"
android:permission=com.mymundane.app.mypermission">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Upvotes: 34
Views: 60685
Reputation:
Since this is the first thing that pops up on Google when searching "android:exported = false meaning", its worth mentioning that the statement from the most upvoted answer:
So if you have "exported=false" on an Activity, no other app, or even the Android system itself, can launch it. Only you can do that, from inside your own application
is wrong.
According to the Android <activity> documentation:
If
exported="false"
, the activity can be launched only by components of the same application, applications with the same user ID, or privileged system components. This is the default value when there are no intent filters.
The exported
tag prevents a (non-system) launcher from launching the activity. However, it is wrong to state that exported="false"
stops the component from being started from anything that is not the application itself. This is particularly important when it comes to system manifest broadcasts (e.g. BOOT_COMPLETED
). Boot broadcast receivers will still activate even if exported="false"
.
Upvotes: 5
Reputation: 11
You uploaded an APK or Android App Bundle which has an activity, activity alias, service, or broadcast receiver with intent filter, but without the 'android: exported' property set. This file can't be installed on Android 12 or higher. See: developer.android.com/about/versions/12/behavior-changes-12#exported
for better experience read the official android doc. https://developer.android.com/about/versions/12/behavior-changes-12#exported
Note: sometimes this error occurred when you are using old payUMoney SDK. so replace this with payUcheckout pro SDK then your problem is solved.
thank you.
Upvotes: 0
Reputation: 7928
The "exported" attribute describes whether or not someone else can be allowed to use it.
So if you have "exported=false" on an Activity, no other app, or even the Android system itself, can launch it. Only you can do that, from inside your own application.
So settings "exported=false" on the Activity marked as the LAUNCHER Activity would basically tell the system that it cant launch your application, ever.
As for the error you mentioned, i don't see any services in your manifest? Where is that warning shown for you?
Upvotes: 80