Commit Graph
1096 Commits
Author SHA1 Message Date
Uri Tauber cbdbbc096a fix: load access fault crash (#1370)
## Summary

Fixes a crash (load access fault) when opening EPUB chapters whose first
text block exceeds 750 words.

## Changes

* **Crash fix (`addLineToPage`)**: Added a null guard for `currentPage`.
If `makePages()` hasn't run yet (which can happen when the first block
triggers the "text block too long" split path), the page is now created
on demand.
* **Layout fix (`characterData`)**: The early-split path previously used
`viewportWidth`, ignoring CSS margins and padding. It now computes
`effectiveWidth` using `totalHorizontalInset()`, consistent with
`makePages()`.

## Additional Context

* Crash signature: `MCAUSE=0x5` (load access fault), `A0=0x0` (`Page*`
null), `MTVAL=0x4 / 0x8` (offsets into `Page::elements`).
* Confirmed in two user reports reported in #1328
* Tested on PR #1357 (not on `master`).

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**< PARTIALLY >**_
2026-03-09 16:57:40 -05:00
jpirnay 36b1b5e345 Fix to master 2026-03-09 22:48:14 +01:00
jpirnay 010ba4a89c Merge branch 'master' of https://github.com/jpirnay/crosspoint-reader into feat-page-overlay 2026-03-09 22:41:33 +01:00
jpirnay 03e62a8812 fix: Fix bootloop logging crash (#1357)
## Summary

* **What is the goal of this PR?** On a cold boot (or after a crash that
corrupts RTC RAM), logHead contains garbage. Then addToLogRingBuffer
does: ``strncpy(logMessages[logHead], message, MAX_ENTRY_LEN - 1); ``
With garbage logHead, this computes a completely invalid address. The %
MAX_LOG_LINES guard on line 16 only runs after the bad store, which is
too late. The fix is to clamp logHead before use.

## Additional Context

* Add any other information that might be helpful for the reviewer
(e.g., performance implications, potential risks,
  specific areas to focus on).

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**NO**_ (did use claude
for the magic hash value)
2026-03-09 21:53:38 +01:00
jpirnay 0a4a369d25 Merge branch 'feat-page-overlay' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-09 19:51:52 +01:00
jpirnay 3e52fad331 Overlay always use portrait 2026-03-09 19:51:28 +01:00
jpirnay cde401d22b chore: micro-optimisation: early exit on fillUncompressedSizes (#1322)
## Summary

* **What is the goal of this PR?** Avoid repeated full central-directory
scans by using early stop when all requested targets are already
matched.
* **What changes are included?**

## Additional Context

* Add any other information that might be helpful for the reviewer
(e.g., performance implications, potential risks,
  specific areas to focus on).

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _** PARTIALLY **_
Identified by AI
2026-03-08 14:15:51 -05:00
jpirnay 8070d251f1 Merge branch 'feat-bookinfo' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 17:58:33 +01:00
jpirnay fd71e87800 Add info option to recents, too 2026-03-08 17:58:20 +01:00
Uri Tauber c986a274ee refactor: reader utils (#1329)
## Summary

Extract shared reader utilities (`ReaderUtils.h`) to reduce duplication
across `EpubReaderActivity`, `TxtReaderActivity`, and (upcoming)
`MarkdownReaderActivity`.

  Utilities extracted:

   - `applyOrientation()` — orientation switch logic
   - `detectPageTurn()` — page navigation input detection
   - `renderAntiAliased()` — grayscale anti-aliasing pass
   - `displayWithRefreshCycle()` — refresh mode cadence
   - `GO_HOME_MS` — back button timing constant

  ## Impact

Flash: 32 bytes saved (6006441 → 6006409 bytes). Minimal immediate gain,
but meaningful once markdown reader and future reader types share these
functions.

Code quality: Eliminates ~100 lines of duplicated logic spread across
multiple files. All readers now follow the same patterns for
orientation, input handling, and rendering.

  ## Rationale

This refactor is preparation for markdown support, which requires
identical input and rendering logic. Instead of copy-pasting these
patterns a third time, all readers now share a single, tested
implementation. Future reader types can reuse `ReaderUtils` without
duplication.

  ---

  ## AI Usage

Did you use AI tools to help write this code? YES Claude extracted the
code, under my guidance. Tested on my device and seems to work fine.
2026-03-08 11:45:54 -05:00
jpirnay 8dc82f28af Use series in recents if present 2026-03-08 17:44:10 +01:00
jpirnay 02edfbb418 Merge branch 'feat-dirshow' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 16:34:39 +01:00
jpirnay e52d0d3fb3 Merge branch 'fix-logging' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 16:34:28 +01:00
jpirnay 996ae89d62 And nitpick, too 2026-03-08 16:33:01 +01:00
jpirnay ed1a21fb7b Add magic value 2026-03-08 16:26:52 +01:00
jpirnay 5b1ccb8b6d Dont add brackets around directory for themes that have icon support 2026-03-08 16:20:21 +01:00
jpirnay a3a50c8c40 Clear log if invalid 2026-03-08 16:05:08 +01:00
jpirnay c464bdede8 Add and expose sanitizing logic 2026-03-08 15:51:05 +01:00
jpirnay eaee1e3a83 Merge branch 'fix-logging' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 15:41:53 +01:00
jpirnay 98fb3d65c9 And even more... 2026-03-08 12:45:14 +01:00
jpirnay 9182a05670 And more... 2026-03-08 12:14:18 +01:00
jpirnay 42a01446ef More review changes 2026-03-08 11:27:52 +01:00
jpirnay b9b60d31ba Further guards according to review 2026-03-08 11:19:56 +01:00
jpirnay 2010b33e5d Review amendments 2026-03-08 11:03:50 +01:00
jpirnay 35897d33ae Fix bootloop logging crash 2026-03-08 10:57:49 +01:00
jpirnay 7ab6d5ac4b Proper fix 2026-03-08 10:13:36 +01:00
jpirnay 47257fe4b4 Add include 2026-03-08 10:12:16 +01:00
jpirnay 69f893840a Add getmODIFYdATEtIME 2026-03-08 10:08:38 +01:00
jpirnay b9eefc5e70 Fix fast path 2026-03-08 10:06:08 +01:00
jpirnay d76581e7ff Merge branch 'perf-uifonts2' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 10:01:38 +01:00
jpirnay ec79f7b2ef Merge branch 'perf-fillrect' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 10:01:17 +01:00
jpirnay 378c1613ee Merge branch 'fix-key' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 10:00:48 +01:00
jpirnay ed0302571e Merge branch 'feat-koysnc-xpath' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 09:58:54 +01:00
jpirnay c63659311e Merge branch 'feat-overlay' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 09:58:14 +01:00
jpirnay 8688139a71 Merge branch 'feat-hiddenfiles' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 09:56:47 +01:00
jpirnay f82cc27d09 Merge branch 'feat-cache-koreader-hash' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 09:55:42 +01:00
jpirnay ea36d2c787 Merge branch 'fix-jpegcleanup' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 09:55:24 +01:00
jpirnay 786fbfa7c1 Merge branch 'feat-page-overlay' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 09:55:09 +01:00
jpirnay bfc86eabf9 Merge branch 'fix-hyphen_apostrophe' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 09:54:39 +01:00
jpirnay ca94f89fba Merge branch 'feat-dirshow' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 09:54:29 +01:00
jpirnay 2abcf9bc68 Review fixes 2026-03-07 19:33:02 +01:00
jpirnay a6f61fb0d0 Proper series detection 2026-03-07 19:06:53 +01:00
jpirnay 95f1d14f3f Revert version bump 2026-03-07 18:53:39 +01:00
jpirnay 2d6741e9df Remap buttons 2026-03-07 18:52:46 +01:00
jpirnay 5dab5b3cf1 Add error information 2026-03-07 18:52:27 +01:00
jpirnay 907aa43caf No accidental confirmation 2026-03-07 18:51:55 +01:00
jpirnay 56ed445c71 Smaller font size 2026-03-07 18:17:06 +01:00
jpirnay 10e0680f6e Add bookinfo 2026-03-07 18:07:49 +01:00
jpirnay 3ed96a7e49 Use and populate metadata 2026-03-07 18:02:21 +01:00
jpirnay 87e5cc4fe1 Extend metadata 2026-03-07 18:01:18 +01:00