停用 SafetyNet Attestation API
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
為了協助您安全拓展業務,Google 打造了多種工具來保護您的 Android 應用程式和遊戲不受濫用行為侵擾。面對日新月異的濫用手法,我們不斷地改進解決方案。為了兌現這個承諾,Google 在最近發布了 Play Integrity API。這個 API 整合了多種安全性保護措施,其中也包括 SafetyNet Attestation 完整性判定結果。
我們預計從 2024 年 1 月開始逐步停用 SafetyNet Attestation API。我們延長了停用期程,讓您有足夠時間遷移到新版 Play Integrity API,避免業務中斷。
Play Integrity API 不僅包含 SafetyNet Attestation API 提供的所有完整性信號,也具備其他功能,例如 Google Play 使用者授權,以及更優質的錯誤訊息傳送功能。這個全新 API 經過精心設計,可讓您輕鬆運用日後推出的功能,盡量縮短升級需要的建構時間。
SafetyNet Attestation 淘汰時間表
日期 |
里程碑 |
這對您的影響 |
2022 年 6 月 |
公告 |
您應盡快開始整合 Play Integrity API。在這段時間,您的應用程式將可繼續使用 SafetyNet Attestation API。 |
2022 年 11 月 |
淘汰資訊欄位 |
SafetyNet Attestation 回應新增了「deprecationInformation」欄位,其中包含開發人員適用的淘汰資訊。 |
2023 年 1 月 |
新開發人員的入門體驗結束 |
2023 年 1 月 31 日後,新使用者將無法再註冊 SafetyNet Attestation API,包括透過 SDK 註冊的新開發人員。 |
2024 年 1 月底 |
遷移期限 (期限延長) |
如果您已改用 Play Integrity API,SafetyNet Attestation API 便會繼續在您的舊版應用程式中執行,所以您仍能偵測這些版本中是否存在危險活動。如果您尚未遷移,SafetyNet Attestation API 將無法在您的應用程式 (包括先前版本) 中執行,還會傳回錯誤訊息。如果應用程式在正式版環境中呼叫 Play Integrity API,我們會認定您已完成遷移。 |
2025 年 1 月底 |
全面停用 (期限延長) |
任何版本的應用程式都將無法使用 SafetyNet Attestation API,並且會收到錯誤訊息。 |
設定應用程式來使用 Play Integrity API
建議您在淘汰計畫的第一年就改用 Play Integrity API,以免無法持續偵測應用程式是否有危險活動並對抗濫用行為。
這兩個 API 在概念上相似,因此若您已定義反濫用策略,並已開始使用 SafetyNet Attestation,遷移作業會相當簡單。您可以按照遷移指南的說明,立即透過 Play 管理中心設定 Play Integrity API。
如果您不是透過 Google Play 發行應用程式,仍可在 Google Cloud 控制台按照這些步驟使用 Play Integrity API。如此一來,您就不需要建立 Play 開發人員帳戶,也不必在 Google Play 管理中心發布版本。
SafetyNet Attestation 團隊將在 SafetyNet Attestation 回應中新增欄位 deprecationInformation
。新欄位包含淘汰相關資訊,提醒開發人員改用新版 Play Integrity API。這個欄位將從 2022 年 11 月 15 日起逐步發布。2023 年 1 月底前,所有 SafetyNet Attestation 回應都會顯示這個欄位。
取得協助與提供意見
我們會全力確保您的遷移作業順利進行。如有任何問題,請造訪 Play 管理中心的說明中心。
為了打造更優質的完整性服務,我們也希望聆聽您的想法,所以如果您有任何功能要求或意見,歡迎在 Play 管理中心告訴我們。您可以按一下 Play 管理中心右上角的問題圖示,然後在下拉式選單中點選「提供意見」。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2024-01-05 (世界標準時間)。
[null,null,["上次更新時間:2024-01-05 (世界標準時間)。"],[],[],null,["# About the SafetyNet Attestation API deprecation\n\nThe SafetyNet Attestation API was deprecated in 2022 and fully turned down in\nJanuary 2025. Developers should migrate to the [Play Integrity API](/google/play/integrity) that\nconsolidates multiple integrity offerings (including the SafetyNet Attestation\nintegrity verdict) under a single API.\n\nSetting up your app to use the Play Integrity API\n-------------------------------------------------\n\nWe recommend that you migrate to the Play Integrity API to avoid any disruptions\nin detecting risky interactions with your app and fighting abuse.\n\nThe two APIs are conceptually similar, so if you've already defined your\nanti-abuse strategy and were using SafetyNet Attestation, the migration is\nstraightforward. You can [start to set up](/google/play/integrity/setup) the Play Integrity API using your\n[Play Console](https://play.google.com/console/u/0/developers) now.\n\nSafetyNet Attestation API full turndown\n---------------------------------------\n\nIf you try to call the SafetyNet Attestation API, you will receive an error.\nThe [attest](https://developers.google.com/android/reference/com/google/android/gms/safetynet/SafetyNetClient#public-tasksafetynetapi.attestationresponse-attest-byte%5B%5D-nonce,-string-apikey) API returns a task that always invokes the [on\nfailure listener](https://developers.google.com/android/reference/com/google/android/gms/tasks/Task#addOnFailureListener(com.google.android.gms.tasks.OnFailureListener)) with an [ApiException](https://developers.google.com/android/reference/com/google/android/gms/common/api/ApiException) and a\n[status code](https://developers.google.com/android/reference/com/google/android/gms/common/api/ApiException#getStatusCode()) of 7 (`NETWORK_ERROR`). If you have released a\nversion of your app that uses the Play Integrity API, you should instruct your\nusers to update their app."]]