Closed pjhfggij closed 4 months ago
I couldn't figure out how to get service_account_file
to work, but following this forum post (where everyone somehow called this option differently) and with some chatgpt prompt (which incorrectly suggested writing json blob on multiline I've got it to work in this format:
[mydrive]
type = drive
scope = drive
service_account_credentials = {"type": "service_account","project_id": "your-project-id","private_key_id": "your-private-key-id","private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n","client_email": "your-service-account-email","client_id": "your-client-id","auth_uri": https://accounts.google.com/o/oauth2/auth,"token_uri": https://oauth2.googleapis.com/token,"auth_provider_x509_cert_url": https://www.googleapis.com/oauth2/v1/certs,"client_x509_cert_url": https://www.googleapis.com/robot/v1/metadata/x509/your-service-account-email}
I've reopened it, in case someone might know why service_account_file
didn't work?
service_account_file = /data/data/com.termux/files/home/.config/rclone/service-account-1.json
This doesn't work because Android does not allow apps to access the private data directories of other apps. There are 3 ways to handle this:
/sdcard
and enable RSAF's Allow local storage access
option. I wouldn't recommend this because it makes it too easy to inadvertently make your credentials file visible to another app./sdcard/Android/data/com.chiller3.rsaf/files/
. This makes the file only visible to RSAF and does not require additional permissions. However, the only way to put files in this directory is via USB (or root access).service_account_credentials
instead of service_account_file
like what you did.Oh of course, sorry I forgot about it, because Termux also shares it's files via "Storage Access Framework" and it always appears in the file picker. Thanks for explaining that.
That's tangential to the question, but do you know if there is any way to "mount" a folder shared via Storage Access Framework locally as a regular folder? That could also solve this issue without having to copy files. I'm struggling with this exact problem as well right now trying to get RSAF to work with music players, which don't have support for SAF?
No problem!
do you know if there is any way to "mount" a folder shared via Storage Access Framework locally as a regular folder?
It would be so much nicer if Android has some way of doing this, but unfortunately there's no way.
cool, thanks for confirming. indeed a shame. I'll have to piece together a custom pipeline in termux just to play me some music from google drive rclone lsf music: --max-depth 1 | shuf | while IFS= read -r i; do rclone cat "music:$i" | mpv -; done
How do you specify
service_account_file
field for RSAF? Normally it should point to a .json file, but due to differences in the way file systems work on android the normal path doesn't seem to work?e.g. this doesn't work: