Activity exported=false listed in activity chooser

前端 未结 1 610
情话喂你
情话喂你 2021-01-03 04:14

I have two similar applications (one free, one paid).

An activity is defined with exported=\"false\"

    

        
相关标签:
1条回答
  • 2021-01-03 04:42

    I don't understand why the activity from the paid app appears, since it is exported="false"

    Because you have a matching <intent-filter>. Since you do not need the <intent-filter> for a non-exported activity, simply delete it and use an explicit Intent when starting this activity.

    why does the activity from the other app appear when the doc reads...

    I had the same question and was told that this was expected behavior and the bug is in our app for having a useless <intent-filter>. Quoting Dianne Hackborn:

    I would generally consider this a bug in the app -- if you have an activity that you aren't allowing other apps to launch, why the heck are you publishing an intent filter that they will match to try to launch? The security of the activity (whether it is not exported or requires a permission) is not part of intent matching. ...this scenario (publishing an activity that matches intents other applications will use but then restricting it to not be launchable by other applications) is not useful if not outright broken.

    0 讨论(0)
提交回复
热议问题