-
Notifications
You must be signed in to change notification settings - Fork 428
Shared folders are read-only on sd card (<29) and inaccessible on all ext. storage (>=29, ~November 2020) #29
Comments
I'll need a logcat for that. Unfortunately, I don't have an external sd card to test with myself. |
I'll try to do that when I get chance. I don't suppose you can point me to some instructions how to get the log? Not much of an Android expert. |
Incidentally I think this article pretty much explains the issue: http://www.androidcentral.com/kitkat-sdcard-changes |
I searched around, and it really seems there is no way to write to external sdcard without root. But I will add a directory chooser for repo creation in #5, and might add the external app dir to that. |
This should work with the new |
So is that new method already in the commits or is that coming down the pipes still? |
Nope, not implemented yet. The above API only works on Android L (though it might come via support library), so I'll have to check which folders are writeable on external sdcard on older APIs. |
It's worth noting that PowerTools is able to sync to folders in the emulated SD card. No idea how it does it but I've got it working just fine on my Nexus 4 (android 4.4) |
Okay I researched this a bit further:
Of all these, option 3 seems to be the best, assuming it is accessible through support libraries. Otherwise, we might have to implement all three. Edit: Looks like Context.ACTION_GET_CONTENT and Context.ACTION_OPEN_DOCUMENT would be even better (those would replace the folder chooser, but on 4.3 and lower, a seperate file browser app would be needed). |
At least you can switch to the WebUI and enter the paths manually. Since the majority of devices are not running 4.4 they are unaffected by Google's boneheadedness it's be nice if the path picker could navigate anywhere around the filesystem. |
I plan to remove the internal file chooser and use external file browser using the intents in the edit above. The only disadvantage is that it won't work if the user has no file browser installed (on 4.3 and lower). So maybe the internal file chooser should be kept as a fallback for that. I'll look into that. |
I don't know of any ROM that can't satisfy the file chooser intent, even On 4 July 2014 18:42, Felix Ableitner notifications@github.com wrote:
|
I'm pretty sure Android 4.3 and below doesn't have any file browser by default. |
I don't know about AOSP but many manufacturer ROMs and CM do. But it needs On 4 July 2014 22:43, Felix Ableitner notifications@github.com wrote:
|
Yeah I'll do a test release first once I have it implemented. |
OK this won't work as well as I thought, because the DocumentsProvider returns an URI, and there's no general way to get file path from that. @calmh Would it be possible to specify the repository folder as an URI? |
Can't you also use specific folders on on sd card? I'm not sure at this moment but something like this: com.exampleappname.subapp |
Right, but it would be better if we could also write to sdcard root (and I'm not quite sure how to get that path in Java). |
@Nutomic What would we then do with the URI? We need a path... |
At least Java can perform normal file operations on an URI using File. Maybe this is also somehow possible in Go. Edit: The URI points to a local directory where we have full read/write permissions. |
Sounds like we could just strip any leading |
That's what I tried basically, but Android uses its own URIs, they look like So we'd really have to access it through the URI. |
What we have available is a file system. If the URI can be mapped to a local directory as you say, we can write to that local directory. Accessing the URI as is would require going through some API, I guess, which sound like something that would need to happen Java-side or wherever. |
Ok so I guess I'll have to see myself how this could be done. Or I might open an issue on golang for Android URI support (as part of general Android support). |
This does not currently work, because golang does not support using URIs as files, and we can't convert the URIs to paths.
Would really appreciate it if you could find a workaround for this STUPID google decision. All of the stuff I want to sync is on my SD card! Who stores media in their main memory? |
Samsung removed it only from UI. But you can convert it using adb. Don't want to advertise here, just google 'Samsung S7 adoptable storage'. Probably same for others. |
I've used adoptable storage on a near stock device (Moto X Style/Pure), so I don't know how it is on Galaxy S7. That way, Syncthing can write to sd card without problems. As you seem to have to have an S7 and used that method, why don't you try it and confirm for us if it works. |
I've not used it (yet). Just discovered that it's possible to enable 'adoptable storage'. Since it'll erase everything on SD card I need to be ready for this. In any case thanks for confirmation that syncthing works with adoptable SD card. |
On the Samsung Galaxy Note 4, using |
I used a 64GB card in my 32GB phone. But as the system and Apps are still on the phone memory, my usable space more than tripled. |
What I find to be really strange is that I used to run syncthing silently in the background on my rooted Samsung Galaxy S3, it synced all my preferred external sdcard directories without a glitch for months, never an issue. Now android has 'upgraded' and syncthing doesn't do that anymore? What a sad sad way to go for android. Really, have they killed such basic functionality in favor of security theatre, or what's the reason for this change? |
@jult That kind of thing is outside the scope of this issue. :-/ Here we're just trying to figure out how syncthing should handle the current situation, regardless of why it came about. |
@jult That's an old device, what Android upgrade did you make? |
@jult Yes, security theatre obscure. Isn't it quite interesting, that google phones doesn't come with an sd card slot, hence their users don't have this problem... This is further obscured, that the choice of implementing syncthing in go is the major blocker in this respect. Needless to say, that go is a - google innovation - too. This is a perfect recipe for damaging the last remains of a good reputation. |
There was a post on the forum with an idea how this could be solved, but afaik no one is working on this. Some related discussion is in #1008. |
Syncthing 0.10.6+ supports sdcard write access when root privs are granted. |
@Catfriend1 Why dont you port your patch upstream (this) or make a little tutorial? |
@lkwg82 It should not basically be needed to patch the os deeply to just run this app. Its much easier and common to use root. It is a PR for for the original tingle already. There is an explanation how it works. |
@Catfriend1 I'd vote to keep this issue open. The current solutions are for rooted and for very advanced users only. Having a synchronization tool run for the "ordinary" user should not require any such things. Therefore I still think that this issue is still open. My benchmark here is: it still doesn't work on my dad's phone, who I neither will root nor patch his OS :-) |
Sorry, I don't see a reason why this was closed in the first place. Sure, it works with root, but that's a workaround, not a solution. |
PR #1170 has the new SAF UI that will guide users on newer Android os to a supported, "no-root requiring" path on their external sdcard to create a readwrite share folder. |
Hmm the issue should stay open but honestly will never be totally fixed... |
Sure, that doesn't mean the issue does not exist. |
Status update (please correct if I got anything wrong): It looks like this problem will become even more urgent, as currently it looks like google will pull trough on introducing scoped storage in SDK 29, which is planned to become mandatory in the play store by November 2020. This means Syncthing can only access files it created itself or that resides in it's "own dir" (some directories in deeply-nested structures like |
For everyone brought here in 2020: The current discussion about Android 11 being expected to be the first version since 4.4 supporting writing to sdcard again is here: https://forum.syncthing.net/t/android-11-all-files-access-for-the-syncthing-app |
As mentioned above the restrictions have changed, such that on Android >= 11 Syncthing can now write to SD cards. This issue was thus fixed by #1721 which made use of this new policy, and that was released in https://github.com/syncthing/syncthing-android/releases/tag/1.19.0. |
SyncThing works great for repositories created on the internal SDCard. However if I try to create a rep on my external SDCard it doesn't complain. The other node attempts to sync & just shows sync progress set at 0%.
I'm running Android 4.4.2 on a GS4 & I know external SD card access for apps got restricted more since 4.4 but I think SyncThing is one of those apps where it makes complete sense to have ext SD access.
In the short term perhaps SyncThing for Android could complain if ext SD card access is not an option?
The text was updated successfully, but these errors were encountered: