←back to thread

397 points opengears | 2 comments | | HN request time: 0.567s | source
Show context
_fat_santa ◴[] No.41896183[source]
Looking at the underlying thread[1], the author mentions that it's very hard to publish on Google Play

> Reason is a combination of Google making Play publishing something between hard and impossible

Can someone expand on what's going on here?

[1]: https://forum.syncthing.net/t/discontinuing-syncthing-androi...

replies(3): >>41896256 #>>41896453 #>>41896704 #
izacus ◴[] No.41896453[source]
In this case the author doesn't want to use Storage Access Framework APIs to access the file system which were mandated a few years ago as the way to access data outside the app sandbox.

They're Java-only APIs and since Syncthings core isn't written in Java, the author would have to write JNI glue to call Android when writing/reading files (and honestly this would be quite tedious, because the way SAF works is to assign Uris to each file and you need to keep querying it to get folder structure since you can't just concat paths like with files).

The author didn't want to do that and tried to persuade Google to continue letting them access all files, all photos and all documents directly and Google said no. That was the "difficulty" - turns out it's really hard to publish on Play if you refuse to follow the guidelines. Just like on AppStore.

replies(5): >>41896541 #>>41896556 #>>41897277 #>>41897403 #>>41898485 #
pjmlp ◴[] No.41896541[source]
Many folks keep thinking that just because Android uses the Linux kernel, it is supposed to behave like GNU/Linux.

Likewise they will be rather surprised to insist in targeting iOS/iPadOS/watchOS as if they are UNIX clones.

replies(2): >>41897221 #>>41898032 #
bmicraft ◴[] No.41897221[source]
Android being linux has exactly nothing to do with the fact that apps can't access resources outside their sandbox if they aren't mapped in somehow. Just like with lxc or docker containers on linux, jails on *bsd, or any other sandboxes.
replies(2): >>41897312 #>>41897355 #
1. beeboobaa3 ◴[] No.41897355[source]
The point is you can't use the regular filesystem syscalls on android, it has to go through a weird java layer
replies(1): >>41898777 #
2. scottbez1 ◴[] No.41898777[source]
And perhaps more to the point - you USED to be able to use normal Java file apis and syscalls outside of Java, but that functionality has been gradually whittled away (in the name of legitimate security improvement) over the years, meaning "basic" IO functionality your apps relied upon could be taken away at any point and replaced by less ergonomic Java-only APIs with less functionality.

Fun fact: the official Dropbox Android app used to use inotify to watch for changes to the publicly writeable synced files in order to sync back to the cloud! Had to be replaced by java Storage Access Framework APIs later.

Another fun fact is that the Android sdk came with a JNI wrapper around inotify but it buggily stored inotify handles in a static (global, within an app vm) dictionary, meaning you'd silently lose tracking if you created more than one Java file watcher object that happened to be for the same path, so I had to rewrite that JNI wrapper back in the day to avoid that global state bug.