android - 在另一个应用程序中启动活动,并限制接收应用程序具有相同的签名
问题描述
我有两个应用程序 A 和 B。在某些时候,A 调用 startActivityForResult(),其 Intent 指向 B 中的活动(使用“action”属性)。这两个应用程序都将从 Google Play 下载并使用相同的证书进行签名。
由于将在 Intent 的数据中交换一些敏感信息,我想防止不良行为者替换应用程序 B 并安装具有相同包名称和操作属性的自己的版本,当 startActivityForResult() 被调用时,它将从应用程序 A 接收控制。
我知道如何确保仅从应用程序 A(自定义权限)调用应用程序 B,但我想知道,有没有办法确保当应用程序 A 类 startActivityForResult() 时,只有我的应用程序 B 会收到 Intent?
解决方案
"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 .
推荐阅读
- java - 在 QueryContext Oracle 的数字 varchar 字段中附加前导零
- wordpress - 在 bitnami 堆栈应用程序中缺少 Properties.ini 文件
- google-sheets - 将公式转换为数组公式
- spring - 如何使用 Spring boot 使用 Active Directory LDAP 只是为了找到一个用户,不需要对他进行身份验证
- android - 使用视图模型实现 Room,如何在 DAO 中获取查询的返回值。而不是 List<> 它只返回“CouroutineJob”
- jenkins - RE:从构建作业的发布操作更新部署作业中的选择参数而不构建它
- jmeter - JMeter 响应时间随时间推移太多用例
- excel - 单独列中的 Excel 重复查找器
- pandas - 根据条件 pandas 清理数据
- java - 如何使用来自自定义列表的 XDDFDataSource 值使用 Apache POI 创建饼图和条形图