Android 13 的非 SDK 介面限制更新
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
基於與 Android 開發人員合作及最新的內部測試,Android 13 包含更新後的受限制非 SDK 介面清單。在限制非 SDK 介面之前,我們盡可能確保公開替代方案的可得性。
如果您的應用程式並不是以 Android 13 為目標版本,則此處所述的某些變更可能不會立即對您造成影響。雖然您目前可以使用某些非 SDK 介面 (視應用程式的目標 API 級別而定),但使用任何非 SDK 方法或欄位時,均可能面臨應用程式故障的高度風險。
如果不確定應用程式是否使用非 SDK 介面,可對應用程式進行測試以便確認。如果您的應用程式仰賴非 SDK 介面,則建議您開始規劃遷移至 SDK 替代方案。我們瞭解有些應用程式可使用非 SDK 介面運作。如果您除了為應用程式中的某個功能使用非 SDK 介面外,已別無他法,則應要求新的公用 API。
Android 13 的變更清單
Android 13 的清單變更屬於下列類別:
如需 Android 13 所有非 SDK 介面的完整清單,請下載下列檔案:
檔案:hiddenapi-flags.csv
SHA-256 總和檢查碼:233a277aa8ac475b6df61bffd95665d86aac6eb2ad187b90bf42a98f5f2a11a3
Android 13 中現已封鎖的非 SDK 介面
下列程式碼方塊列出 Android 12 (API 級別 31) 不支援的所有非 SDK 介面,這些介面在 Android 13 (API 級別 33) 中遭到封鎖。也就是說,這些介面屬於 max-target-s
清單,因此應用程式只能在指定 Android 12 (API 級別 31) 以下版本時使用這些介面。
我們的目標是在限制非 SDK 介面之前,確保公開替代方案的可得性。我們瞭解您的應用程式可能可使用這些介面運作。如果應用程式在舊版中使用的介面現在已在 Android 13 中遭到封鎖,您應要求該介面的新公開 API。
Landroid/app/Activity;->setDisablePreviewScreenshots(Z)V # Use setRecentsScreenshotEnabled() instead.
Landroid/os/PowerManager;->isLightDeviceIdleMode()Z # Use isDeviceLightIdleMode() instead.
Landroid/os/Process;->setArgV0(Ljava/lang/String;)V # In general, do not try to change the process name. If you must change the process name (for instance, for debugging), you can use pthread_setname_np() instead, though be aware that doing this might confuse the system.
Landroid/view/accessibility/AccessibilityInteractionClient;->clearCache(I)V # Use android.accessibilityservice.AccessibilityService#clearCache() instead.
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-08-27 (世界標準時間)。
[null,null,["上次更新時間:2025-08-27 (世界標準時間)。"],[],[],null,["Android 13 includes updated lists of restricted non-SDK\ninterfaces based on collaboration with Android developers and the latest\ninternal testing. Whenever possible, we make sure that public alternatives are\navailable before we restrict non-SDK interfaces.\n\nIf your app does not target Android 13, some of these changes\nmight not immediately affect you. However, while you can currently use some\nnon-SDK interfaces ([depending on your app's target API\nlevel](/guide/app-compatibility/restrictions-non-sdk-interfaces#list-names)),\nusing any non-SDK method or field always carries a high risk of breaking your\napp.\n\nIf you are unsure if your app uses non-SDK interfaces, you can [test your\napp](/guide/app-compatibility/restrictions-non-sdk-interfaces#test-for-non-sdk)\nto find out. If your app relies on non-SDK interfaces, you should begin planning\na migration to SDK alternatives. Nevertheless, we understand that some apps have\nvalid use cases for using non-SDK interfaces. If you cannot find an alternative\nto using a non-SDK interface for a feature in your app, you should [request a\nnew public API](/guide/app-compatibility/restrictions-non-sdk-interfaces#feature-request).\n\nList changes for Android 13\n\nThe list changes in Android 13 fall into the following category:\n\n- Non-SDK interfaces that were unsupported in Android 12 (API level 31) that are [blocked in Android 13](#new-blocked).\n\nFor a complete list of all non-SDK interfaces for Android 13, download the\nfollowing file:\n\nFile: [`hiddenapi-flags.csv`](https://dl.google.com/developers/android/tm/non-sdk/hiddenapi-flags.csv)\n\nSHA-256 checksum: `233a277aa8ac475b6df61bffd95665d86aac6eb2ad187b90bf42a98f5f2a11a3`\n\nNon-SDK interfaces that are now blocked in Android 13\n\nThe following code box lists all of the non-SDK interfaces that were unsupported\nin Android 12 (API level 31) that are blocked in Android 13 (API level 33). That\nis, these interfaces belong to the `max-target-s` list, so your app can only use\nthese interfaces if it targets Android 12 (API level 31) or lower.\n\nOur goal is to make sure that public alternatives are available before we\nrestrict non-SDK interfaces, and we understand that your app might have a valid\nuse case for using these interfaces. If an interface that your app uses in a\nprior version is now blocked in Android 13, you should [request a new public\nAPI](/guide/app-compatibility/restrictions-non-sdk-interfaces#feature-request)\nfor that interface. \n\n```\nLandroid/app/Activity;-\u003esetDisablePreviewScreenshots(Z)V # Use /reference/android/app/Activity#setRecentsScreenshotEnabled(boolean) instead.\nLandroid/os/PowerManager;-\u003eisLightDeviceIdleMode()Z # Use /reference/android/os/PowerManager#isDeviceLightIdleMode() instead.\nLandroid/os/Process;-\u003esetArgV0(Ljava/lang/String;)V # In general, do not try to change the process name. If you must change the process name (for instance, for debugging), you can use pthread_setname_np() instead, though be aware that doing this might confuse the system.\nLandroid/view/accessibility/AccessibilityInteractionClient;-\u003eclearCache(I)V # Use /reference/android/accessibilityservice/AccessibilityService#clearCache() instead.\n```"]]