首页 > 解决方案 > 在另一个应用程序中启动活动,并限制接收应用程序具有相同的签名

问题描述

我有两个应用程序 A 和 B。在某些时候,A 调用 startActivityForResult(),其 Intent 指向 B 中的活动(使用“action”属性)。这两个应用程序都将从 Google Play 下载并使用相同的证书进行签名。

由于将在 Intent 的数据中交换一些敏感信息,我想防止不良行为者替换应用程序 B 并安装具有相同包名称和操作属性的自己的版本,当 startActivityForResult() 被调用时,它将从应用程序 A 接收控制。

我知道如何确保仅从应用程序 A(自定义权限)调用应用程序 B,但我想知道,有没有办法确保当应用程序 A 类 startActivityForResult() 时,只有我的应用程序 B 会收到 Intent?

标签: androidpermissionsstartactivityforresult

解决方案


"installing his own version with same package name"

although playstore allows for apps to have duplicate names it enforces the uniqueness of any app package name. so this shouldnt happen.

moreover, you can use a custom action attribute name for starting B .

hope this is helpful for now .


推荐阅读