Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage Access Framework support #8

Closed
gilbsgilbs opened this issue Sep 14, 2019 · 4 comments
Closed

Storage Access Framework support #8

gilbsgilbs opened this issue Sep 14, 2019 · 4 comments
Assignees
Labels
Android SDK/NDK changes Required changes for newer Android versions ✨ Enhancement New feature or request
Milestone

Comments

@gilbsgilbs
Copy link

Hi,

I thought it would be useful should this app implemented the Storage Access Framework interface so that third-party apps could read/write files directly from/to the remotes through rclone.

Do you think it would be feasible? I could give it a try sometimes.

@x0b
Copy link
Owner

x0b commented Sep 15, 2019

Development for Storage Access Framework (SAF) support has been going on for over a year now, but has been slow because you need to bridge the java/kotlin environment of Android into the go environment for rclone. And both the design and implementation of SAF in Android have numerous flaws.

Anyway, I've spent a bit more time over summer on this issue. Part I of the SAF integration is close to ready and is planned for preview release in September. This will include a SAF client and a translation layer between SAF <==> rclone. With this, rclone can address SAF storage locations just like any other remote.

Part II however, a SAF DocumentsProvider, is still in a very early development phase. This is what's required to allow third party apps to access rclone remotes using Android SAF APIs.

Meta operations (list/delete/move/rename) are relatively easy to implement. Most problems currently revolve around retrieving and storing actual file bytes efficiently. And with my next semester starting soon, development effort will focus on maintenance rather than feature development.

You can see the current state in the wiki: RcloneExplorer 1.9 feature preview

@gilbsgilbs
Copy link
Author

gilbsgilbs commented Sep 15, 2019

Great @x0b, thanks. If you need any help, please let me know.

Edit: crap, I did not realize Android 10 drops support for file access through Linux API. This is so bad. Thanks Google I guess 😒.

@x0b
Copy link
Owner

x0b commented Sep 16, 2019

If you need any help, please let me know.

I appreciate the offer and may come back to it :).

Edit: crap, I did not realize Android 10 drops support for file access through Linux API. This is so bad. Thanks Google I guess 😒.

So technically this is not true - you can still use the Linux API to access your app-specific directories. You just can't use the API for anything outside of these locations, i.e. the API is useless to access user-visible storage.

For Android 10 at least, we can opt-out - but:

Warning: Apps will be required to use scoped storage in next year's major platform release for all apps, independent of target SDK level.

...meaning that on Android 10.1/Android 11, SAF integration needs to be ready regardless of Target SDK, so this is the hard deadline.

@x0b x0b self-assigned this Sep 16, 2019
@x0b x0b added the ✨ Enhancement New feature or request label Sep 16, 2019
@x0b x0b added this to the Future Version milestone Sep 16, 2019
@x0b x0b added the Android SDK/NDK changes Required changes for newer Android versions label Sep 16, 2019
@x0b x0b modified the milestones: Future Version, 1.9.0 Sep 30, 2019
@x0b x0b closed this as completed Oct 4, 2019
@x0b x0b modified the milestones: 1.9.0, Future Version Oct 15, 2019
@x0b
Copy link
Owner

x0b commented Oct 15, 2019

I'll reopen this since part II is not yet released.

Part I, the SAF client, has been released since 1.9.0 and can be used as described in the documentation

Update 2019-11-03: I've fixed a few major bugs with the VirtualContentProvider and it is slowly progressing towards a usable state. There's still a security review and clean-up to do, so it will probably take a bit of time until the next major feature update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android SDK/NDK changes Required changes for newer Android versions ✨ Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants