在清单中请求遗留外部存储权限 - Google Play 管理中心 5 月 5 日消息

Requestlegacyexternalstorage permission in Manifest - Google Play Console 5 May Message

我在我的开发者控制台中收到来自 Google 的消息。

Starting 5 May, you must let us know why your app requires broad storage access

We've detected that your app contains the requestLegacyExternalStorage flag in the manifest file of one or more of your app bundles or APKs. Developers with apps on devices running Android 11+ must use scoped storage to give users better access control over their device storage. To release your app on Android 11 or newer after 5 May, you must either:

  • Update your app to use more privacy-friendly best practices, such as the storage access framework or Media Store API
  • Update your app to declare the All files access (MANAGE_EXTERNAL_STORAGE) permission in the manifest file, and complete the All files access permission declaration in Play Console from 5 May
  • Remove the All files access permission from your app entirely

For apps targeting Android 11, the requestLegacyExternalStorage flag will be ignored. You must use the All files access permission to retain broad access. Apps requesting access to the All files access permission without a permitted use will be removed from Google Play, and you won't be able to publish updates.

我们应该怎么做才能遵守这项政策?如果我们不对 APK 进行任何修改会怎样?

我的应用程序的TargetSDK是29,这不是问题吗?如果我不做任何修改,我的应用程序会从 Google Play 中删除吗?

Google 说了什么?

a) “如果您的应用目标为 29 或更低,没问题。您无需进行任何修改,您可以继续使用 requestlegacyexternalstorage。对我们而言,重要的是,如果您的应用目标为 30(Android 11). 如果您的应用目标为 29 或更低,即使您不对清单进行任何更改,您的应用也会上线,但如果您想要目标为 30,则必须将其删除(并使用其他方法获得用户许可)”

b)“即使您的应用目标为 29 或更低,您也必须更改您的清单。从清单中删除 requestLegacyExternalStorage,否则我们将从 Google Play 中删除您的应用。”

哪一个是正确的? Google 说什么? a 还是 b?

如果b是正确的我该怎么办?我将此权限用于图库中的图像,而不是用于所有文件。

为了尽可能清楚,如果你的目标 sdk 版本是 API 29,你现在不需要做任何事情,但你必须在八月份做 - 11 月是在您的应用程序中更改此权限的最后期限,因为它也是针对 SDK 30 的强制性要求,如果您不想立即更改 sdk 和存储权限,现在请在您的清单文件中保留 requestLegacyExternalStorageflag = true .

硬截止日期是所有应用程序的 8 月至 11 月,因为届时所有应用程序都必须具有 targetSDK = 30,并且与此相关,change in the privacy policy on Android SDK 30 使得更改此权限是强制性的,这就是为什么它现在只是一个警告。但是,如果您现在什么都不做,您的应用程序将不会有任何变化,直到 8 月至 11 月。