Hello GrapheneOS community!
I am writing this post today because for the longest time I have wanted a good Japanese input method or keyboard that is also free software, or at least open source to use with GrapheneOS, and it seems that Japanese input is somewhat neglected since I have not found very many input methods/keyboards at all.
The only one that seemed particularly good to me (as a non-speaker) is Mozc for Android, I've used this even before I started using GrapheneOS, however, obtaining it for Android lately has been quite difficult.
Luckily I stumbled upon a blog post out in the wild of someone who managed to build a working APK from the F-Droid source code tarball!
https://blog.tlfoxhuman.net/2023/04/08/how-to-build-mozc-for-android
That post is in Japanese, but using a translator, I went ahead and tried to follow those instructions while making the following changes:
- I wanted to use the real github repo for Mozc, rolling back to the last commit that would allow me to build an APK file, rather than using the F-Droid source tarball
- I used the version of OpenJDK 8 from the ubuntu jammy repositories, the author's instructions involve installing a .deb from Azul
- The author downloaded an external version of guava and protobuf from maven for their build environment, I tried using the versions of guava and protobuf included/built from the Mozc repo, but had to use the version of protobuf they linked to in order for the build to succeed
I did make the APK build, made it build for arm64 (so I now have a 64-bit version yay!), signed it using my own keystore, and installed it onto my device.
However, you can no longer build the Mozc for Android APK using the most recent source, it was deprecated, probably to remove it as an alternative for their proprietary Google Japanese Input, aka Gboard. To build an APK, you need the source code from Feb of 2018 (!!), and upon opening Mozc for the first time I get a warning that it was made for an older version of Android, targetSdk/minSdk show as 23/14 respectively.
It's pretty clear that Mozc is not really meant to be used on modern versions of Android, in fact, the instructions from the blog post I linked above uses the following:
- OpenJDK 8 (from Azul)
- Guava 18.0 (2 vulnerabilities according to the author)
- Protobuf 3.5.0 (4 vulnerabilities according to the author)
- Python 2 (used in the build process)
So there could be security concerns involved in using this as well, nonetheless, it is one of the few open source Japanese input methods/keyboards available for Android, and in my opinion, pretty much the best despite its age, and functions perfectly well without network access, which is why I went ahead and made the effort to build, sign, and install it myself.
It also has a Godan keyboard layout that is only available via Mozc and Gboard AFAIK, it took some getting used to, but I grew to like it, it is a 15-key layout, in a 5 column by 3 row grid, the vowels on the leftmost column, and some consonants on the other two columns, the rest of the consonants available by flick gestures.
I don't know much about security on Android, so I'd like to know what the risks are in using this, how those risks can be mitigated, etc. I would also be glad to share the instructions for building it if desired, or discuss any other aspect relating to Mozc/Japanese input in general.