newhinton / Round-Sync

An android cloud file manager, powered by rclone. Visit https://roundsync.com for more information!
https://roundsync.com
GNU General Public License v3.0
1.21k stars 48 forks source link

Folders cannot be shared/accessed via content provider preview #184

Open cjshearer opened 10 months ago

cjshearer commented 10 months ago

What version of Round Sync are you using (About -> App version)?

2.4.2-beta

What is your Android version, phone model and manufacturer?

Android 14, Pixel 7, Google

Which steps are required to reproduce this issue?

  1. Create a remote (I used onedrive)
  2. Enable Content Provider Preview
  3. Attempt to open/select a folder within your RoundSync remote through any other app (I tried Listen Audiobook Player and Obsidian).

I'll note - this doesn't happen when opening files in another app - that works fine. The issue seems to be related to folders.

Relevant logcat logs:

Also, Obsidian displayed an in-app error that shows the path to the folder it can't open. Comparing this with a URI that is known to be valid (extracted from the above logs of successfully attaching a remote file in Google Messages), it appears that part of the former, bad URI is being repeated?

# Error while attempting to open a remote folder as a vault in Obsidian
 Error: This path cannot be resolved: content://de.felixnuesse.extract.vcp/tree/rclone%2Fremotes%2Fonedrive%3A%2Fdocuments%2Fmy-notes/document/rclone%2Fremotes%2Fonedrive%3A%2Fdocuments%2Fmy-notes

# Path extracted from logs while successfully attaching a remote file to a message in Google Messages:
content://de.felixnuesse.extract.vcp/document/rclone%2Fremotes%2Fonedrive%3A%2Fconfig%2Frestore%20apps.txt

What is your configuration (rclone.conf)?

[5d44cd8d-397c-4107-b79b-17f2b6a071e8]
type = alias
remote = /storage/emulated/0

[onedrive]
type = onedrive
token = {"access_token":"..","token_type":"Bearer","refresh_token":"...","expiry":"2023-11-19T20:40:20.444454937Z"}
drive_id = ...
drive_type = personal

A note on rclone logs

I don't have root access, so I couldn't access the folder mentioned in the issue template for the rclone logs, although the logs tab/screen in the app didn't have any entries.

Does the same issue also occur when using the same configuration on a PC or in Termux?

n/a

leowankerddd commented 9 months ago

You should be able to access the log file if you plug your phone into your computer with a USB cable. You also need to manually turn on debug logging in settings.

Go here: Android/data/de.felixnuesse.extract/files/logs

99linesofcode commented 6 months ago

This also appears to be an issue for me on LineageOS 20, Android 13. The mounted remote shows up in apps such as Files but like Drive, the Round Sync remote is not visible from apps like Obsidian. Neither in the Open from.. sidebar under Google Docs with Declare as local provider enabled.

99linesofcode commented 6 months ago

As a workaround, I created two tasks to download and upload files added or remove from a local folder under /storage/emulated/0/.. or the remote. That shouldn't be too dissimilar to what Round Sync configured as a Content Provider does.

newhinton commented 6 months ago

@99linesofcode obsidian doesn't seem to support any other storage than local. Can you use it with anything else?

99linesofcode commented 6 months ago

@newhinton yeah that is probably intentional in order for them to push their Sync feature.

I'm not too familiar with how Android works let alone Content Providers but I've noticed that I can't always access the files from an app. For example:

Google Docs Screenshot_20240328-120042_Files~2

Whatsapp Screenshot_20240328-120113_Files~2

Content Provider Preview: enabled
Declare as local provider: enabled
Allow all apps to access your remotes: enabled
frallallove commented 2 months ago

I was able to connect my Blomp account with Roundsync. However, I don't see my files and I get an error when I try to upload any file. https://drive.google.com/file/d/10-uhon1GsMVuQJBKZgOSbvZrJ3zeD48j/view?usp=sharing

cjshearer commented 3 weeks ago

I'm not sure what RSAF does differently, but it works for me in some places where RoundSync doesn't.

newhinton commented 3 weeks ago

Generally speaking, the app (roundsync) is a very old codebase and in dire need of a rewrite. A lot of stuff that should work, doesn't, and implementing it is hard. Storage Provider generally should work, but it is not really tested. Sadly, i don't have the time or money to make the rewrite happen soon, although i will probably start with the core this year.