android - Android - SafetyNet 安全浏览 API
问题描述
只是试图在 Android 应用程序中实现 SafetyNet 安全浏览 API 并阅读以下文档:https ://developer.android.com/training/safetynet/safebrowsing.html但我无法参考SafetyNet class
例如:他们在文档上说:
要使用安全浏览 API,您必须通过调用 initSafeBrowsing() 来初始化 API 并等待它完成。以下代码片段提供了一个示例:
Tasks.await(SafetyNet.getClient(this).initSafeBrowsing())
我已经搜索了这个 API 库来引用SafetyNet
类对象,但我无法引用它。
我试图添加我的 build.gradle :
implementation 'com.google.apis:google-api-services-safebrowsing:v4-rev20190923-1.30.3'
和
apply plugin: 'com.google.gms.google-services'
但仍然找不到那个类。
任何人都知道如何实现这个 lib 助手?
解决方案
好的,这样的业余错误:D .....
代替
implementation 'com.google.apis:google-api-services-safebrowsing:v4-rev20190923-1.30.3'
我应该使用
implementation 'com.google.android.gms:play-services-safetynet:17.0.0'
但是他们没有在官方文档中提到这一点:D,希望在有时感到困惑时对任何人有用
推荐阅读
- python - python包的汇总统计
- c# - 使用 SMB 协议从 WebJob 访问 Azure 文件存储
- amazon-web-services - Chef checking log file size
- mysql - MySQL - CAST json extracted data as time
- uwp-xaml - Make Canvas/Grid with transparent area for underneath element
- swift - Dynamically check if an object supports dynamic member lookup
- python - 如何在 TF 网站中设置 TensorFlow Serving?
- python - 如何重新排序字典的动态字符串键以将其保存到 JSON
- swift - How to reflect the new section to UICollectionView in RxDataSource?
- java - How to detect the execution time of StopWatch guava?