Site icon Android Tutorial Online

An Android Storage Access Framework document provider for rclone

RSAF

RSAF is an Android document provider for the wonderful rclone. It allows any app that supports Android’s Storage Access Framework (SAF) to access remote files via rclone’s backends.

RSAF is not itself a file manager, but any file manager supporting SAF, including the one built into Android (Settings -> Storage -> Documents), can make use of it.

Features

Limitations

File operation semantics

RSAF supports operating with either Android-like (default) or POSIX-like semantics.

With Android-like semantics, when creating, renaming, copying, or moving a file/directory, RSAF will add a counter to the filename to try and avoid conflicts (eg. file(1).txt) if the target path already exists. This matches the Storage Access Framework’s behavior for local files, though RSAF extends this to copying/moving instead of just file creation/renaming. However, this feature cannot be implemented in a completely foolproof way. If two client applications try to create files with the same name at the same time, they still might end up clobbering each other’s data, even with the added counter.

With POSIX-like semantics, RSAF follows the behavior of the underlying filesystem calls. It’ll behave more like common CLI utilities, such as mvcp, or even rclone itself.

Usage

  1. Download the latest version from the releases page. To verify the digital signature, see the verifying digital signatures section.
  2. Import an existing rclone configuration or configure one from scratch within RSAF.
  3. That’s it! The configured remotes are now available via the Storage Access Framework.

Permissions

The only permission RSAF requires is the INTERNET permission. It is used only to allow rclone to access the configured remotes.

RSAF does not and will never have ads or telemetry.

Verifying digital signatures

First, use apksigner to print the digests of the APK signing certificate:

apksigner verify --print-certs RSAF-<version>-<arch>-release.apk

Then, check that the SHA-256 digest of the APK signing certificate is:

b2506499bea1c5a6e658f07be6773fe486999dc124204c6522af7407503ac9f9

Building from source

Before building, the following tools must be installed:

Once the dependencies are installed, RSAF can be built like most other Android apps using Android Studio or the gradle command line.

To build the APK:

./gradlew assembleDebug

The APK will be signed with the default autogenerated debug key.

To create a release build with a specific signing key, set the following environment variables:

export RELEASE_KEYSTORE=/path/to/keystore.jks
export RELEASE_KEY_ALIAS=alias_name

read -r -s RELEASE_KEYSTORE_PASSPHRASE
read -r -s RELEASE_KEY_PASSPHRASE
export RELEASE_KEYSTORE_PASSPHRASE
export RELEASE_KEY_PASSPHRASE

and then build the release APK:

./gradlew assembleRelease

Android Studio

When loading the project in Android Studio, it might be necessary to build rcbridge once first:

./gradlew rcbridge

Even though AGP (Android Gradle Plugin) is set up so that rcbridge is a preBuild dependency of all Android-related components, Android Studio seems to have trouble syncing the gradle project if rcbridge’s .aar file doesn’t exist yet. There is no issue when building on the command line.

Dedication

RSAF is dedicated to my cat Meow-Meow, who unexpectedly passed away during the initial development of the project.

Contributing

Bug fix and translation pull requests are welcome and much appreciated!

If you are interested in implementing a new feature and would like to see it included in RSAF, please open an issue to discuss it first. This is a side project that I work on for fun, so I’m hesitant to add features I won’t personally use. I intend for RSAF to be as simple and low-maintenance as possible.

License

RSAF itself is licensed under GPLv3. Please see LICENSE for the full license text.

The bundled rclone is licensed under MIT.

GitHub

View Github

Exit mobile version