React Native意图重定向修复:检查恶意重定向的getCallingActivity等效于什么?

问题描述

当更新版本提交到Google Play商店时,我们被要求对我们的react本机应用程序进行更改。突出显示的问题是“意图重定向”漏洞。这是遗留代码,但是,总比没有好。

Google帮助guide中建议的一种方法是:

选项2:确保提取的Intent来自可信赖的来源。

您可以使用> getCallingActivity之类的方法来验证发起活动是否受信任。例如:

 // check if the originating Activity is from trusted package
 if (getCallingActivity().getPackageName().equals(“known”)) {
   Intent intent = getIntent();
   // extract the nested Intent
   Intent forward = (Intent) intent.getParcelableExtra(“key”);
   // redirect the nested Intent
   startActivity(forward);
 }

在按照本指南更改代码时,该版本显示错误,表明getCallingActivity不是已知符号。该代码已使用getCurrentActivitygetApplicationContext

对于我们在React Native应用中进行纠正的最佳方法是什么,这是我们本机Java代码中的漏洞?

非常感谢您在这里的快速支持。谢谢!

解决方法

RazorPay发布了新版本。请点击以下链接以获取更多信息。

https://github.com/razorpay/react-native-razorpay/issues/291

,

您可以尝试阅读本文档吗? https://static.googleusercontent.com/media/www.google.com/en//about/appsecurity/play-rewards/Android_app_vulnerability_classes.pdf

,

我们必须升级我们的react-native-share依赖性。在发行版中,不久前提到了一些安全补丁。升级到4.x后,我们不再接收来自Google的有关安全漏洞的电子邮件。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...