Based on the discussion on the Golang issue tracker and the documentation for gobind, it should be possible to make external storage accessible for Syncthing.
From what I understand, the following should work:
- compile Syncthing with
gomobile bind
- create an implementation of
filesystem.go
in Syncthing that accesses Storage Access Framework APIs directly
I have been trying to implement this, but I can’t get step 1 (compilation with gomobile) to work.
$ gomobile bind -o out.apk github.com/syncthing/syncthing/cmd/syncthing
gomobile: binding 'main' package () is not supported
Does that mean we need to make a Syncthing package without a main() function?
It should also be possible to trigger the gomobile build directly from gradle (which is preferable), but that throws even weirder errors (gist link). Seems to be this open Golang issue.
So, what can we do to make this work?