ivehement / saf

Flutter plugin that leverages Storage Access Framework (SAF) API to get access and perform the operations on files and folders.
https://pub.dev/packages/saf
MIT License
17 stars 19 forks source link

A suggestion for simple usage #22

Open SampathNarayanan opened 1 year ago

SampathNarayanan commented 1 year ago

Writing to external directory is required for certain cases and it gives too much complexities in achieving this.

Play console does not allow apps to be published with "External manage" permissions, that is where SAF comes in.

Now, my suggestion is simple. Why don't API allow an external root folder in the name of Application ID i.e. com.MyApp which is already unique to that App. Just like "GetApplicationsDocumentsDirectory", there can be "GetApplicationsRootDirectory" which always gives a folder based application ID with full access only to that App with the same appication ID.

So any app from play store cannot access this folder (i.e. the security checking inside API can be made to achieve this). If possible attach the publisher's digital signature optionally to this.

This method has only one issue. If a develper creates an App with some one else's Application ID and don't publish but some how installs manually in user's phone. This is not an issue actually because the App has not come from play store , so don't bother about security issues.