0

i am working on a xamarin forms App, using media storage for reading and writing a txt file. Sometimes i have scenario to access the file from external storage. I have a scenario where i have to create an txt file in a specific path. The issue is code runs without exception but file is not getting generated.

Meanwhile app got rejected saying that ,All access permission should be granted only when there is required.

This happens higher API versions i.e, API>=30, Attaching error report by google team.

""Policy: All Files Access Permission Files and directory attributes on a user's device are regarded as personal and sensitive user data subject to the Personal and Sensitive Information policy and the following requirements: https://play.google.com/console/u/2/policy-emails/developers/6665275664097267853?id=4979911108359167602 1/3 20/12/2021, 10:00 Play Console Apps should only request access to device storage which is critical for the app to function, and may not request access to device storage on behalf of any third-party for any purpose that is unrelated to critical user-facing app functionality. Android devices running Android "R" (Android 11) or later, will require the MANAGE_EXTERNAL_STORAGE permission in order to manage access in shared storage. All apps that target R or later and request broad access to shared storage ("All files access") must successfully pass an appropriate access review prior to publishing. Apps allowed to use this permission must clearly prompt users to enable "All files access" for their app under "Special app access" settings. For more information on the R requirements, please see this help article. Read more about Use of All Files Access Permission See Android storage use cases and best practices Address this issue in the Play Console.""

GrahamTheDev
  • 22,724
  • 2
  • 32
  • 64

2 Answers2

0

Like the error says; Android has specific rules in place to protect consumer devices from malicious apps. In controlled work environments when you have android devices managed using an MDM you can bypass this permission. However, for apps going to the app store, Google has to assume that you have bad intentions for every permission you enable. It's just to cover their backs.

Do you HAVE to save this file to a public location on the user's personal storage? If you prompt for permissions, you could instead save the file to the App folder using the System.SpecialFolder namespace.

Mark Barton
  • 847
  • 6
  • 15
  • I have to access a external file, that needs access to external storage right. What do we do i this case. – Suresh Mahendran Dec 22 '21 at 10:10
  • is the app intended to be a closed app that is going to be used inside of a business? if so, setup an MDM for all of the devices that are going to use this app, that way you can have full control over the entire OS. If the app is going to be public, you would be better off saving whatever data it is you are collecting to a database. From a security standpoint, you should never really need to save a file to a user's personal storage, because if you have write access, you also have read access. That's a security nightmare for general users and a pretty big misstep for consumer trust. – Mark Barton Dec 22 '21 at 10:47
0

Don't see a problem here, either explain (they have a section for this) in console why you require MANAGE_EXTERNAL_STORAGE or remove it and go with MANAGE_EXTERNAL_READ + MANAGE_EXTERNAL_WRITE.

Nick Kovalsky
  • 5,378
  • 2
  • 23
  • 50