问题描述
当更新版本提交到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
不是已知符号。该代码已使用getCurrentActivity
和getApplicationContext
。
对于我们在React Native应用中进行纠正的最佳方法是什么,这是我们本机Java代码中的漏洞?
非常感谢您在这里的快速支持。谢谢!
解决方法
RazorPay发布了新版本。请点击以下链接以获取更多信息。
, ,https://github.com/razorpay/react-native-razorpay/issues/291
我们必须升级我们的react-native-share依赖性。在发行版中,不久前提到了一些安全补丁。升级到4.x后,我们不再接收来自Google的有关安全漏洞的电子邮件。