door in the open

Mobile Wormhole

2021-02-13

Magic-Wormhole is a command-line tool for sending and receiving files between two computers. You invoke:

$ wormhole send FILE

…and you will be presented with a code that you tell the receiver who can then invoke:

$ wormhole receive CODE

…and the (encrypted) file transfer begins. This is not only easy (if you are not afraid of the terminal, that is), but it can also be pretty fast because Magic-Wormhole will try to establish direct connection between clients; e.g. when we are sending files at home, the speed is about 15-20 MB/s. To make it explicit, I am a happy user of Magic-Wormhole.

A bit more of background info is that I am (willingly) running LineageOS on my phone which means there is no sync of files with my computer backed by Google. So whenever I want to, e.g., send some photos from my phone to my computer, I used to send a message to myself on some chat. This worked, but it was not ideal: first, because chats tend to downgrade the image quality, but more importantly, once you go down the path of trying to only use FOSS and avoiding reliance on big tech companies, you always want to make yet another step on that path.

So now that I had created a problem for myself, I tried to solve it. Luckily for me, Magic-Wormhole is written in Python. Also I knew, and had been curious, about Kivy, a Python framework for mobile development. Now after having worked with Kivy, I have mixed feelings about it; on one hand, I appreciate all the effort that went into making Python run as an Android activity, the ability to use Java classes and methods from that Python activity and thus interact with the Android, the packaging of all that into an APK, and the nice tooling around this packaging. I did not have to deal with Java apart from reading short snippets in the Android developer docs and I could happily get away with using my favourite Vim instead of Android Studio. On the other hand, there is some strange unwillingness in the Kivy community to accept outside contributions, I have a couple of PRs open that will soon celebrate their first birthdays and I still have no feedback about what is wrong there. I do not think it is anything personal, there are other people who have tried to make an occasional contribution and who are similarly not paid attention to. No grudges held, of course, it is an open source project and all. At the end of the day, Kivy did the job.

TL;DR, I made a mobile client for Magic-Wormhole. The source code is on GitHub, where you could also directly download the APK. The app is on Google Play, but, unfortunately, I could not make it build for F-Droid; ironic, because guess which one I am using. The app is ugly, but it works, you can send and receive files and that is all that there is to it.