# org.libreoffice.kit (from LibreOffice)

These four files are LibreOffice's Java bindings to LibreOfficeKit, copied from LibreOffice core
(`android/Bootstrap/src/org/libreoffice/kit/`, branch `libreoffice-26-8`). They are licensed under the **Mozilla Public
License 2.0** (see the header of each file); Mkoma's own code that calls them is not.

**Changed by Mkoma** (MPL 2.0 requires saying so and keeping the changed source available):

- `LibreOfficeKit.java`: loads the engine's SQLite as `losqlit` instead of `sqlite3`, because Mkoma ships its own
  `libsqlite3.so` and an app cannot hold two libraries of one name (`office_engine/spike/unpack_engine.py` renames the
  engine's copy and the references to it); and `init()` takes a `Context` instead of an `Activity`, because Mkoma
  starts the engine in a Service in its own process (`OfficeEngineService.kt`); and the native libraries are loaded by
  an explicit `loadLibraries(Context)` through Play's `SplitInstallHelper` instead of a static block, because Play
  bundles deliver them in an on-demand module (`android/office_engine/`).

- `Document.java`: adds `paintPartTile`, which calls a native function Mkoma adds to LibreOffice's Android binding
  (`office_engine/spike/patches/0001-lokandroid-paintPartTile.patch`): the engine reports areas to draw again after an
  edit only for areas painted this way.

The other two files are unchanged. The native code they call (`liblo-native-code.so`) is LibreOffice built from its
source with that patch and a build fix (`0002-android-lto-clang.patch`; `office_engine/README.md`), also MPL 2.0.

The app's licences page (Me → About Mkoma Office) carries LibreOffice's licence and notices and points to
https://xplosion.studio/mkoma/open-source/, which publishes these files, the patches and the build scripts. That page
is built from `docs/OPEN_SOURCE.md` by `tool/legal_pages.dart` (run it again after changing any of them).
