Android应用检查播放完整性不起作用
以前,我曾经通过安全网检查应用程序。然后,当通过电话号码登录时,错误此请求缺少有效的应用标识符出现了。我开始弄清楚它,并通过播放完整性阅读使用应用程序检查。 我开始尝试,错误是相同的。现在,我既不能打开游戏完整性,也不能关闭所有验证方法。错误是相同的。我阅读了论坛,做了所有设置和建议。这无济于事。请告诉我,这是否有更多的想法或成功的实践。
依赖项
implementation 'com.google.firebase:firebase-appcheck-debug:16.0.0'
implementation 'com.google.firebase:firebase-appcheck-playintegrity'
初始化
if (BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())
FirebaseApp.initializeApp(/*context=*/this)
val firebaseAppCheck = FirebaseAppCheck.getInstance()
firebaseAppCheck.installAppCheckProviderFactory(
DebugAppCheckProviderFactory.getInstance()
)
} else {
FirebaseApp.initializeApp(/*context=*/this)
val firebaseAppCheck = FirebaseAppCheck.getInstance()
firebaseAppCheck.installAppCheckProviderFactory(
PlayIntegrityAppCheckProviderFactory.getInstance()
)
}
所有签名已添加到FB项目(调试,发行,存储)SHA-1和SHA-256。
包括以下API:
- Android设备验证
- Firebase应用程序检查API
- Firebase安装API
- Google Play Integrity API API
- Intericatity Toolkit API
- 代币服务API
还有其他缺少的?
Previously, I used to check the application through Safety Net. Then, when logging in by phone number, the error This request is missing a valid app identifier came out. I started to figure it out and read that use the app check via Play Integrity.
I started trying, the error is the same. Now I can neither turn on Play Integrity, nor turn off all verification methods. The error is the same. I read the forum, did all the settings and recommendations. It didn't help. Please tell me if there are more ideas or successful practice in this.
Dependencies
implementation 'com.google.firebase:firebase-appcheck-debug:16.0.0'
implementation 'com.google.firebase:firebase-appcheck-playintegrity'
Initialization
if (BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())
FirebaseApp.initializeApp(/*context=*/this)
val firebaseAppCheck = FirebaseAppCheck.getInstance()
firebaseAppCheck.installAppCheckProviderFactory(
DebugAppCheckProviderFactory.getInstance()
)
} else {
FirebaseApp.initializeApp(/*context=*/this)
val firebaseAppCheck = FirebaseAppCheck.getInstance()
firebaseAppCheck.installAppCheckProviderFactory(
PlayIntegrityAppCheckProviderFactory.getInstance()
)
}
All signatures have been added to the FB project (debug, release, store) SHA-1 and SHA-256.
The following APIs are included:
- Android Device Verification
- Firebase App Check API
- Firebase Installations API
- Google Play Integrity API
- Identity Toolkit API
- Token Service API
What else is missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
对于Debug提供商,您需要运行该应用程序,它将在Info Channel上的登录中打印一个调试令牌 - 该令牌必须插入Firebase:build>应用检查> [应用程序包]> 3点菜单>管理调试令牌>添加您的令牌
请注意,对于每个应用程序安装/设备等,这个令牌可能会有所不同,因此它需要在firebase Console上为您的设备/团队
以firterity提供商提供更多令牌,您的应用必须在Play Store上发布(封闭的测试频道以进行初始化测试, ),并且必须与FB上的适当项目相连:repares>诚信>与项目联系。
您还应该注意签名指纹 - 如果您的应用在使用Google键签名时签名,则必须在Firebase上更新指纹
For debug provider you need to run the app, and it will print a debug token in logs on info channel - this token has to be inserted in Firebase: Build > App Check > [app package] > 3-dots menu > manage debug tokens > add your token
Mind, that this token may be different for every app install/device etc, so it will need more tokens on firebase console for your devices/team
For Integrity provider, your app has to be published on Play Store (closed test channel for init tests), and it has to be connected with proper project on FB: release > integrity > connect with project.
You should also pay attention to signing fingerprints - if your app is signed on publishing with Google key, you will have to update fingerprints on Firebase
安全网将继续工作一年。因此,临时解决方案将是继续使用安全网,直到API获得修复更新为止。根据Google发送给开发人员的电子邮件,关闭安全网的关闭日期为2024年6月30日,这些日期是在其应用程序中使用Safetynet的开发人员。
更新:我刚刚意识到使用Play Integrity的应用程序已经有效!您只需要从Play Store下载该应用即可。否则,它将不接受您的连接。您可以通过内部测试快速测试。此外,您仍然可以使用应用程序检查调试令牌对模拟器进行测试。
SafetyNet will keep working for a year. So temporary solution will be to keep using SafetyNet until the API gets a fix update. Turn off date for SafetyNet is June 30, 2024 based on email Google sent to developers which use SafetyNet in their apps.
Update: I just realized App Check with Play Integrity already works! You just need to download the app from Play Store. Otherwise it will not accept your connection. You can test quickly with Internal Testing. Additionally you can still test on emulator with App Check Debug tokens.
根据官方网站的说法,Firebase目前允许使用Play Store 分发的应用程序play Integrity API App check (链接)。
因此,如果您想在Firebase中使用应用程序检查Android,则有两个选项 - 上传您的应用程序播放商店或使用自定义应用程序检查提供商。
PS:可能可以在Firebase中集成Play Integrity API,用于使用自定义提供商通过Play商店分发的应用程序。
According to official site, Firebase currently allows Play Integrity API App Check only for apps distributed through Play Store (link).
So, if you want to use App Check for Android in Firebase, you have two options - either upload your app to Play Store or use custom App Check provider.
PS: It may be possible to integrate Play Integrity API in Firebase for apps that are not distributed through Play Store using custom provider.
您可能需要通过在播放控制台中启用play Integrity API来设置play Integrity API(请参阅官方文档)。
You probably need to setup the Play Integrity API by enabling it in the Play Console (see the details in the official documentation).
确保您使用的是Firebase依赖的更新版本,因为这些依赖项中的一些在引入Firebase App Check后进行了更新。实现此目标的最佳方法是使用 firebase android bom 从应用程序/build.gradle中的所有firebase依赖项中删除版本。要检查的另一件事是,您包括Firebase Console安装的最新Google -Services.json ->项目设置 - > Android应用。
关于在调试提供商中使用应用程序检查,请确保将所有测试/调试设备的调试令牌包括在Firebase控制台中。同样在我的上观点上,从依赖项声明中删除“:16.0.0”。
Make sure you are using updated versions of Firebase dependencies since some of these dependencies were updated after introducing Firebase App Check. The best way to achieve this is by using the Firebase Android BoM and remove versions from all Firebase dependencies in your app/build.gradle. Another thing to check is that you are including the latest google-services.json installed from Firebase console -> Project Settings -> Android App.
Regarding the use of App Check with the debug provider, make sure to include the debug tokens for all your test/debug devices into Firebase console. Also building on my previous point, remove the ":16.0.0" from the dependency declaration.