petlyh / android-libre-japanese-input

WIP restoration of standalone Japanese input (mozc) for Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Libre Japanese Input for Android

Screenshot

What is this?

Libre Japanese Input is a WIP restoration and continuation of the standalone Google Japanese Input/mozc app which has been discontinued in favor of the monolithic gBoard app which requires an internet connection. Unfortunately, its most recent, several-year old build has become increasingly incompatible with recent devices and versions of Android, motivating the creation of this project.

This project is not affiliated with Google.

What works/What's been done already?

  • Software text entry. Kana input and henkan work.

What doesn't work/What still needs to be done?

  • Lots of layout issues. Keyboard key text sizes are either too small or too big in some places. Occasional tofus rendered.
  • Included emoji/emoticon sets are outdated. Emoji and symbol history are not saved.
  • Cannot import or export user dictionaries.
  • Hardware keyboard input needs testing.

Development

First, ensure you have initialized all submodules.

git submodule update --init --recursive

The Libre Japanese Input dev environment is provided as a Nix flake and is very easy to build with Nix.

nix develop
./gradlew installDebug

Building the mozc JNI library and dataset

The best way to do this is via the Docker setup described in the mozc repo. Libre Japanese Input depends on the exact revision ddd9730b068387631e3b4d212314ef0ed93befe0. Specific instructions are provided below.

# Clone and setup Libre Japanese Input.
git clone https://github.com/elizagamedev/android-libre-japanese-input.git
cd android-libre-japanese-input
git submodule update --init --recursive

# Create Docker image.
cd third_party/mozc/docker/ubuntu22.04
docker build --rm --tag mozc_ubuntu22.04 .
docker create --interactive --tty --name mozc_build mozc_ubuntu22.04

# Build everything.
docker start mozc_build
docker exec -it mozc_build bash
# Check out the exact version of mozc that LJI uses.
git checkout ddd9730b068387631e3b4d212314ef0ed93befe0
git submodule deinit -f .
git submodule update --init --recursive
bazel build package --config oss_android -c opt
bazel build //data_manager/oss:mozc_dataset_for_oss --config linux
exit

# Extract artifacts.
cd ../../../../app/src/main
docker cp mozc_build:/home/mozc_builder/work/mozc/src/bazel-bin/android/jni/native_libs.zip .
docker cp mozc_build:/home/mozc_builder/work/mozc/src/bazel-bin/data_manager/oss/mozc.data assets
ln -s jniLibs lib
unzip native_libs.zip
rm -f lib native_libs.zip

# Clean up Docker.
docker stop mozc_build
docker rm mozc_build
docker image rm mozc_ubuntu22.04

About

WIP restoration of standalone Japanese input (mozc) for Android

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Java 74.2%Language:Kotlin 19.0%Language:Python 6.6%Language:Nix 0.2%Language:Emacs Lisp 0.0%