com.google.android.recaptcha的sdk附注警告

原创文章
声明:作者声明此文章为原创,未经作者同意,请勿转载,若转载,务必注明本站出处,本平台保留追究侵权法律责任的权利。
全栈老韩
全栈工程师,擅长iOS App开发、前端(vue、react、nuxt、小程序&Taro)开发、Flutter、React Native、后端(midwayjs、golang、express、koa)开发、docker容器、seo优化等。

一、概要

当在Android应用中引入了recaptcha的sdk时,如果版本号过低,在提审到Android Google play的时候,会出现sdk的警告。警告中提出要更新sdk,为了应对Google play的审核,这个问题还是需要解决的,防止引起不必要的审核失败问题。

二、问题截图

recaptcha警告

A critical security vulnerability was discovered in reCAPTCHA Enterprise for Mobile. The vulnerability has been patched in the latest SDK release. Customers will need to update their Android application with the reCAPTCHA Enterprise for Mobile SDK, version 18.4.0 or above. We strongly recommend you update to the latest version as soon as possible.

三、分析

从截图中分析,这个问题是由recaptcha库的版本出现严重的安全漏洞所致。只要将版本号升至18.4.0及以上即可解决。

那么在有明确引入dependency的gradle中修改版本号,更新一下即可。

复制代码
// Add the following build rule to the dependencies section of your app-level build.gradle file:

implementation 'com.google.android.recaptcha:recaptcha:18.4.0'

// Make sure to use reCAPTCHA SDK version 18.4.0 or later.

而我的问题,确实并没有直接引入recaptcha,但是我的项目中引入了firebase-bom,而firebase-bom中就包含了recaptcha,所以这种情况,就需要升级firebase-bom的版本了。

四、解决

我的项目中firebase-bom的版本是

gradle 复制代码
implementation platform('com.google.firebase:firebase-bom:32.3.1')

改为:

gradle 复制代码
implementation platform('com.google.firebase:firebase-bom:32.8.0')

以上解决了我的问题,经过上传到google playd的内测轨道,没有recaptcha的警告了。

暂无评论,快来发表第一条评论吧