android - Activity 选择器中列出的 Activity 导出 = false

标签 android android-intent android-activity android-manifest android-implicit-intent


Activity 是用 exported="false"

        android:noHistory="true" >
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="" />

当我从免费应用中使用适当的隐式 Intent 调用 startActivity 时,会出现 Activity 选择器。

我不明白为什么会出现来自付费应用的 Activity ,因为它是 exported="false"

我想我可以根据 URL 添加一个 Intent 过滤器,但我的问题是:为什么在文档读取时会出现来自其他应用的 Activity

Whether or not the activity can be launched by components of other applications


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

因为你有一个匹配的 。由于非导出 Activity 不需要 ,因此只需将其删除并在启动此 Activity 时使用显式 Intent

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

I had the same question并被告知这是预期的行为,错误在于我们的应用程序中存在无用的 。引用 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.

关于android - Activity 选择器中列出的 Activity 导出 = false,我们在Stack Overflow上找到一个类似的问题:


android - 在 Firebase onDataChange 中返回一个值

android - 相当于Android开发者的printf?

java - 为什么android.database.DatabaseUtils不抛出诸如SQLException之类的异常?

android - "Link with editor"在安卓工作室

java - 在 Activity 之间放置和获取 DoubleArray 值

android.os.TransactionTooLargeException "viewPager.setAdapter(adapter)"

android - 项目没有 文件

android - 在 Activity 之间传递处理程序

java - 即使在实现 onSaveInstanceState() 和 onRestoreInstanceState() 方法后也无法保存我的 Activity 状态

android - 版本更新后许可证检查器崩溃