Android: any reason not to run ST as root?

I am fairly ignorant about androids, but I’d like to use ST to sync between several Linux computers and three android devices. It turns out there are problems syncing multiple android devices ( https://github.com/syncthing/syncthing/issues/831#issuecomment-74564626 ) but one solution is to run syncthing as root in an Android, as suggested here ( Android frozen syncs ; I also want to thank Kahun for his advice on this issue).

However, before taking the plunge and rooting my devices, why would one not want to run ST as root in an Android device? I can only think of the following two reasons:

  • Having to root the android device with the risk of briking it, warranty issues, etc.

  • Once an android device is rooted, encryption of the whole device is not possible.

Am I missing something? In particular, running it as root in the Androids does not make the stuff in Linux computers (where ST runs as a regular user, of course) more vulnerable or exposed. And were the android device to be stolen, it would be about as vulnerable rooted or unrooted (except for the no-encryption-possible issue).

P.S. I’ve tried running st from a Linux on android, using Debian noroot (which does not require rooting). But I haven’t been able to because of problems with go.

Your second point is wrong, encryption is still possible.

The reason we don’t use root is general security, as the app could write anywhere and even delete system files by accident. Also, I personally don’t see the need for syncing as root, so I haven’t done anything there.

However, it would actually be quite easy to use root with the way we currently run the binary (just needs some minor changes). But in the future, we want use JNI to fix some problems, and that won’t work with root.

Ah, I thought I had read somewhere that, after rooting, encryption of the whole device was not possible. Good to know I am wrong.

Regarding the second point: the reason to run as root is to be able to keep two or more Android devices in sync, which currently has some problems (and I do have verified and experienced those problems myself) because of the mtime issue referred to in bug 831 mentioned above. So I was thinking about just rooting the device, and as root calling the app directly from /data/data/com.nutomic/lib/ and then accessing the web gui.

However, from your comment I understand that running as root is a dated approach (any idea how long? would the mtimes issue be fixed by then?).

Ask Google: http://code.google.com/p/android/issues/detail?id=18624 Assigned to jessewil...@google.com on Jul 20, 2011

I had missed that thread. Thanks. Reading through it, things do not look very hopeful. So wouldn’t this indicate that (at least for now), if we want to avoid having multiple android devices playing catch with each other, the only thing we can do is root the device and run ST as root?

Yes, or someone has to put in the effort to implement a workaround due to Google’s ignorance.

But then, wouldn’t it be wise to postpone using JNI (that Nutomic mentioned) until either Google fixes the problem or someone finds a workaround? I mean, it seems that running ST as root is the only viable way of using ST with multiple Android devices.

(OK, one could root the android device, and install a true linux distro there, and run ST from Linux, but that seems like unnecessarily adding another layer).

I don’t think JNI will help, as the bug is in the kernel. You can fix it by using a patched kernel. Some vendors ship with the patched kernel as standard.

I was referring to Nutomic’s sentence

So I was trying to say that the introduction of JNI would then definitively preclude anyone from having 2 or more Android devices use ST. Thus, it might be good to postpone using JNI that way.

We could actually do both, so you can either have non-root and (more) stable, or root and stability as it is now.

I think that would be great. I mean, for those who want to keep in sync more than one Android device there seems to be no other option but root.

@rdiaz02, an alternative occurred to me, that might allow non-rooted Android devices to sync: adopt a hub-and-spoke architecture, where the spokes would be the Android devices, and the hub any non-Android device.

So, for instance, given 2 non-rooted Android devices, and , and a non-Android device, N, and a folder F that you want to share from A¹ to A², you could:

  1. Sync F between A¹ and N
  2. Sync F between A² and N

Making sure, of course, that F maps to the same folder on N, both (1) and (2).

You’d introduce an extra hop between A¹ and A², but would be rid of the inter-Android mtime issue, and it would work with rooted and non-rooted Android devices.

Ooops, sorry, I should have updated or linked to this message. Actually, it is a lot simpler, and I added a short paragraph in the FAQ a while ago based on the suggestions provided in the long thread about issue 831 ( https://github.com/syncthing/syncthing/issues/831):

Basically, just leave things under Android/data/com.nutomic.syncthingandroid. No root needed.

(Now, that did work with the official ST android client, but it is also working with the new silk client. No idea why. I’ll ask this in the proper place: Unofficial OpenSilk Android Application).

1 Like