嘿,伙计们,我做了一个WhatsApp状态保护程序。但是在android 11中,Google引入了作用域存储,所以我无法在应用程序中获得用户的状态。为此,我使用了MANAGE_EXTERNAL_STORAGE,但由于这个原因,我无法在Google中发布该应用。我见过很少有应用程序使用某种权限来授予使用.status文件夹的权限。怎么做?我已经附上了该应用程序要求的许可的屏幕截图。我是初学者,所以请帮帮我。

发布于 2022-05-21 21:48:34
请求用户向WhatsApp状态存储文件夹授予权限。
private void checkWhatsAppPermission(){
// Choose a directory using the system's file picker.
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
// Optionally, specify a URI for the directory that should be opened in
// the system file picker when it loads.
Uri wa_status_uri = Uri.parse("content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fmedia/document/primary%3AAndroid%2Fmedia%2Fcom.whatsapp%2FWhatsApp%2FMedia%2F.Statuses");
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, wa_status_uri);
startActivityForResult(intent, 10001);
}您可以在这里使用上述方法检查一个工作示例。https://play.google.com/store/apps/details?id=com.larntech.whatsappstatussaver
https://stackoverflow.com/questions/71223399
复制相似问题