Skip to content

Adds KOReader Sync support#232

Merged
daveallie merged 17 commits intocrosspoint-reader:masterfrom
itsthisjustin:feature/koreader-sync
Jan 19, 2026
Merged

Adds KOReader Sync support#232
daveallie merged 17 commits intocrosspoint-reader:masterfrom
itsthisjustin:feature/koreader-sync

Conversation

@itsthisjustin
Copy link
Contributor

Summary

  • Adds KOReader progress sync integration, allowing CrossPoint to sync reading positions with other
    KOReader-compatible devices
    • Stores credentials securely with XOR obfuscation
    • Uses KOReader's partial MD5 document hashing for cross-device book matching
    • Syncs position via percentage with estimated XPath for compatibility

Features

  • Settings: KOReader Username, Password, and Authenticate options
  • Sync from chapters menu: "Sync Progress" option appears when credentials are configured
  • Bidirectional sync: Can apply remote progress or upload local progress

@daveallie
Copy link
Member

In order to allow my time to be split between all the PRs/work on CrossPoint, I'll be reviewing #219 and getting it merged before coming back to review this one.

@CrazyCoder
Copy link

Would it be possible to specify a custom server instead of using a default one? For instance, I host a custom server on my NAS in a Docker and would like to use it: https://github.com/koreader/koreader-sync-server.

@itsthisjustin
Copy link
Contributor Author

Yes but I felt this was easier to validate to start. Do custom servers use the exact same system as the official one?

@CrazyCoder
Copy link

Yes, the protocol is the same, only the URL would be different.

@itsthisjustin
Copy link
Contributor Author

Ok sure I'll add it tonight

@itsthisjustin
Copy link
Contributor Author

Would it be possible to specify a custom server instead of using a default one? For instance, I host a custom server on my NAS in a Docker and would like to use it: koreader/koreader-sync-server.

This is done and tested with https://sync.send2ereader.net. I also implemented file name matching because until the calibre wireless device stuff I did is merged I can't seem to get the hashes to match. I tested pushing and pulling and it works great.

Resolves conflict in SettingsActivity.cpp:
- Adopts new SettingInfo factory pattern from master
- Includes new settings: Sleep Screen Cover Mode, Reader Screen Margin
- Preserves KOReader Sync action from feature branch
@czdaniel
Copy link

czdaniel commented Jan 5, 2026

I wanted to test this feature because it is something I also want in crosspoint, thank you for implementing. I am not sure I have the time and the technical know how to help out but I tried testing it:

I have built and flashed the pr branch and added https://sync.send2ereader.net on both my PocketBook and xteink4 onto the same account with only one .epub book with the same filename. However I push or pull progress it never matches up between the devices. The TOC has multiple books in it as it is the complete Witcher series.
Case 1.

  1. On xteink device I go to Blood of Elves, Chapter 2. turn pages to 34 within the chapter.
  2. Go to TOC, sync progress»upload local progess, progess up:dated appears.
    progress found screen said
    Local:
    Blood of Elves
    Page 34/116 23% overall
  3. On Koreader go to progress sync, pull from other devices, it says sync successful
    Expected outcome:
    I am on the same page within Chapter 2
    Actual outcome:
    I am on the first page of Chapter 2 of the Book of book on Koreader. (page nr. 1425/5967)

Case 2.

  1. On Koreader navigate to book 4 chapter 1, and turn 10 or so pages from chapter beginning (1350/5967)
  2. Go to settings»progress sync»push progress from this device now
  3. On xteink go to TOC, sync progress» apply remote progess, progess updated appears.
    progress found screen said:
    Remote:
    Blood of Elves
    Page 95, 23% overall
    From: PBTouchLux5
    Local:
    Blood of Elves
    Page 34/142
    Expected outcome:
    I am on the same page withing Chapter one as intended or equivalent
    Actual outcome:
    I am on page 95 of 142, but that page does not correspond to the Koreader page, which would be 1396/5967.

I tried to be concise, but might have failed and I can send you the epub to test with or I might have messed something up. I think this probably has to do with how the TOC and progress is being handled.
EDIT: Koreader is latest release version for pocketbooks, I installed it just for this.

@itsthisjustin
Copy link
Contributor Author

Yes please send me the book. I am not sure if there's a unique setup with that book having multiple books inside it? Have you tried just using KoReader on two devices without crosspoint involved and seeing if it syncs fine? The way crosspoint handles progress is a bit different than koreader so I did % based mapping to the chapter.

You can upload the file here for me: https://files.sofriendly.com/i/2Xwdh4F/itsthisjustin

@czdaniel
Copy link

czdaniel commented Jan 5, 2026

Uploaded. I will try installing Koreader on my phone as I only have the Pocketbook and Xteink.

@itsthisjustin
Copy link
Contributor Author

Uploaded. I will try installing Koreader on my phone as I only have the Pocketbook and Xteink.

Ha well now that alt sync server appears to be down so I can't test anymore

@czdaniel
Copy link

czdaniel commented Jan 5, 2026

With android and pocketbook koreader no matter what I do, it seems to think the latest progress was from the device Im trying to sync from. Hopefully this isn't an error message for the backup service being down. Sigh.

@czdaniel
Copy link

czdaniel commented Jan 5, 2026

Nevermind figured out what I messed up, it works with Koreader on android and Koreader on pocketbook as expected.

@itsthisjustin
Copy link
Contributor Author

Nevermind figured out what I messed up, it works with Koreader on android and Koreader on pocketbook as expected.

Ok I'll take a look.

@daveallie
Copy link
Member

Given #219 is now merged, I'm keen to dive into this one over the next day or so, I assume it's still ready for a look @itsthisjustin?

@itsthisjustin
Copy link
Contributor Author

Given #219 is now merged, I'm keen to dive into this one over the next day or so, I assume it's still ready for a look @itsthisjustin?

Code quality wise yes. I still plan to see if there's some special case needed for compendium style books like the entire witcher series. This sync works for my simple 15 page epub I've been testing with though

@daveallie
Copy link
Member

Sorry for the delay in getting to this, I plan to look at it on Wednesday.

@itsthisjustin
Copy link
Contributor Author

So @daveallie due to the way the epub parser works compared to how KOReader works, we'd have to have character level tracking in the epub to get EXACT sync. What I've done for now is basically chapter level sync unless you want to go down the rabbit hole of trying to do a deeper level conversion which could be insanely processor intensive. Chapter sync is at least super helpful for a book this large which doesn't even contain a TOC on a per book basis making it insanely hard to manually navigate this (i.e. the sync feature here is still super useful even if it's not granularly syncing down the sentence)

@itsthisjustin
Copy link
Contributor Author

@itsthisjustin do you happen to know the purpose of the progress variable? From what I remember, resuming on another device with KO sync doesn't actually reference the progress, just jumps to the location itself. Perhaps that variable would be more useful to estimate where to resume going from other KO-device to the xteink, while the other way around would just have chapter-level syncing? Does that make sense?

I think it makes sense but it would require the same level of calculation I believe?

@iandchasse
Copy link
Contributor

Yes, but might be able to save time by not calculating the progress when uploading from crosspoint if the device running KOReader is going to calculate it itself once it locates the xpath, so maybe the toKOReader() function of progressmapper isn’t necessarily needed and can be dummy’d in the upload packet.

@itsthisjustin
Copy link
Contributor Author

Yes, but might be able to save time by not calculating the progress when uploading from crosspoint if the device running KOReader is going to calculate it itself once it locates the xpath, so maybe the toKOReader() function of progressmapper isn’t necessarily needed and can be dummy’d in the upload packet.

So I like it there because we can compare the progress to see which copy is further ahead. Helpful for determining oh yeah I was way further along on this device, I want to pull that progress. Hopefully I'm understanding what you're saying

daveallie
daveallie previously approved these changes Jan 19, 2026
@daveallie daveallie enabled auto-merge (squash) January 19, 2026 11:47
@daveallie daveallie disabled auto-merge January 19, 2026 11:52
@daveallie daveallie enabled auto-merge (squash) January 19, 2026 11:52
@daveallie daveallie merged commit f69cddf into crosspoint-reader:master Jan 19, 2026
1 check passed
jdk2pq added a commit to jdk2pq/crosspoint-reader that referenced this pull request Jan 20, 2026
* origin:
  fix: truncate chapter names that are too long (crosspoint-reader#422)
  feat: dict based Hyphenation (crosspoint-reader#305)
  fix: render U+FFFD replacement character instead of ? (crosspoint-reader#366)
  fix: Invert colors on home screen cover overlay when recent book is selected (crosspoint-reader#390)
  Adds KOReader Sync support (crosspoint-reader#232)
  feat: Change keyboard "caps" to "shift" & Wrap Keyboard (crosspoint-reader#377)
  fix: XTC 1-bit thumb BMP polarity inversion (crosspoint-reader#373)
@faaarmer
Copy link

Hey Justin - just trying to set this up. First time using KOreader on my Kobo.

Do you recommend using file name matching or hash matching? You mention MD5 hashing in the PR description.

I don't have either with me right now and I'm killing time so apologies for not trying myself.

I'm super excited to get this going though so thanks for your hard work on this.

@itsthisjustin
Copy link
Contributor Author

I personally use file name as it was way easier to transfer the files over USB prior to calibre wireless device syncing working

1 similar comment
@itsthisjustin
Copy link
Contributor Author

I personally use file name as it was way easier to transfer the files over USB prior to calibre wireless device syncing working

@faaarmer
Copy link

Got this working now with the Calibre Library feature you added too!
I was having an issue where my Kobo was downloading with the file name as Author - Title, and the XTeink was the opposite. Edited some lua and the file name sync now works!!
I couldn't get binary sync working.

yingirene pushed a commit to yingirene/crosspoint-reader that referenced this pull request Jan 25, 2026
## Summary

- Adds KOReader progress sync integration, allowing CrossPoint to sync
reading positions with other
KOReader-compatible devices
- Stores credentials securely with XOR obfuscation
- Uses KOReader's partial MD5 document hashing for cross-device book
matching
  - Syncs position via percentage with estimated XPath for compatibility

# Features
- Settings: KOReader Username, Password, and Authenticate options
- Sync from chapters menu: "Sync Progress" option appears when
credentials are configured
- Bidirectional sync: Can apply remote progress or upload local progress

---------

Co-authored-by: Dave Allie <[email protected]>
daveallie pushed a commit that referenced this pull request Jan 27, 2026
## Summary

Addresses
#504

- Reverts book progress % to showing as an integer instead of with a
decimal place
- This was changed to 1 decimal point of precision in
#232 from
what I can tell
- As this wasn't the primary intention of that PR, I'm assuming it was
left in accidentally

IMO having a decimal place of precision is too much for something as
vague as book completion percent. This de-clutters the status bar and
prevents extra updates as you change pages.

---

### AI Usage

YES
@bartiprime
Copy link

I'm a little bit confused. With this merge, it doesn't behave 1:1 like the official koreader sync right? Since crosspoint koreader sync only syncs the chapter that you're currently in and not where you're actually in the chapter. What happens if my epub doesnt have chapters?

@itsthisjustin
Copy link
Contributor Author

I'm a little bit confused. With this merge, it doesn't behave 1:1 like the official koreader sync right? Since crosspoint koreader sync only syncs the chapter that you're currently in and not where you're actually in the chapter. What happens if my epub doesnt have chapters?

So it uses a combination of the % estimate and page number to try to find the closest spot. If an epub has no concept of chapters I think it will just estimate percentage and land somewhere close vs rounding down to start of chapter

1 similar comment
@itsthisjustin
Copy link
Contributor Author

I'm a little bit confused. With this merge, it doesn't behave 1:1 like the official koreader sync right? Since crosspoint koreader sync only syncs the chapter that you're currently in and not where you're actually in the chapter. What happens if my epub doesnt have chapters?

So it uses a combination of the % estimate and page number to try to find the closest spot. If an epub has no concept of chapters I think it will just estimate percentage and land somewhere close vs rounding down to start of chapter

Jessica765 pushed a commit to Jessica765/crosspoint-reader that referenced this pull request Feb 3, 2026
## Summary

Addresses
crosspoint-reader#504

- Reverts book progress % to showing as an integer instead of with a
decimal place
- This was changed to 1 decimal point of precision in
crosspoint-reader#232 from
what I can tell
- As this wasn't the primary intention of that PR, I'm assuming it was
left in accidentally

IMO having a decimal place of precision is too much for something as
vague as book completion percent. This de-clutters the status bar and
prevents extra updates as you change pages.

---

### AI Usage

YES
@Jelle-elaut
Copy link

@itsthisjustin / @bartiprime I have exactly the same question/issue. I'm only getting synced to beginning of the chapter which is not useful when the book I'm reading has big chapters. Any idea what is going wrong?

@osteotek
Copy link
Member

@Jelle-elaut would it be possible to test if this PR solves kosync issues? #783

Unintendedsideeffects pushed a commit to Unintendedsideeffects/crosspoint-reader that referenced this pull request Feb 17, 2026
## Summary

- Adds KOReader progress sync integration, allowing CrossPoint to sync
reading positions with other
KOReader-compatible devices
- Stores credentials securely with XOR obfuscation
- Uses KOReader's partial MD5 document hashing for cross-device book
matching
  - Syncs position via percentage with estimated XPath for compatibility

# Features
- Settings: KOReader Username, Password, and Authenticate options
- Sync from chapters menu: "Sync Progress" option appears when
credentials are configured
- Bidirectional sync: Can apply remote progress or upload local progress

---------

Co-authored-by: Dave Allie <[email protected]>
Unintendedsideeffects pushed a commit to Unintendedsideeffects/crosspoint-reader that referenced this pull request Feb 17, 2026
## Summary

Addresses
crosspoint-reader#504

- Reverts book progress % to showing as an integer instead of with a
decimal place
- This was changed to 1 decimal point of precision in
crosspoint-reader#232 from
what I can tell
- As this wasn't the primary intention of that PR, I'm assuming it was
left in accidentally

IMO having a decimal place of precision is too much for something as
vague as book completion percent. This de-clutters the status bar and
prevents extra updates as you change pages.

---

### AI Usage

YES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants