Android Manifest's android:exported="false" prevents app from running on device

24,246

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?

Share:
24,246
Hofuzz
Author by

Hofuzz

Updated on July 05, 2022

Comments

  • Hofuzz
    Hofuzz almost 2 years

    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>