且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检查“验证应用程序"是否有效以编程方式启用或禁用

更新时间:2023-11-28 09:58:58

阅读首选项,不再有用,因为 android 现在不更新首选项.所以基本上阅读谷歌验证的首选项值是行不通的.

Reading preferences, won't help anymore as android don't update preferences now. So basically reading preferences value for google Verify won't work.

请使用以下 SaftyNet 回调来验证谷歌保护.

Please use below SaftyNet callbacks to verify google protect.

SafetyNet.getClient(context)
                .isVerifyAppsEnabled()
                .addOnCompleteListener(new OnCompleteListener<SafetyNetApi.VerifyAppsUserResponse>() {
                    @Override
                    public void onComplete(@NonNull Task<SafetyNetApi.VerifyAppsUserResponse> task) {
---
}
});