Open-source project
osfans/trime avatar
osfans/trime

Trime: the Android Rime frontend whose build patches librime before Gradle runs

Tongwen Android Input Method Platform 3.x / Android-rime / Rime Input Method Engine for Android.

4,814 stars570 forksKotlinGPL-3.0

At a glance

What is it?
Trime puts the Rime engine under an Android input method through JNI, and its Makefile carries the parts a plain Gradle build skips: a patch step, a style gate and a traditional-to-simplified translation rule. Understanding those three lines explains most of the setup friction.
Who is it for?
Trime suits an Android user who wants Rime configurations and dialect input methods, and a developer prepared for a JNI toolchain with a patched librime subtree. Expect to fetch configurations from the separate rimerc project the README links.
Can I use it commercially?
Yes, with conditions. GPL-3.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Kotlin, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • osfans/trime4,814 ★ · +147
Star history
Repository2026-09-232026-11-15
osfans/trime4.7k4.8k

147 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

One platform for phonetic and shape-based methods, sitting on librime through JNI

Trime began as a frontend for Android Traditional Chinese IME and now reaches the Rime engine through JNI, written in Java and Kotlin. The stated aim is one platform carrying both phonetic-based and shape-based input, so dialects and Mandarin share a single kind of character data rather than each dialect needing its own engine.

The name records that path. It began as TaeRv Input Method for TaeRv Pinyin, became Chinese Character Dialect Input Method once code tables such as Wu dialect (吴语) were added, then Tongwen Input Method Platform 2.0 (同文输入法平台 2.0) when Wubi and Liangbi support arrived, and reached version 3.0, Tongwen Input Method (同文输入法), once librime arrived by JNI. The 2.0 lineage lives on in a separate legacy repository.

For a user, the practical reading is that this is a Rime client, not a Rime fork. Configurations are linked from the download section as a separate project, rimerc.

patch-apply runs before debug and release, and a bare gradle build skips it

The Makefile wraps Gradle instead of replacing it, and one target matters more than the rest. `patch-apply` applies a patch into the JNI submodule tree:

bash
git apply --directory=$(jniDir)/librime-lua-deps patches/lua.patch

Both `debug` and `release` declare `patch-apply` as a prerequisite, and `install` depends on `release`. That ordering is the part that catches people out: calling `gradlew assembleDebug` directly, which the README also suggests for Windows, bypasses the patch step entirely, so the native library you build is not the one the Makefile produces.

The paths involved come from the top of the Makefile, where `mainDir` is `app/src/main`, `resDir` is `app/src/main/res` and `jniDir` is `app/src/main/jni`. The Makefile prefixes that `git apply` with `-`, so make carries on even if the patch does not apply.

ComSpec decides whether the Makefile calls gradlew.bat or ./gradlew

Windows and Unix share one Makefile through a two-line conditional. If `ComSpec` is set, the wrapper is the batch script; otherwise it is the Unix one:

bash
GRADLEW := gradlew.bat
GRADLEW := ./gradlew

That indirection is why the README gives two commands for the same build. On Linux or macOS, `make debug`; on Windows, `.\gradlew assembleDebug`. The clean target is equally direct, removing `build`, `app/build` and `app/.cxx/`, which is the native build directory, before handing off to `$(GRADLEW) clean`.

The native side is not incidental. The tree carries a `.clang-format` file, a `codegen/` directory, a `patches/` directory and `script/`, and the repository is a Git submodule host through `.gitmodules`, so librime and its dependencies are built from source as part of the app rather than fetched as a prebuilt binary.

build depends on style-lint, so formatting can stop a compile

One line in the Makefile changes what a build means. `build` runs `style-lint` first, and `style-lint` is `spotlessCheck` followed by `clang-format-lint`, so a tree with formatting drift fails before Gradle is invoked. `style-apply` is the matching fix, running `spotlessApply` and `clang-format`.

The C++ side has its own pinned tool version, with a comment in the Makefile recording clang-format 22.1.8 as the one in use, invoked through `./script/clang-format.sh -n` for the lint pass and `-i` for the rewrite. CMake files get `cmake-format` applied to `app/src/main/jni/cmake/*.cmake` and `app/src/main/jni/CMakeLists.txt`.

Two more maintenance targets sit alongside. `reuse` annotates SPDX headers with the GPL-3.0-or-later identifier and deletes the generated `.license` files afterwards, and `cliff` regenerates `CHANGELOG.md` with git-cliff. Neither is needed to build, but both explain files you will meet in the repository.

Three toolchains before the first build, and OpenCC generates the translations

The prepare section names Android SDK and Android NDK, JDK (OpenJDK) 17, and Python 3, and gives the reason for the last one: OpenCC uses it to generate dictionary text files. There is no single installer that assembles those, so a first build means provisioning three toolchains.

OpenCC also appears in the Makefile, where a `translate` rule converts the traditional Chinese string file into the simplified one, reading `app/src/main/res/values-zh-rTW/strings.xml` and writing `app/src/main/res/values-zh-rCN/strings.xml`.

Cloning is a two-step affair, because the Rime dependencies arrive as submodules:

sh
git clone [email protected]:osfans/trime.git
git submodule update --init --recursive

A partial clone variant is offered for saving time, adding `--filter=blob:none` to the submodule command.

The Boost::coroutine target error is the failure the docs expect

The troubleshooting section opens with one concrete native error:

`Target "boost_log_setup" links to target "Boost::coroutine" but the target was not found.`

The prescribed answer is `make clean` on Linux or macOS, or `.\gradlew clean` on Windows. That target is what removes `app/.cxx/`, so a stale native cache is the mechanism the fix relies on.

Behind it sits a five-step ladder: clean again, confirm the repository is up to date including submodules, re-clone if submodules have drifted from the versions this commit expects, search the issue tracker and pull requests for the same error, and only then open an issue. The last step is marked optional, which tells you how the authors rank it.

Windows contributors get their own prerequisite before any of this, covered next, and it is the one platform-specific step in the whole setup.

Windows needs symlink support, and copies are the silent fallback

Symbolic links are created according to the current build configuration, so on Windows the repository asks for two things: Developer Mode, so links can be created without administrator privilege, and symlink support in git.

powershell
git config --global core.symlinks true

The README is unusually candid about the alternative: if you cannot or would not like to enable anything, copying is used instead when symbolic link creation errors. That fallback is worth understanding before you rely on it, since a copied file no longer tracks the submodule it came from, and the troubleshooting ladder asks you to confirm your submodules match the current version.

After that, the two platform paths converge. `make debug` on Linux or macOS and `.\gradlew assembleDebug` on Windows both produce the unsigned debug build, and the release path needs a `keystore.properties` file holding `storePassword`, `keyPassword`, `keyAlias` and `storeFile` before `make release` or `.\gradlew assembleRelease` will produce a signed one.

Stable, nightly and canary channels, with configurations in a separate repository

Installers come from three channels. Stable builds sit on F-Droid and Google Play under `com.osfans.trime`, the nightly build is published as a release tagged nightly, and canary builds come out of GitHub Actions. The release list shows v3.3.12 on 2026-09-01, v3.3.13 on 2026-11-01 and a Nightly Build on 2026-11-01, with the last push on 2026-11-01 and the default branch set to develop.

For a user, that split is simple: take the stable channel and treat nightly as a test. For a contributor, develop is the working branch and the nightly tag is the artifact that tracks it.

The configuration story is the part that trips people up. Configurations come from a separate project, rimerc, linked from the download section, and the wiki holds the documentation. Add to that a PRIVACY.md, a CODE_OF_CONDUCT.md and a community spread across issues, two QQ groups, Tieba, Telegram and the Play Store listing, and the shape is a community project with a code contribution path rather than a curated keyboard bundle.

Licensing matters here too, since the native side is assembled from many parts. The third party list mixes Boost (Boost Software License), darts-clone, LevelDB, glog, snappy, marisa-trie and utfcpp under permissive terms with libiconv under LGPL, OpenCC and Android Traditional Chinese IME under Apache 2.0, and RIME itself under BSD, all inside a GPL-3.0 project.

Editorial conclusion

Trime suits an Android user who wants Rime configurations and dialect input methods, and a developer prepared for a JNI toolchain with a patched librime subtree. Expect to fetch configurations from the separate rimerc project the README links. Before building, confirm you have JDK 17, the Android NDK and Python 3, and expect the first failure to be the Boost::coroutine target error that `make clean` is meant to clear.

Frequently asked questions

What is Trime used for on Android?

Trime is an Android input method frontend built on the RIME framework and reached through JNI. It is designed to protect local Chinese dialects and to carry phonetic-based and shape-based methods on one platform.

How do I build Trime from source?

Clone the repository and initialise submodules with git submodule update --init --recursive, then run make debug on Linux or macOS, or .\gradlew assembleDebug on Windows. A release build needs a keystore.properties file first.

Where do Trime keyboard configurations come from?

The README's download section points to a separate configuration project, rimerc. Documentation lives in the project wiki.

Which Trime build should a user install?

Stable builds are published on F-Droid and Google Play under com.osfans.trime, nightly builds come from the nightly release tag, and canary builds come from GitHub Actions.

What fixes the Boost::coroutine error when building Trime?

Run make clean on Linux or macOS, or .\gradlew clean on Windows, which removes the app/.cxx/ native directory. If it persists, update the submodules and re-clone before filing an issue.

Official sources

  1. License: GPL-3.0
  2. osfans/trime on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/osfans-trime.svg)](https://hysenlabs.com/projects/osfans-trime)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/osfans-trime.svg)](https://hysenlabs.com/projects/osfans-trime)

Was this useful?