I tried building the syncthing-android apk locally using the instructions given @ https://github.com/syncthing/syncthing-android. All steps worked well and I was able to run syncthing successfully on 2 of my android phones. Both were using mobile data, and hence were not on the same LAN. However, they were not able to connect using the relay server either. Relay works fine when both these phones had google-play-store installed Syncthing.
My questions are the following:
Q1. Is it correct to assume, the community relay cluster supports only official downloads of syncthing executables?
Q2. If yes, could you help me with the details of what is the authorisation mechanism used to ensure such behaviour? This is so that I can emulate the same in my personal relay service.
It is, if itās not using the android build target. Which it should. Weāve talked about this before, Iām not sure why the Android build is done using the linux target.
I am a little confused. I understood that something special needs to be done here with go, but I have an added complication that go1.4 does not compile with macOS Sierra 10.12. (Reference link to the github golang issue). And we are using go1.4 as a submodule in syncthing-andriod.
I will try downloading the source for go1.7 and performing the syncthing specific build steps for android. Will post the result here soon.
Also, is it possible to make this android arm syncthing executable available for download on syncthing.net, like you have for all other OS and architecture combinations?
You should use Go 1.8.1 and nothing else. There is no reason to use the older versions. Then there are two ways to build binaries for Android using Go. One is to say āthis is a binary for androidā and the other is to say āthis is a binary for linuxā. The downside of doing the latter is that it then requires patches and crap which should not be needed in the first case. Those are the ones you may need to apply. But there is no need to involve an older Go compiler at any point.
I did this a while ago to show that itās simple to build for Android without patches and stuff:
It requires Linux, but you can actually install Docker on Mac if you like and do it there. Perhaps try that and report if it works.
Thatās odd[quote=āAudriusButkevicius, post:9, topic:9750, full:trueā]
We use go1.4 to bootstrap go1.8.1
[/quote]
Thereās no need to do this though, in general (I know there is a thing with some build host not allowing binaries to begin with). Go 1.8 can be bootstrapped by Go 1.8 just fine.
Thatās odd, but try a go run build.go without other parameters or environment variables first to make it generate the auto files. Then retry.
You are right, it was odd. I had git cloned syncthing in some other folder ($GOPATH/src/a/b). The build worked when I placed the project root @ $GOPATH/src/github.com/syncthing/syncthing.
The syncthing executable generated for arm was of 16MB. I used it in syncthing-android and voila, it connected to one of the relay servers.
Yeah, it needs to be in the magic place. Thatās Go for you. But thatās great, you might be the first in a long time to try a real android-targeted binary. Let us know if you run into any unusual weirdness.
Yes the process we use to build the Syncthing binary for Android is less than ideal. I tried to get it working with android-go some time ago, but didnt manage that. @samarth if you got this working, please make a PR
Also, the build script should automatically use your installed Go 1.8, but there might be a bug somewhere.
Definitely will create a PR. I was able to connect 2 android phones via relay, however they are not exchanging data. I can say they connected because I see a green āUp to dateā on the devices UI. Also, there is a successful joined relay log, that was missing in earlier so. Data not exchanging is almost certainly a problem with one of the phoneās (Samsungās) OS misbehaving, since, they did not exchange any data even after connecting them via LAN (same wifi router).
Will test it out with other handsets that usually work (non-samsung) first and then raise a PR.