Browse by type
Syncs KOReader reading progress and statistics into the Onyx Boox library so progress and reading time stay visible in the Onyx library and Onyx account.
MANAGE_EXTERNAL_STORAGE) permission must be granted to the companion app once — required to read KOReader's statistics database.The plugin communicates with a small companion app running as a background service. This is necessary because KOReader's JNI bridge is not stable enough to write to the Onyx content provider directly from Lua. The companion app has no UI — it runs silently in the background and handles all content provider writes on behalf of the plugin.
On every page turn, the companion app reads KOReader's statistics.sqlite3 database and syncs any missing reading sessions into the Onyx statistics provider. This means:
onyx-sync.apk from the latest release.koreader/plugins/onyxbooxsync.koplugin on your device.main.lua and _meta.lua into the folder.Install the UpdatesManager plugin to keep Onyx Progress Sync up to date automatically from within KOReader.
The plugin adds a menu entry under Onyx Progress Sync → Scan and update all books in current directory in KOReader's FILE BROWSER menu (only visible in the library).
This scans the current folder and pushes progress and reading history for every book, so the Onyx library shows up-to-date percentages, reading statuses and statistics without having to open each book individually.

Query all Onyx metadata (reading progress)
adb shell content query --uri content://com.onyx.content.database.ContentProvider/Metadata
Query Onyx reading statistics
adb shell content query --uri content://com.onyx.kreader.statistics.provider/OnyxStatisticsModel
Query statistics for a specific book
adb shell content query \
--uri content://com.onyx.kreader.statistics.provider/OnyxStatisticsModel \
--projection "id,eventTime,durationTime,type,path" | grep "YourBookName"
adb shell 'content query \
--uri content://com.onyx.content.database.ContentProvider/Metadata \
--where "nativeAbsolutePath='\''/storage/emulated/0/Books/Des fleurs pour Algernon - Daniel Keyes.epub'\'' OR id=1"'
Deploy the plugin during development
adb push ./main.lua /sdcard/koreader/plugins/onyx_sync.koplugin/main.lua
View companion app logs
adb logcat -s OnyxStatisticsProvider:* PageTurnReceiver:* SyncReceiver:*
View plugin logs
adb logcat -s KOReader:*
Delete already created Statistic
sh
adb shell content delete \
--uri content://com.onyx.kreader.statistics.provider/OnyxStatisticsModel \
--where "type=\'1\'"
adb shell content delete \
--uri content://com.onyx.kreader.statistics.provider/OnyxStatisticsModel \
--where "type=\'0\'"
adb shell content delete \
--uri content://com.onyx.kreader.statistics.provider/OnyxStatisticsModel \
--where "type=\'6\'"
Books not showing up in the Onyx library after a bulk update
The Onyx library needs to be rescanned to pick up newly indexed books:
Update the version string in _meta.lua:
lua
version = "v0.0.X",
Commit and push the version bump:
sh
git add _meta.lua
git commit -m "Bump version to 0.0.X"
git push origin main
Create and push the git tag:
sh
git tag v0.0.X
git push origin v0.0.X
GitHub Actions will pick up the new tag and publish a release automatically.
If the companion app has changed, bump the APK version before tagging:
In build.gradle, increment versionCode and versionName:
groovy
versionCode X
versionName "X.0"
In main.lua, update the minimum required APK version to match:
lua
local MIN_VERSION_CODE = X -- minimum APK required versionCode
Then follow the plugin-only steps above. The GitHub Actions release will include the new APK and the plugin will prompt users to update it if their installed version is older than MIN_VERSION_CODE.
MIT. See LICENSE.
$ claude mcp add onyxbooxsync.koplugin \
-- python -m otcore.mcp_server <graph>