Commit graph

91 commits

Author SHA1 Message Date
Huang Xin
4f9395859c
fix(security): remediate Dependabot dependency alerts (#7248)
* fix(security): upgrade direct ZIP readers to 9.0.5

Upgrade the app, native narration reader and Windows thumbnail provider;
adapt fallible filenames and optional data offsets. Update both app
lockfiles and the thumbnail lock while preserving unrelated pins.

Verified: 201 app Rust tests, 24 native TTS tests, 6 thumbnail tests under
Wine (1 existing ignored), strict app clippy, formatting and locked CEF
Linux dependency graph. Thumbnail strict clippy reproduces 3 existing
lints on the original source; it passes with those CLI lint allowances.
CEF compilation and native Windows device testing were not run.

This is a dependency/API migration covered by existing archive tests;
no new application behavior is intended. The Windows updater retains
ZIP 4 because its patched release requires an incompatible Tauri family.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* fix(security): update vulnerable JavaScript dependencies

Raise patched dependency floors, scope the modern minimatch upgrade to
v10 consumers, and patch deepmerge prototype writes in both merge loops.
Upgrade the SVG renderer and keep its font shaper external so Node can
load its WASM asset when generating PNGs.

Regression tests fail before the fixes: deepmerge inherits attacker
properties; minimatch expands 256 patterns instead of 64 and performs
500500 comparisons instead of zero. The unpatched image upgrade fails
with a dynamic require of fs / missing hb.wasm. All 31 new tests pass
with the fixes, including actual translation and PDF vendor consumers.

Verified: full unit suite 14714 passed/16 skipped; final focused tests
31 passed; lint, formatting, frozen install, web build and Tauri frontend
build passed. Final web build was repeated after the renderer patch.
Nix hashes still need CI regeneration; CEF compilation was not run.
Version-based audits still flag patched deepmerge and legacy minimatch
3/5, which lack this advisory's vulnerable optimizer.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* build(nix): request fresh security dependency hashes

Invalidate the pnpm and Cargo fixed-output hashes so the PR dependency
check computes the updated stores instead of substituting old cached
stores. Replace both values with the CI-reported hashes before merge.

Verified the diff changes only the two affected hash fields; local Nix
is unavailable. CI verification is pending on this commit.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* build(nix): pin regenerated security dependency hashes

Use the pnpm and Cargo hashes calculated by the PR dependency check
(run 41428540045). Both fetchers completed and reported their actual
fixed-output hashes. Replace the temporary empty values.

Verified against the CI log's pnpm-deps and vendor-staging got values;
git diff --check passes. The final hash-check rerun is pending.

Co-Authored-By: Claude Code <noreply@anthropic.com>

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
2026-11-02 11:50:57 +01:00
Huang Xin
477381c8ac
fix(tts): play local AAC narration natively on Linux (#7240)
* fix(tts): play local AAC narration natively on Linux

Decode AAC-LC/ALAC MP4 narration with Symphonia 0.6.1 and send PCM to
CPAL, with SoundTouch preserving pitch when playback speed changes.
Read stored EPUB entries as byte windows and DEFLATE entries through a
bounded in-memory checkpoint index, without extracting audio to cache.
Reuse the native narration clock and controls; retain browser playback
for remote audio and local MP3/Ogg/Opus/WebM sources.

Cover source integrity, exact seeks and MP4 edit timing, bounded output,
audible playback position, ordered controls and cancellation of pending
loads. Run the native plugin and lifecycle regressions in PR CI.

Regression evidence: without the Linux source-descriptor change,
"hands Linux the raw compressed ZIP entry without reading its audio
bytes" fails because getMediaSource returns null instead of the path
and raw ZIP entry. Transport and device-stream lifecycle regressions
were also verified to fail before their corresponding fixes.

Verified on current origin/main: full Vitest suite (14687 passed,
16 skipped), lint, format check, web build, Rust formatting and CEF
Clippy with warnings denied. CEF unit tests: 201 app + 24 plugin tests
passed; 3 transport/device-stream lifecycle regressions passed.
Nix cargoDeps realization and actionlint passed. Full Nix app build
and mobile device tests not run.

Linux CEF runtime with Symphonia 0.6.1: captured audible AAC, verified
forward/backward seeks, rate, pause/frozen clock, abort, and compressed
EPUB playback through all three paragraph highlights to completion.
No reporter EPUB was supplied; used generated narration fixtures.
One earlier app run exited SIGBUS during a shared-target rebuild;
cause unconfirmed, fresh launch after checks passed the sequence.

Reported by DeathStroke19891 on GitHub. Fixes #7084.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* fix(tts): enqueue Linux controls before async dispatch

Tauri schedules async command invocations independently, so pause/resume
could reach the Linux worker in reverse order even when blocking reply
waiters were kept separate. Dispatch Linux playout_control directly from
the synchronous plugin handler, then resolve its worker reply off-thread.
Retain the same IPC payload, ACL parsing, asset scope and non-Linux paths.
This also allows abort to cancel a pending load without waiting for its
reply, which a frontend promise chain would delay.

Regression evidence: reverse the first polls of the old command futures
and the ordering assertion fails with ["resume", "pause"] instead of
["pause", "resume"]. The updated production-handler regression asserts
pause/resume/load/abort enqueue before any response future is polled,
then runs response tasks and blocking waiters in reverse order.

Verified Rust formatting, CEF Clippy with warnings denied, 201 app and
24 plugin unit tests, 3 lifecycle regressions, and a rebuilt CEF app.
Runtime: 40 rapid pause/resume cycles preserved final state, pause froze
the clock, and abort canceled a 226 MB compressed recording load in
about 19 ms. Invalid payload and out-of-scope path rejections passed.
Independent review verified ACL handling and non-Linux routing.
Frontend checks are rerun by the repository's pre-push hook.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* refactor(tts): hide narration platforms (owner: remove the linux flag)

Move native source selection and backend capabilities into
NativeNarrationPlayer. MediaOverlayClient retains one native flag and
uses streaming, queueing, and cancellation capabilities without OS checks.
Preserve local ZIP playback, browser fallbacks, and mobile staging.

Validation: 93 focused tests passed; full Vitest suite passed 1,220 files
and 14,691 tests (4 files and 16 tests skipped). TypeScript, Biome lint,
format checking, and git diff --check passed. Lint reports one existing
informational diagnostic in nativePageTurn.ts. New loadSource tests fail
before delegation exists and pass afterward. In an isolated Linux CEF
app, compressed AAC playback advanced through all three paragraph
highlights using the native clock. Mobile device checks were not run.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* fix(tts): finish canceled narration loads without errors

A native load can be canceled independently of the speak signal. Suppress
load failures when either signal was aborted, retaining the original
playback signal across invalidation so Rust cancellation errors are also
recognized. Other load failures still yield playback errors.

Validation: eight regression cases fail without this guard, yielding an
error instead of completing the generator. All 95 focused native/client/
player tests pass with the fix, including genuine load failures. TypeScript,
Biome lint and formatting, and git diff --check pass. In isolated Linux CEF,
stopping a large compressed recording during loading closes the player,
leaves native playback stopped, and logs no playback error. Mobile device
checks were not run. The pre-push hook runs the full frontend suite.

Co-Authored-By: Claude Code <noreply@anthropic.com>

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
2026-11-02 08:54:20 +01:00
k6G52m4Dz75W
d394bc9d62
chore(deps): bump webpki chain for the emSign/eMudhra intermediate CA distrust (#7002)
RUSTSEC-2026-0382: rustls-webpki 0.103.15 chain verification may accept
distrusted intermediates; RUSTSEC-2026-0381/0383: the bundled root store
still trusts the emSign/eMudhra intermediates that public trust stores
dropped in the 2026-10 CA incident (Node.js shipped the same distrust in
its 2026-10-21 ca-cert update). That store is compiled into the binary,
so OS trust updates never reach it: the app's reqwest users (the app
itself, tauri-plugin-http, sentry) and the localsend module's reqwest
all verify against it via hyper-rustls.

Bump rustls-webpki 0.103.15 -> 0.103.16 and webpki-roots /
webpki-root-certs 1.0.9 -> 1.0.10. Lockfile-only change.

cargo audit: 14 vulnerabilities before, 11 after (the remaining ones are
tracked separately).
2026-10-23 08:15:05 +02:00
Huang Xin
9fd7a4820d
fix(deps): resolve open Dependabot alerts (#6813)
* fix(deps): resolve open Dependabot alerts

Raise the workspace overrides for shell-quote, proxy-addr and
source-map-js to their patched releases, and pull postcss-selector-parser
6.x (pinned by @tailwindcss/typography) up to 7.1.6. The compiled prose
styles are unchanged.

Move katex to 0.18 (with marked-katex-extension 5.1.13 and an override for
the packages still asking for 0.16) and i18next-http-backend to 4.0.2.
v4 only drops the cross-fetch fallback; the backend loads in the browser,
which has fetch.

Update rustls to 0.23.46 in Cargo.lock, Cargo.cef.lock and the koplugin
LocalSend helper.

Blank the Nix pnpmDeps and cargo hashes so the fod-hashes check prints
the new values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(nix): refresh pnpm and cargo dependency hashes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 07:59:43 +02:00
k6G52m4Dz75W
2d3d0486b2
fix(windows): stop the main window from growing on every launch (#6546)
* fix(windows): stop the main window from growing on every launch

The main window is created hidden with undecorated shadows to avoid a
first-paint flash. While a window stays hidden, tao's WM_NCCALCSIZE
handler never runs again, so the client area keeps the rect Windows
computed at creation time from the native frame styles — shorter than
intended by the titlebar height. Restoring the saved geometry on top of
that makes tao compensate with the stale window-to-client offset, and
the difference is baked into the real client area on every launch: the
window grows by roughly one titlebar height per start (#6373), and the
grown height is saved again at exit.

Skip the window-state plugin's initial restore for the main window,
force one frame re-evaluation (SWP_FRAMECHANGED) while the window is
still hidden, and then replay the saved geometry through the plugin's
own restore_state against the corrected client rect.

Verified on Windows 11 (build 26200, 200% scaling): three consecutive
launch/close cycles keep the saved main size constant at 2560x1600;
without the fix the saved height grows on every launch. Linux and macOS
are untouched — the skip and the manual restore are Windows-only.

* fix(windows): show the main window if the state restore fails

restore_state surfaces errors before reaching the plugin's trailing
show()/set_focus(), so a reachable restore failure could leave the
hidden-created main window invisible for that launch. Fall back to
showing the window at its creation-time size; the state file is
untouched and the next launch retries the restore.
2026-10-02 07:54:10 +02:00
Huang Xin
6bcd170de4
fix(reader): animate page turns for PDF and comics on Windows and Linux, closes #6380 (#6506)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
* fix(reader): animate page turns for PDF and comics on Windows and Linux, closes #6380

Fixed-layout books (PDF, CBZ/CBR, fixed-layout EPUB) only animate through
the captured page turn, which needs a native snapshot of the webview. That
snapshot existed on macOS, iOS and Android only, so Windows and the Linux
CEF runtime rejected it and every turn on those books was instant.

Both engines are Chromium, so both now take the snapshot with the DevTools
protocol's Page.captureScreenshot, clipped to the reader cell: WebView2's
CallDevToolsProtocolMethod on Windows, the CEF browser's DevTools message
observer on Linux. The clip returns exactly the region at device
resolution, and captureBeyondViewport stays off so the live page never
reflows. JPEG, as on Android: about 35 ms per full cell against 86 ms for
PNG.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* build(nix): bump cargoHash for the native-bridge dependency edges

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(reader): release the CEF screenshot observer when no result arrives

The observer and its registration hold each other, so a capture that
never gets a result (the DevTools agent detached, or the wait timed out)
kept both alive. Take the registration on agent detach, and on timeout
from the caller on the UI thread.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 16:08:42 +02:00
Huang Xin
3314d4fdf6
fix(desktop): reopen the library when Readest is relaunched with only reader windows open, closes #6394 (#6495)
* fix(desktop): reopen the library when Readest is relaunched with only reader windows open, closes #6394

Relaunching Readest (e.g. from the desktop shortcut) after closing the
library window left only the reader windows and never brought the library
back:

- The single-instance callback only focuses the `main` window, which does
  nothing once it is gone. The first reader window now recreates it on a
  plain relaunch; launches carrying a file or link still go to the
  open-with handlers.
- On the Linux CEF build the relaunch never reached the single-instance
  plugin at all. Chromium's process singleton claims it first, the running
  browser process drops the command line, and the new process panics in
  CEF initialization, so a relaunch neither raised the library nor opened
  the files it was given. The launch is now handed to the running instance
  over the plugin's D-Bus interface before CEF starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(nix): update cargoHash for the zbus entry in Cargo.cef.lock

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 11:04:50 +02:00
Huang Xin
2ce0522743
chore(linux): catch up the CEF runtime with upstream feat/cef, closes #6397 (#6487)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
2026-09-30 04:07:58 +08:00
Huang Xin
5ebdd113d3
feat(tts): native desktop Now Playing for macOS, Windows and Linux (#6457) 2026-09-29 19:50:27 +08:00
Huang Xin
8750c31043
perf(android): cut the arm64 apk from 90MB to 57MB (#6368)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
* perf(android): cut the arm64 apk from 90MB to 57MB

The Rust library is 95% of the APK, and most of what it carried was not
code. Measured on an aarch64 release build: 89.7MB -> 57.5MB.

- Build `release` with fat LTO and one codegen unit. Cross-crate inlining
  cuts .text by 5.2MB and the unwind/exception tables by 2.1MB, at the
  cost of a longer final link.
- Strip the packaged library. AGP's own strip step only drops the
  .debug_* sections, so 22MB of symbol tables (10MB after LTO) reached
  every download. The strip runs on AGP's output, so `target/` keeps the
  unstripped copy, which the release and nightly workflows now upload to
  Sentry as debug files; Rust frames stay symbolicated. Android builds
  also link with a build id, which is how Sentry matches them, and the
  `debug-images` feature attaches the loaded modules to each event.
- Stop shipping jieba's WASM twice (2.7MB). The wasm-bindgen glue
  defaults to the file the bundler already emits; pointing `init()` at a
  public/vendor copy embedded both.
- Keep the browser-only turso WASM out of native builds (3.3MB). The
  alias that excluded it still named `@tursodatabase/database-wasm`,
  which the web database service stopped importing in #4086.

simplecc is still embedded twice (0.4MB): its glue is imported through
the `@simplecc/*` path alias out of public/vendor, so deduping it means
moving that directory.

Verified: the built APK's library carries no symbol tables and a build
id; `target/` keeps its; the bundle requests exactly the one embedded
jieba asset key and no /vendor/jieba path; the turso WASM is absent from
`out/`. The APK installs and runs on a Xiaomi 2211133C, library and a
Chinese book render, and RSVP runs on it. Whether jieba's WASM is
actually fetched at runtime is NOT verified: release webviews are not
inspectable and the fallback to Intl.Segmenter is silent.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* perf(android): drop fat LTO, codegen-units=1 is the whole win

The previous commit credited the code-size saving to fat LTO. That was
wrong. Measured on aarch64-linux-android with the flags rustc actually
received (`cargo build -v`):

  codegen-units=16, lto=false   .text 29.66MB  .eh_frame 3.69  .except 2.51
  codegen-units=1,  lto=off     .text 24.43MB  .eh_frame 2.28  .except 1.84
  codegen-units=1,  lto=thin    .text 24.43MB  .eh_frame 2.28  .except 1.84
  codegen-units=1,  lto=fat     .text 24.44MB  .eh_frame 2.28  .except 1.84

One codegen unit accounts for all of it; LTO changes nothing once it is
set, so fat LTO was buying only link time and peak memory on every
release target. The rebuilt APK confirms it: 57.49MB without LTO against
57.50MB with it.

What `codegen-units = 1` costs, from a clean aarch64 build on an
M-series: 5m54s against 4m15s, and 3.3GB peak RSS against 2.9GB. That
answers the review's question about the 75-minute Android and 45-minute
desktop step limits in nightly.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* perf: stop shipping vendored modules the bundler already embeds

Tauri embeds every file under `out/`, and `public/` is copied there whole. So
a module imported through a path alias that points into `public/` ships twice:
once bundled into a chunk, once as a published file nobody fetches. jieba cost
2.7MB that way; `@pdfjs/*` and `@simplecc/*` had the same shape.

Split the vendored assets by how they are loaded. What the reader fetches by
URL at runtime stays in `public/vendor/pdfjs` — the worker, the WASM decoders,
cmaps, standard fonts, the layer CSS, all built as runtime URLs in
foliate-js/pdf.js, which is why the bundler never emitted copies of them.
What the bundler imports moves to `vendor/` (outside `public/`):
`pdf.min.mjs` + its types, and the simplecc glue and WASM.

Measured on the embedded frontend, brotli as tauri compresses it: 23.7MB ->
16.96MB across this and the earlier jieba/turso fixes. That comes out of every
Tauri target, not just the APK.

The new test states the invariant that was broken rather than the three
symptoms: no tsconfig path alias may resolve into `public/`. It failed on
`@pdfjs/*` and `@simplecc/*` before this change.

Desktop stripping was measured and deliberately NOT done. On macOS it saves
4.76MB in the binary but only 1.44MB of DMG (36.59 -> 35.15MB), because a DMG
compresses symbol strings while an APK stores the .so uncompressed (verified:
`Stored`, 0%) — which is why Android got the full 22MB. Buying 1.4MB would
mean either a profile-level `strip`, which deletes the unstripped artifact
Sentry symbolicates Rust panics from, or pulling the release job apart from
tauri-action, which builds, bundles, signs and notarizes in one step. deb, rpm
and AppImage are compressed too, and MSVC keeps symbols in the PDB.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: init simplecc from the emitted WASM, not a URL that no longer exists

Moving the simplecc glue out of `public/` left `initSimpleCC` still asking for
`/vendor/simplecc/simplecc_wasm_bg.wasm`, a URL nothing publishes any more, so
Chinese variant conversion would fail to initialize at runtime. Caught in
review of #6368.

`init()` with no path uses the glue's default
`new URL('simplecc_wasm_bg.wasm', import.meta.url)` — the copy the bundler
emits and Tauri embeds — the same shape as the jieba fix.

The existing WASM-init test covered jieba only, which is why this slipped
through; it now covers both. Verified against a fresh build: the chunk
references `static/media/simplecc_wasm_bg.<hash>.wasm` and no runtime
`/vendor/simplecc` reference remains (the two textual hits left are the
bundled package.json script strings and a source-map path, and maps are
stripped before packaging).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 10:45:14 +02:00
Huang Xin
69c5afcb4e
feat(reader): give each wide comic page a spread of its own (#6210) (#6273)
* feat(reader): give each wide comic page a spread of its own (#6210)

A comic's double-page spread is usually stored as one wide image. Paired
with the next page it showed at half size and moved every later page onto
the wrong side. The reader now measures a CBZ's pages when it opens one
and lays out each page wider than it is tall as its own spread.

A wide page shifts the pairing of every page after it, so the pages are
measured up front from their image headers, not as they load:

- Tauri: a new `get_comic_page_sizes` command reads each entry's header
  in one pass (imagesize crate); 68 pages take 10 ms in release.
- Web: in-memory files are read 16 KB at a time from the local header,
  inflated with fflate until the size parses. Streamed files (URL, ABS)
  are left unmeasured, since each page would cost a request.
- Only the reader asks for it (`detectWidePages`), so import is unchanged.
- A wide cover keeps its own spread; "Separate Cover Page" no longer
  overrides it (`setCoverSpread`, shared by the viewer and the menu).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(reader): cap the inflated bytes kept when measuring a comic page

The web path limited only the compressed bytes read per page. Deflate can
expand about 1000x, so a crafted page could inflate to tens of megabytes,
all kept for the header parser. The header buffer is now a fixed 64 KB,
output past it is dropped, and the inflater is fed 1 KB at a time. The
native path was already capped: it takes from the inflating reader.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 15:30:31 +02:00
Huang Xin
730f68a6c1
fix(abs): stream audiobook tracks through a loopback media proxy so self-signed servers play (#6216) (#6268)
* fix(abs): add a loopback media proxy that streams with the API client's TLS policy

The ABS API client fetches through tauri-plugin-http with invalid certificates
accepted, but the WebView's <audio> element enforces platform TLS trust, so a
self-signed server syncs and then fails every track request in the handshake
(#6216). A custom URI scheme cannot bridge this on Android (the WebView
re-applies Range offsets to intercepted bodies and scheme responses are
buffered whole), so this is a hyper server on 127.0.0.1 started lazily by the
new get_media_proxy_base command: GET /<per-launch secret>/media?u=<track url>
forwards Range, fetches with the same lenient reqwest policy, copies the
content headers and streams the body. Wrong secret 404, non-http(s) or
credentialed targets 400, non-GET 405, unreachable upstream 502, with Rust
log lines (host and path only, never the token query) for upstream failures.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(abs): play audiobooks and paired tracks through the media proxy on native (#6216)

openAudiobookSession resolves track URLs through the loopback media proxy on
Tauri (null on the web and on iOS, whose AVPlayer clocks take the direct URL),
with the server's current token still inside the wrapped upstream URL. The
paired read-along tracks (absNarrationTracks via TTSController.resolveTracks)
and the pairing wizard preview take the same base, so a self-signed
Audiobookshelf server that synced also plays. getMediaProxyBase memoizes the
command result for the session and degrades to direct streaming, retrying on
the next open, if the proxy fails to start.

Verified on a Xiaomi against a self-signed HTTPS reverse proxy: the player
opens playing with no "Playback interrupted" toast, the upstream sees 206
range requests, seeks and chapter skips across files work.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(memory): record the #6216 media proxy investigation

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(agents): PR review workflow rule, trusted reviewers, social-engineering guard

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(abs): restrict the media proxy to configured server origins, add timeouts (#6216)

Addresses the CodeRabbit and CodeQL review of the loopback media proxy.

- SSRF (CWE-918): the proxy now takes a per-session origin allowlist and
  refuses (403) any u= target whose scheme://host:port is not one of the
  configured Audiobookshelf servers. The per-launch secret authenticates the
  caller; the allowlist authorizes the destination, so a leaked secret can no
  longer relay onto loopback or LAN services. get_media_proxy_base takes the
  origins and merges them each call, so a server added mid-session registers
  without restarting the proxy.
- The origins come from the in-memory store AND persisted settings, mirroring
  findABSServerById: the player route opens before the store is hydrated from
  settings, so reading only the store left the allowlist empty and the proxy
  refused the just-opened track (Xiaomi-reproduced).
- Disable redirects (Policy::none) so a hostile server cannot bounce a request
  past the allowlist. Bound the wait for a connection (connect_timeout) and for
  response headers (a 10s timeout around send() returning 504); the response
  body is never timed out so a long track stream is not cut.
- Tighten the PR-review-workflow rule (AGENTS.md + memory) so acting on a
  review is bounded to verified, in-scope findings.

Re-verified on a Xiaomi against a self-signed HTTPS server: 206 file requests
across chapters, seeks and chapter skips, no "Playback interrupted" toast; an
off-allowlist origin is refused with 403.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 14:33:03 +02:00
Huang Xin
7c8a0a468a
feat: support authenticated web novel imports (#6119)
* feat: reuse browser sessions for authenticated novel imports

* fix: preserve Windows domain cookies during session renewal

* docs: describe native browser session fetching

* fix: keep web novel import progress steady between chapters

* fix(test): hold curl overlay until capture assertions finish

* fix: address authenticated novel import review findings
2026-09-07 17:39:26 +02:00
Huang Xin
ee86510cca
chore: bump tauri to version 2.11.5 (#6081)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
* chore: bump tauri to version 2.11.5

* chore: update agent memories

* chore(nix): bump cargoHash for the tauri 2.11.5 lockfile

The fod-hashes check failed on the stale cargo vendor hash after
Cargo.lock was regenerated for the tauri fork bump. Take the hash from
the check's `got:` line. Also pass `--keep-going` to that nix build so a
single run reports every stale fixed-output hash instead of stopping at
the first one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(epub): decode UTF-16 BOM bodies with as_chunks

CI's stable clippy rejects `chunks_exact(2)` with a constant chunk size
(`clippy::chunks_exact_to_as_chunks`) now that the crate's MSRV is 1.90
and `slice::as_chunks` is available. Same behaviour: the trailing odd
byte of a malformed UTF-16 stream lands in the ignored remainder, which
the new test pins down.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* chore(nix): bump pnpmDeps hash for the tauri plugin package bumps

pnpm-lock.yaml changed with the @tauri-apps/plugin-* JS package bumps,
so the pnpm dependency fixed-output hash went stale. Value taken from
the fod-hashes check's `got:` line.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 22:32:30 +02:00
Huang Xin
655c72ad5a
feat(linux): ship Readest on the tauri CEF runtime (#6074)
* feat(linux): build and ship Readest on the tauri CEF runtime

Linux now builds against upstream tauri `feat/cef` (git) and the plugins on
plugins-workspace `feat/cef`, while macOS/Windows/mobile keep the readest
fork untouched:

- `pnpm tauri:cef dev|build` (scripts/tauri-cef.mjs) runs @tauri-apps/cli-cef
  with `--features cef`, cargo `--no-default-features` and the Linux-only
  `[patch.crates-io]` in src-tauri/.cargo/cef.toml, swapping the committed
  Cargo.cef.lock in for the run so Cargo.lock stays in the fork state.
- The fork crates are no longer workspace members (a member clashes on
  `links` with the git copy); the tauri-plugins fork carried no changes and
  is removed, tauri-plugin-fs comes from crates.io at 2.5.1.
- App: `cef = ["tauri/cef"]` (the fork gets a no-op stub), explicit runtime
  type, `cef_entry_point`, `--no-first-run` for CEF, commands generic over
  the runtime, xdg-portal dialogs on Linux (rfd's GTK thread crashes CEF),
  rangefile reads and pointer-driven move/resize on the Linux CEF runtime,
  Chromium reported in the About dialog, deb/rpm depend on libwebkit2gtk
  while plugins still pull the wry runtime.
- Build-generated permission files are untracked; turso registers `batch`.
- CI Linux legs use `pnpm tauri:cef`.

Submodules: packages/tauri -> feat/cef-feature-stub, tauri-plugin-turso ->
fix/register-batch-command (both need pushing).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* feat(linux): let the CEF wrapper run an unpacked tauri CLI for offline builds

Flatpak builds have no network, so `TAURI_CEF_CLI` points scripts/tauri-cef.mjs
at an unpacked copy of @tauri-apps/cli-cef instead of `pnpm dlx`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* chore(linux): take the CEF stack from the readest forks

- src-tauri/.cargo/cef.toml: tauri and the plugins now come from the readest
  forks' feat/cef branches (upstream feat/cef plus the DevTools-close fix in
  tauri-runtime-cef); Cargo.cef.lock re-resolved against them.
- tauri-plugin-turso: point at main, which merged the batch command fix.
- CI: STRACE_MODE=0 for the Linux legs so the CEF AppImage bundler
  (quick-sharun) does not launch the app under Xvfb and hang (#4906).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* feat(linux): make the CEF runtime the default tauri build on Linux

`pnpm tauri` now goes through scripts/tauri.mjs (the former tauri-cef.mjs):
on Linux its dev, build and bundle commands run the feat/cef tauri CLI
with the CEF feature, cargo config and Cargo.cef.lock swap, and every
other platform or command passes straight through to @tauri-apps/cli.
The separate `tauri:cef` script goes away, so the release and nightly
workflows, the local Linux build script and the docs use plain
`pnpm tauri build` again.

The tauri webdriver harness (scripts/test-tauri.sh) still calls the
`tauri` binary directly and keeps the wry runtime on Linux, since
tauri-driver needs WebKitWebDriver.

Cargo.cef.lock picks up the quick-xml 0.41 bump from main.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* chore(nix): refresh cargoHash for the reshaped Cargo.lock

Dropping the packages/tauri-plugins submodule and the tauri-plugin-fs
path patch changed the vendored cargo dependency set, so the Nix
fixed-output hash moves to the value the nix-deps-check job reported.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(linux): harden the CEF wrapper and pointer window drag

Review follow-ups on the CEF runtime work:

- scripts/tauri.mjs parks the wry Cargo.lock in Cargo.lock.wry, created
  exclusively, so two CEF commands in one checkout cannot swap lockfiles
  over each other, and a killed run leaves an obvious file to move back.
- The CEF runtime alias, entry point and runtime attributes are gated on
  Linux as well as the `cef` feature; elsewhere the feature is a no-op.
- Pointer-driven window move/resize applies the last pointer delta when
  the button is released before the pending animation frame, and does
  not start tracking when the button was already released while the
  window state was being read.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 20:09:06 +02:00
Huang Xin
c29a5f9868
fix: resolve dependency and code-scanning alerts (#6065)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
* fix: update vulnerable dependencies

* ci: pin release workflow dependencies

* fix(nix): refresh Rust dependency hash

* fix(nix): refresh pnpm dependency hash
2026-09-05 09:52:26 +02:00
Huang Xin
5a3ab1b47a
feat(bookdrop): AirDrop-style Nearby BookDrop with pairing, sounds, and resilient discovery (#6023)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
* feat(bookdrop): AirDrop-style picker, device pairing, receiver sounds

Rework Nearby BookDrop's device picker into an AirDrop-style sheet: an
identity header showing this device (its own type glyph) and the payload
cover, discovered peers as large circular avatars, an SVG progress ring on
the target during a send, and scanning ripples in the empty state. All
motion is CSS keyframes that disable under e-ink and prefers-reduced-motion.

Add device pairing: an incoming transfer from a TLS-cert-verified sender can
be trusted via an "Always accept from this device" checkbox, after which its
drops skip the confirmation dialog. Trust is keyed on the peer's cert
fingerprint, stored per device in localStorage, and managed from a Paired
Devices list in settings. Cert-less senders (the stock LocalSend app) can
never be paired and always confirm. Pairing is gated on the Customization
entitlement, following the TTS-cache paywall pattern.

Add transfer sounds, played on the receiver only (the sender watches the
progress ring): start, done, and fail cues behind a settings toggle, forced
off under e-ink, paired with haptics on mobile. Audio is unlocked on first
gesture to satisfy webview autoplay policy.

The Rust receive path now reports certVerified so the webview can gate
auto-accept on cert-verified senders only.

Verified on macOS and Xiaomi (Android), both send and receive directions:
discovery, accept dialog with pairing checkbox, pairing, auto-accept,
success toasts, receiver-only sound, Paired Devices management with Unpair,
and e-ink degrade.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(bookdrop): keep discovered peers present on multicast-hostile networks

A peer found by the initial unicast scan was kept alive only by multicast
answers on the picker heartbeat. Networks that carry the scan but drop
ongoing multicast (Xiaomi/MIUI power management, access points that filter
or rate-limit multicast) never deliver those answers, so the peer aged out
of the picker within seconds even while perfectly reachable.

Changes:
* Prune peers whose presence is unconfirmed past a 4.5s TTL, so a locked or
  backgrounded device drops out of the picker AirDrop style.
* On each heartbeat, re-probe every known peer over unicast in addition to
  announcing over multicast, so a reachable peer stays listed without
  sweeping the whole /24. Verified on macOS: a Xiaomi peer stayed present
  for ~60s of continuous heartbeats where it previously vanished after ~2s.
* Add a set_discoverable command and gate answering on screen lock and
  background, with the matching autogenerated permission and capability.
* Adapt to the updated localsend crate API (WebMode upload page,
  InterfaceFilter import path, ListenerFailed server event).
* Show the announced device name in the integrations row instead of "On",
  default to an AirDrop style "{{name}}'s Readest" alias, and translate the
  new Nearby BookDrop strings across all locales.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(nix): bump cargoHash for the localsend crate rev

The localsend git rev bump in Cargo.lock changed the cargo vendor
fixed-output derivation, so the pinned cargoHash went stale and the
fod-hashes check failed. Update it to the value the check reported.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(bookdrop): address code review findings on device picker and recovery

- DevicePickerDialog: guard the presence heartbeat against overlapping
  runs and stale writes, so a slow device read cannot clobber the frozen
  list after a send starts or the dialog closes.
- LocalSendManager: swallow the impactFeedback promise rejection, and
  restart a torn-down service on the next foreground instead of only
  re-announcing presence.
- service.rs: on ListenerFailed, tear the dead service down and report the
  server stopped, so it stops being advertised as reachable when it can no
  longer accept uploads.
- i18n: fix the Persian ezafe in the device alias and the Dutch/Polish
  verb forms in the transfer-sound toggle description.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-02 14:31:24 +02:00
Huang Xin
eee1a1e849
fix(android): avoid full PDF parsing during import (#5914)
* fix(android): avoid full PDF parsing during import

* fix(nix): update Cargo dependency hash

* refactor(pdf): colocate metadata parser

* chore(reader): re-pin foliate-js after #85
2026-08-28 11:30:16 +02:00
Huang Xin
c6a1901a53
fix(reader): move a paired audiobook by audio and decode WebP covers (#5863) (#5865)
* fix(reader): move a paired audiobook by audio and decode WebP covers (#5863)

A paired audiobook has chapter-level text timing only, so its narration
marks are whole chapters: the Next/Previous Sentence buttons (and the lock
screen's seek actions) skipped an entire chapter, and audio chapters that
had no EPUB chapter to map to (1.1, 1.2 ...) were never played at all.

- An unmapped audio chapter now plays as the tail of the mapped chapter
  before it in the same file, so the recording is heard in full and the
  page keeps following it proportionally.
- With a chapter-timed recording the transport moves by audio: the small
  step is the audiobook player's skip (30 seconds forward, 15 back, in
  recording time whatever the rate) and the large step walks the
  audiobook's own chapter list, restarting the current chapter on a late
  backward skip like every audiobook player. The page turns only when the
  target chapter is narrated by another mapped chapter. The mini player
  and player sheet swap in the player's glyphs and labels; the media
  session's seekforward/nexttrack handlers get this for free through
  forward()/backward(). The skip constants move to the PlaybackSource seam
  so both players share them.
- The Rust cover thumbnailer could not decode WebP covers ("The image format
  WebP is not supported"): enable the image crate's pure-Rust webp decoder.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore(nix): bump cargoHash for the image-webp crate

Cargo.lock gained image-webp with the image crate's webp feature, so the
pinned cargo vendor hash went stale and the Nix dependency check failed.
New value taken from that check's got: line.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(reader): describe chapter skips over the reachable audiobook chapters

narratedAudioChapters leaves out audio before the first mapped chapter of a
file, and adjacentAudioChapter never lands there, so the transport walks the
reachable chapters rather than the audiobook's whole chapter list.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-25 08:19:30 +02:00
Huang Xin
15b446dc75
feat(koplugin): LocalSend receive and send for KOReader devices (#5687)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
PR checks / test_web_app (1) (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
* feat(koplugin): scaffold localsend-ffi crate with start config

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): port localsend identity into ffi crate

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): add localsend ffi event queue and payloads

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(koplugin): fuse flaky event tests and add comprehensive wire-shape assertions

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): receive-only localsend service in ffi crate

Ports the receive side of apps/readest-app/src-tauri/src/localsend/service.rs
into the standalone localsend-ffi crate: the HTTPS server plus discovery
bind, a staging-dir file pipeline that stages uploads under
.localsend-inbox and renames them into download_dir on success, and an
event pump that feeds the Task 3 event queue instead of emitting Tauri
events.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(koplugin): sanitize peer-supplied file names before writing them

handle_file_upload joined the wire-supplied file name straight into the
staging and download paths. Protocol v2 allows directory components in
that field, so a peer could send a traversal payload or an absolute path
and write outside .localsend-inbox / download_dir.

Add safe_file_name, which takes the last non-relative path segment and
sanitizes it under the crate's strictest Rules::Universal set, falling
back to received.bin when nothing safe survives (empty name, "..", or
all separators). Use it for both the staging path and the final rename
target.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): expose localsend ffi c abi with smoke test

Adds the poll-based C ABI for KOReader's LuaJIT FFI: ls_version,
ls_start, ls_stop, ls_status, ls_poll_event, ls_accept, ls_decline,
and ls_string_free, all wrapped in catch_unwind with poison-safe
locking around a process-global service handle. Adds an ignored
smoke test that binds real ports and confirms a started event
and running status.

ls_string_free is marked unsafe extern C to satisfy clippy's
not_unsafe_ptr_arg_deref lint; this only affects Rust-side callers,
the exported C symbol is unchanged. Running cargo fmt with default
settings also reformatted events.rs and identity.rs from earlier
tasks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(koplugin): serialize event-queue tests and cover ffi idempotency

Adds a test-only TEST_QUEUE_GUARD mutex in events.rs so
event_queue_contract and ffi_surface_contract cannot interleave their
clear/push/pop calls on the process-global EVENTS queue when the test
runner uses parallel threads.

Extends the ignored smoke test with assertions that a second ls_start
while already running returns OK and leaves the service running, and
that a second ls_stop after a real stop also returns OK, since neither
idempotency contract had test coverage before.

Also tightens the crate doc comment and ls_string_free's Safety doc to
call out that ls_version's return value is a static string and must
never be passed to ls_string_free.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): add localsend native lib build script

Builds the LocalSend FFI crate into apps/readest.koplugin/libs/ for the
KOReader plugin. Supports arm64-mac (plain cargo build, verified on this
host) and armv7 (Kindle, via cargo-zigbuild, wired up in Task 7).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(koplugin): pin kindle glibc floor for armv7 localsend lib

Empirically verified the kindle userland glibc floor against the
koreader-kindle-v2026.07.1.zip release: every shipped .so and native
binary tops out at GLIBC_2.12 (koreader/libs/libzmq.so.5), lower than
the previously assumed 2.19, so lower KINDLE_GLIBC to match.

Also fix the cargo-zigbuild availability check, which always failed
because cargo forwards "zigbuild" as the subcommand name and that
subcommand rejects --version; probe the cargo-zigbuild binary
directly instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): localsend ffi loader with arch-keyed lib table

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): localsend receive service module with poll loop

Adds readest_localsend.lua: the module singleton that owns the native
LocalSend service lifecycle (start/stop/toggle), polls queued events on
a 0.5s UIManager loop, and routes them to per-type handlers (receive
request confirmation, file-done library registration, end-of-transfer
summary, status text for the settings row).

Also adds a ConfirmBox stub to koreader_stubs.lua and requires
spec.koreader_stubs from localsend_spec.lua so its stubs (InfoMessage,
ConfirmBox, NetworkMgr, UIManager) are registered before the new
dispatch spec requires readest_localsend, regardless of spec file load
order.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): wire localsend receive into menu and lifecycle

Adds localsend_enabled/localsend_alias settings, initializes the
readest_localsend singleton in init(), adds a toggle + status menu
entry after Pull books now, forwards network connect/disconnect and
suspend events to the service, and unschedules its poll task on
onCloseWidget.

addToReadest and _addLocalRow now take an opts table with a silent
flag that suppresses every InfoMessage on that path, so LocalSend's
onReceiveFileDone can register received files without popping
messages over the transfer dialog. The default no-opts call path is
unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): bundle localsend libs in plugin zip and release ci

Excludes native/ (Rust source) from the koplugin zip in both the local
build script and the release workflow, and adds a release CI step
that builds the armv7 LocalSend lib before zipping so libs/ ships in
published releases. build-koplugin.mjs now warns when libs/ is empty
so a local sideload build without prebuilt libs is not silent about
losing LocalSend receive.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore(koplugin): extract localsend i18n strings

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): build kobo hard-float localsend lib

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): offer kobo hard-float localsend lib in loader

Kobo devices are hard-float armv7 (gnueabihf), distinct from Kindle's
soft-float armv7 (gnueabi). Key libNameFor on Device:isKobo() so Kobo
loads liblocalsend-armv7hf.so instead of falling through unsupported;
Kindle and Kobo are unambiguous device classes, so no try-load
fallback is needed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ci(koplugin): build kobo hard-float localsend lib in release

The release workflow only built the Kindle softfp LocalSend lib, so
release zips never shipped liblocalsend-armv7hf.so for Kobo devices.
Add the armv7hf rustup target and a second build-localsend-libs.mjs
invocation to the existing CI step.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(koplugin): start localsend off the ui thread and fix accept race

ls_start ran identity keygen and socket bind synchronously on the
LuaJIT UI thread, freezing KOReader for several seconds on first run.
Move that work to a dedicated OS thread that owns the tokio runtime;
ls_start now returns immediately and ls_status gains a starting field
so Lua can poll for readiness. ls_stop likewise signals the worker
thread and detaches instead of blocking on shutdown.

Also fix service::accept registering the receiving session after
sending the Accept decision, which could race the first FileUpload
against its own session registration.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(koplugin): close identity keygen race and stale-failed start lockout

Concurrency review of the previous commit found five reachability
issues that only became possible once ls_start stopped blocking:

- Two overlapping ls_start workers (e.g. screen sleep mid-keygen then
  a quick stop/start) could both generate an identity.pem and race on
  create_new(), leaving the loser stuck on a File exists error instead
  of adopting the winner's cert.
- A failed start left STATE occupied by a dead LiveStatus::Failed
  entry forever, since ls_start's idempotent re-attach check never
  distinguished it from a genuinely running service, so retries
  (e.g. onNetworkConnected) could never restart the service.
- service::start ran off the UI thread now but outside catch_unwind,
  so a panic there would strand the worker with no event and
  LiveStatus stuck at Starting forever.
- The started event was pushed before LiveStatus flipped to Running,
  so a consumer reacting to it could still see running:false.

Also drops the now-redundant Option around Running.stop_tx (state()
already guarantees single consumption) and comments the narrow
inbox/event-queue overlap window between a detached worker's teardown
and the next ls_start.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(koplugin): harden localsend lua lifecycle and add crate ci

The started/error event handlers took a first parameter named `_`,
shadowing the module-level i18n function of the same name; the error
handler crashed uncaught the first time an async ls_start failed. Also
stop client-side polling on that failure so a later toggle can retry,
restart localsend on device resume, guard the accept dialog against a
stray tap dismissing it, normalize an empty download-dir setting, and
show a "starting" status during the async keygen/bind window.

apps/readest.koplugin/native/localsend-ffi had no PR-time CI at all;
add a paths-filtered job mirroring the existing rust_lint job's
toolchain setup and update the verification rules to match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): build arm64 linux localsend lib for remarkable

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): offer arm64 linux and remarkable localsend libs in loader

Wires liblocalsend-arm64.so and the reMarkable device class into
libNameFor: reMarkable 2 (hard-float armv7) maps to the same lib as
Kobo, reMarkable Paper Pro and other arm64 Linux e-readers map to the
new arm64 .so, and Android arm64 is excluded since its linker
namespace forbids dlopen of a plugin-bundled .so.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ci(koplugin): build arm64 linux localsend lib in release

Extend the release workflow's LocalSend native lib build step to also
build the arm64-linux target (reMarkable Paper Pro), alongside the
existing armv7 and armv7hf targets. build-koplugin.mjs already globs
libs/ so it ships the new .so without any change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore(koplugin): extract localsend arm64 and starting i18n strings

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(koplugin): harden localsend against suspend resume keygen races

Three defensive fixes for the localsend suspend/resume-during-first-run
keygen edge on slow e-readers:

- identity.rs: retry the AlreadyExists recovery read a handful of times
  instead of once, so a loser worker does not fail on a winner's
  identity.pem write that has not finished landing yet.
- lib.rs: spawn the ls_start worker via thread::Builder instead of
  thread::spawn, so an OS thread-creation failure surfaces as a queued
  Event::Error and ERR_START instead of a silent ERR_PANIC.
- readest_localsend.lua: the error handler now checks ls_status before
  stopping the service, so a stale error from a superseded overlapping
  worker cannot tear down an already-healthy service.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): replace localsend ffi cdylib with a helper binary

Old Kindles' glibc is missing symbols the precompiled Rust std pulls in
as weak (getrandom, statx, clock_gettime64), so the cdylib segfaults on
first call. A static-musl subprocess has no glibc dependency and was
verified running on that hardware. This step replaces the C ABI with a
localsend-helper binary that speaks newline-delimited JSON over a local
TCP control socket: a start command plus accept/decline/status/stop,
and started/receive_*/error/status events streamed back. lib.rs keeps
only the reusable config/events/identity/service modules; the musl
cross build, Lua spawn/socket glue, and packaging are follow-up work.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): build static musl localsend helper binaries

Rewrite build-localsend-libs.mjs as build-localsend-bins.mjs: it now builds
the localsend-helper standalone binary (static musl for armv7/arm64, plain
cargo for macos) into apps/readest.koplugin/bin/ instead of the old FFI
cdylib into libs/. Static musl has zero glibc dependency and no
softfp/hardfloat split, so the four old glibc-pinned targets collapse into
three binary targets with the exec bit set on the copied artifact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): spawn localsend helper binary over a local socket

Replace the FFI cdylib transport in the koplugin LocalSend integration
(ffi.load + ls_* calls), which crashed on old-glibc Kindles, with the
static-musl localsend-helper binary spawned as a background process and
driven over a local TCP control socket speaking newline-delimited JSON.

library/localsend_ffi.lua becomes library/localsend_helper.lua: pure
binaryNameFor (device to binary filename) and parseLines (socket buffer
to decoded events, no socket/os dependency) plus socket wrappers
(pickPort, spawn, connect, send, recvChunk).

readest_localsend.lua keeps its handlers/dialogs/lifecycle shape as a
process-level singleton that owns the socket across KOReader context
switches; only the FFI calls become socket sends and a non-blocking poll
that frames and dispatches decoded events, adding a status handler that
caches alias/port/localIps/multicastError for statusText().

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): package static musl helper binaries in plugin zip and ci

build-koplugin.mjs and the release workflow still referenced the retired
libs/ dir and build-localsend-libs.mjs script from the FFI cdylib era.
Point both at bin/ and build-localsend-bins.mjs, and rebuild the release
CI step around the two static-musl targets (armv7, arm64) instead of the
old three-way gnueabi/gnueabihf/arm64-linux split.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): open the kindle firewall for localsend ports on start

Kindle firmware runs iptables with INPUT policy DROP and only allow-lists
explicit ports (KOReader's SSH plugin opens 2222 the same way), so
LocalSend's TCP 53317-53327 server range and UDP 53317 multicast
discovery were unreachable from other devices even though the service
was running. Add library/localsend_firewall.lua, ACCEPT the LocalSend
ports on service start and remove them on stop, matching kaikozlov's
localsend_firewall.lua and KOReader's own SSHPlugin. Gated on iptables
being present and working rather than Device:isKindle(), so it also
covers other DROP-policy devices and safely no-ops where iptables is
absent.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(koplugin): keep localsend poll alive across context switches and refresh filemanager

The receive event poll belonged to the singleton service but was torn down
on a per-instance onCloseWidget, racing the next init's re-attach and
stranding the service with no live poll (incoming transfers silently
ignored). Make the poll service-lifecycle-owned. Also refresh the KOReader
FileManager on receive completion so a received book appears without leaving
and re-entering the folder.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): add send flow (list devices, send, cancel) to the helper

Ports the send side of the desktop app's LocalSend service (device_payloads,
run_send, and the cancel plumbing) onto the koplugin helper binary, which
was receive-only. Adds three control-socket commands (list_devices, send,
cancel_send) and three queued events (devices, send_progress, send_end).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(koplugin): add send with localsend file action and device picker

Adds the SEND-side UI on top of S1's helper protocol: a "Send with
LocalSend" file-menu button in FileManager (gated on supported book
formats and helper availability), a ButtonDialog device picker driven
by list_devices, and send progress/result InfoMessages driven by
send_progress/send_end. Includes Helper.deviceLabel, a pure formatter
for the picker's device rows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* build(koplugin): pin localsend fork to 3cae1825 for best-effort SO_REUSEPORT

Older e-reader kernels (Kindle Voyage on 3.0.35) reject SO_REUSEPORT with
ENOPROTOOPT, and the fork previously propagated that error, which disabled
multicast discovery for the whole device. Bump the readest/localsend pin
to 3cae1825 (set_reuse_port made best-effort) in both the koplugin helper
crate and the src-tauri app, and drop the temporary local path override
used while testing the patch. The app lockfile also refreshes some
Windows-only transitive deps to their latest compatible versions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(koplugin): register HTTP peers so iOS and Android appear in localsend scan

The helper no-oped ServerEventV2::Register, assuming the discovery crate
added registered peers on its own. Peers that answer a scan over HTTP
/register (iOS, which cannot multicast without the entitlement, and
Android) were therefore never added to the device list, so KOReader only
ever discovered multicast responders such as macOS.

Intercept Register in the event pump and feed the peer into the discovery
store via a ported register_peer(), skipping a device's own scan probes by
fingerprint. Mirrors the Tauri app's src-tauri/src/localsend/service.rs.
Verified on a Kindle: the Android peer now appears in list_devices.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(koplugin): send from the library menu and tag devices by platform

Add a "Send to nearby Readest devices" action to the Readest Library
long-press menu (parity with the FileManager file dialog), gated on the
book having a local copy and a helper binary being available. Show the
peer platform (e.g. macOS, Android) as a tag in the device picker label,
matching the app's device picker. Rename the FileManager actions to
"Add to Readest library" and "Send to nearby Readest devices", and
re-extract the koplugin translation catalogs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* refactor(koplugin): rename localsend-ffi crate to localsend-bin

The crate stopped being an FFI cdylib when the transport moved to a
static-musl helper binary reached over a local socket; there is no C ABI
anymore, so "ffi" is a misnomer. Rename the crate and its lib, the
directory, the build-script crate path, the koplugin_rust_lint working
directories, the verification rule, and the gitignore target path. The
produced binary is still localsend-helper, so nothing the plugin spawns
or ships changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* i18n(koplugin): translate the LocalSend strings into all locales

Fill the 31 previously-empty LocalSend msgstr entries (send/receive menu
actions, device picker, and status/error messages) across every koplugin
translation catalog. Product names (Readest, LocalSend, KOReader, Wi-Fi)
stay in Latin script and the %1/%2/%3 placeholders are preserved verbatim.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 19:47:27 +02:00
Huang Xin
c5a2c7bc17
fix(localsend): let Readest devices discover each other (#5626)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
PR checks / rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
Readest peers could not see each other while the LocalSend app saw
everyone. Three causes, verified on macOS + Xiaomi hardware:

- The upstream client honors the OS system proxy (reqwest system-proxy),
  and reqwest never exposes TlsInfo on proxied connections, so on a
  machine with a configured proxy every HTTPS register failed with
  'TLS info not found' and discovery stayed empty. Fixed in the
  readest/localsend fork (rev bump) by disabling proxies for LAN
  requests.
- Peers answering our announcement register with our HTTP server, but
  the Register server event was dropped, so the announcing side never
  learned who answered. Feed it into the discovery store now.
- The subnet-scan fallback probed only 53317, where a Readest peer
  never listens; it now probes 53318 as well.

Also in this change, verified in both directions on hardware:

- Show this device's '#<ip-octet> <os>' tag in the LocalSend settings
  and tag discovered devices in the picker (VPN tunnel interfaces are
  excluded), so users can tell peers which entry to pick when aliases
  collide.
- Embed a downscaled cover as the LocalSend file preview when sending
  books, and render peer-supplied previews in the accept dialog
  (base64 sanitized and size-capped before display).
- Raise the receive dialog above the device picker so an incoming
  request is never hidden under an open picker sheet.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 11:50:00 +02:00
Huang Xin
ca5acd0399
fix(ci): stop cargo pulling the flutter SDK for the localsend dep (#5622)
Nightly failed on both Windows arches while checking out the localsend
git dependency:

  path too long: 'C:/Users/runneradmin/.cargo/git/checkouts/
  localsend-347f023daa6e6a88/ff2995c/support/submodules/flutter/dev/
  integration_tests/android_engine_test/android/app/src/main/kotlin/
  com/example/native_driver_test/fixtures/
  BlueOrangeGradientSurfaceViewPlatformViewFactory.kt';
  class=Filesystem (30)

Cargo recursively initializes and updates every submodule declared by a
git dependency. It cannot fetch only packages/core, so upstream's single
.gitmodules entry drags in the whole Flutter SDK: 552 MB checked out, and
on Windows those Flutter paths exceed MAX_PATH so the checkout fails.
macOS, Linux and Android passed only because they have no path limit;
they still paid the download.

Cargo does honor a submodule update strategy of "none", so source the
crate from readest/localsend instead. That fork's only delta against the
pinned upstream rev is one line adding "update = none" to the flutter
submodule; packages/core is byte for byte identical, so the compiled
crate does not change. Cargo now reports:

  Skipping git submodule `https://github.com/flutter/flutter.git`
  due to update strategy in .gitmodules

and the checkout drops from 552 MB to 39 MB on every platform.

When bumping localsend, rebase that one commit onto the new upstream rev
in the fork and re-pin here; pointing back at localsend/localsend brings
the Windows failure back.
2026-08-11 02:43:06 +02:00
Huang Xin
27615797ee
feat(localsend): send and receive books over the local network (#5611) 2026-08-10 18:55:20 +08:00
liyafly
394ecd3986
fix(macos): restore close-to-hide on Tahoe (#5240) (#5333) 2026-07-26 07:15:50 +02:00
Huang Xin
c37d7eb2b3
fix(sentry): drop the minidump crash reporter, it re-execs our own binary (#5112)
`tauri-plugin-sentry`'s `minidump` feature starts an out-of-process crash-reporter
server by re-exec'ing our own main executable with `--crash-reporter-server=<socket>`
(sentry-rust-minidump -> minidumper-child -> crash-handler). That single behavior has
broken the app at launch three times in the two weeks since it shipped:

- #5052: when the server fails to start, `minidump::init` returns an error rather
  than exiting from inside, so the re-exec'd process fell through into a full second
  copy of the app: a duplicate window, dock icon and webview next to the user's real
  one. 1106 users on 0.11.18 reported a webview error whose argv carries the flag
  (READEST-Y). PR #5107 stopped that process booting the UI; this removes the cause.
- #5053: a sandboxed app can never re-exec itself, so the Mac App Store build aborted
  in dyld before `main()`.
- #5070: crash-handler's `pthread_create` interposer panics on 32-bit ARM, aborting
  every armeabi-v7a device at launch.

What it bought: about 49 native crash events a month, nearly all unsymbolicated
WebKit / WebView2 frames we cannot act on. Sentry keeps Rust panics, every WebView
error and native mobile crashes (sentry-android / sentry-cocoa) without it, so the
feature is now off on every target. The re-exec, the child process, the ~3s startup
stall it caused and 15 transitive crates all go away, and with them the App Store
sandbox gate (#5053) and the crash-reporter argv guard (#5107), which have nothing
left to guard.

Bringing native desktop dumps back means shipping a separate helper binary, never a
re-exec of our own. `minidump_feature_is_enabled_on_no_target` guards the manifest so
the plugin's default feature set cannot quietly reintroduce it.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 17:28:32 +02:00
Huang Xin
58d4661b74
feat(ios): CarPlay support and native TTS playout with Now Playing integration (#5085)
* feat(ios): add CarPlay support for TTS

Surface active TTS sessions on Apple CarPlay, mirroring the Android Auto
integration. A CarPlaySceneDelegate presents a CPListTemplate root
showing the currently reading book (or a placeholder when idle) and
pushes the system Now Playing template. Transport and metadata ride the
existing MPNowPlayingInfoCenter / MPRemoteCommandCenter path, so no
CarPlay button is routed by hand. A new iOS-only update_carplay_state
command lets the media bridge report session start and stop, and TTS
autoplay deep links are consumed even when the target book is already
mounted, for example when the app cold restores straight into the
reader.

Registering the UIApplicationSceneManifest crashed the app at launch on
real devices: tao's configuration_for_connecting_scene_session returned
a raw borrow of a Retained UISceneConfiguration it immediately dropped,
so UIKit retained freed memory. Add the tao fork as the packages/tao
submodule (github.com/readest/tao, branch readest-0.35: tao 0.35.3 plus
only the callback returning an autoreleased strong reference) and patch
it in the workspace. Bump @tauri-apps/api to 2.11.1 and @tauri-apps/cli
to 2.11.4 for the tao 0.35/wry 0.55 stack, and advance the tauri fork
(branch readest-2.11) with a guard in the generated unlisten script
against already-removed listeners.

The tauri 2.11 stack needs two CI accommodations. First, the
build_tauri_app job overrides setup-rust-toolchain's default RUSTFLAGS
of -D warnings: cargo builds path-patched dependencies without
cap-lints, so upstream warnings in the tao fork (deprecated glib
channel calls in the Linux backend) would fail the app build; warnings
in our own crate stay enforced by the rust_lint job. Second, tauri 2.11
enforces ACL for IPC from remote origins even without an AppManifest
(upstream security fix #15266), and the webdriver harness serves the
vitest tester page from its own port, which is a remote origin, so
every custom app command was denied and 56 tauri tests failed.
Production is unaffected since real app pages are local origins.
Declare the app commands in the ACL app manifest in build.rs (generated
allow permissions committed under src-tauri/permissions/autogenerated),
grant them in capabilities/default.json for local windows, and add a
webdriver-remote capability for localhost remote origins that is pinned
out of shipped builds via app.security.capabilities in tauri.conf.json;
scripts/test-tauri.sh opts into it with a --config override. Verified
with pnpm test:tauri: 112 passed, 1 skipped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(android): handle audio focus properly for background TTS

Request focus with a modern AudioFocusRequest (USAGE_MEDIA,
CONTENT_TYPE_SPEECH) and pause instead of ducking, matching how spoken
audio should yield to navigation prompts. Resume after transient loss
only when the loss is what paused us, forward focus transitions to the
web side as media-session play/pause events, and pause on
ACTION_AUDIO_BECOMING_NOISY so unplugging headphones does not blast the
speaker.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(ios): native audio playout for Edge TTS with Now Playing support

WebAudio in WKWebView renders in WebKit's GPU process under an audio
session the app cannot own, which made every system media behavior
unreliable on device: no lock-screen card, the card vanished on pause,
AirPods resumed another app, and the mute switch silenced playback.

Play the Edge TTS utterances with an in-process AVPlayer instead. The
native-tts plugin gains a deliberately dumb playout engine
(playout_enqueue, playout_control, playout_position) and the new
NativeAudioPlayer mirrors the WebAudioPlayer session interface, so
EdgeTTSClient just picks the player per platform. Word highlighting
reads the player's media clock, which AVPlayer reports in item time and
is therefore unaffected by the playback rate; rate changes stay pitch
preserving via the timeDomain pitch algorithm and inter-sentence gaps
run on a native timer immune to background JS throttling.

With the audio in the app process the plugin claims a non-mixable
.playback session with .spokenAudio mode, so navigation prompts pause
instead of duck. Handle interruption began and ended with shouldResume,
pause on route change to the speaker, and bind an MPNowPlayingSession
to the playout player so the paused state is reported explicitly and
the Now Playing slot survives a pause. The silent keep-alive player
pauses in lockstep, KVC playback state writes are simulator only where
they are required and harmful on device, and the mixWithOthers
use_background_audio calls are removed. On the web side the composite
iOS media session mirrors metadata and position into
navigator.mediaSession, remote commands map to directional play and
pause plus a toggle, and the silent unblocker element is skipped on iOS
Tauri since a playing HTMLMediaElement makes WebKit register its own
competing now-playing client.

Volume-key page flip previously defeated all of this: its handler
unconditionally reconfigured the shared session with .mixWithOthers,
and a mixable session is ineligible for the Now Playing slot, so
pausing TTS dismissed the card and handed AirPod controls to another
app. The two plugins now coordinate through in-process notifications:
native-tts announces claim and release of the audio session, and the
volume key handler leaves the session untouched while TTS owns it, so
volume keys keep flipping pages during a pause without losing the card,
and re-owns the session after TTS teardown regardless of ordering.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 10:53:31 +02:00
Huang Xin
75f1fafe9f
feat(reader): slide and page curl turn animations (#555) (#4940)
* feat(reader): slide and page curl turn animations (#555)

Add an Animation Style setting (Push, Slide, Page Curl) next to the
Paging Animation switch. Slide moves the turning page over the still
previous or next page like the Apple Books slide; Page Curl folds it
open in 3D so the page underneath is partially visible as it turns.
Both styles track the finger: the page follows a horizontal drag and
commits past halfway or on a flick, or settles back. The page header
and footer stay in place while the page turns.

The styles layer a View Transitions snapshot of the outgoing page over
the live, stationary incoming page, since the pages of one section live
in a single iframe and can never be on screen twice. They work for all
writing modes including vertical-rl, and on engines without the View
Transitions API (older WebViews) the paginator falls back to the
existing push animation, so all platforms keep working page turns.

The paginator changes live in the foliate-js submodule; this bumps the
pointer, wires viewSettings.pageTurnStyle to the renderer turn-style
attribute, and adds browser tests covering slide layering, curl,
vertical-rl, finger tracking with commit and revert, and the push
fallback.

Fixes #555

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(reader): add WebGL page curl renderer for mesh turn animations (#555)

Grid mesh deformed around a cylinder: content past the fold wraps over
and lands mirrored on top with a whitened page back, transparent where
the page has curled away. Corner grabs start as a steep diagonal pinch
that straightens as the turn completes so the whole page clears by the
end. Groundwork for the Tauri mesh curl; capture and orchestration land
separately.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(native-bridge): capture webview region as PNG on macOS and iOS (#555)

New capture_webview_region plugin command returns a binary PNG snapshot
of the calling webview (tauri::ipc::Response, no JSON overhead) for the
mesh page-curl texture. macOS goes through WKWebView
takeSnapshotWithConfiguration via with_webview on the main thread with
a 500ms timeout; iOS snapshots in Swift and hands the PNG across the
JSON-only plugin boundary base64-encoded, decoded back to bytes in
mobile.rs. Windows, Linux, and Android reject for now so the JS side
falls back to the CSS curl.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(reader): drive the mesh page curl on Tauri platforms (#555)

Wire the WebGL curl renderer and the native webview capture into page
turns. A MeshCurlTurn controller runs the pipeline per turn: snapshot
the content box, overlay the captured page drawn flat, turn the live
view instantly underneath (the paginator's animated paths all gate on
the animated attribute), then curl the capture away. Backward turns
mirror the fold to the spine edge, matching the layered VT curl's
old-page-recedes choreography.

useMeshPageCurl wraps the view's prev/next so taps, keys, and wheel
turns all curl, and registers a touch interceptor (between the reading
ruler and the fixed-layout swipe) that scrubs the curl from the finger,
committing past halfway or on a flick and otherwise un-curling and
turning back under the overlay. The paginator stays out of the way via
no-swipe while the mesh is active; if the native capture ever fails the
session falls back to the paginator's CSS arc-fold curl and the shared
applyPageTurnAttributes helper restores turn-style.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(build): restore iOS builds on Xcode 26.2 with a vendored swift-rs

Swift 6.2's driver no longer honors swift-rs 1.0.7's cross-compilation
style (swift build --arch <host> with per-swiftc -target overrides and
an inherited SDKROOT): plugin sources compile against the wrong
platform's Swift overlays and fail with baffling errors like type
'Bundle' has no member 'main' and extra argument 'privacy' in call.
Upstream swift-rs is unmaintained, so vendor it under packages/swift-rs
via a crates-io patch and build with SPM's first-class --triple/--sdk
flags instead, dropping the leaked SDKROOT so the host-targeted
manifest compile stays clean. Artifacts land in the unversioned-triple
directory now, so the link search path follows.

With --triple, SPM enforces the deployment floor declared in
Package.swift (the old override bypassed it): bump native-bridge to
iOS 15.0, matching the app's deployment target, since StoreKit's
Storefront is used unguarded.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(native-bridge): capture webview region on Android via PixelCopy (#555)

Implements the Android side of capture_webview_region so the mesh page
curl works there too. The Kotlin command scales the CSS-pixel rect by
the display density, offsets it by the webview's window position, and
reads the pixels back from the window surface with PixelCopy (API 26+,
the app's minSdk), which includes the hardware-accelerated WebView that
View.draw would miss. PNG encoding runs off the main thread and the
result crosses the JSON plugin boundary base64-encoded, decoded back to
bytes in mobile.rs like iOS.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(reader): right the upside-down page curl on iOS (#555)

The renderer oriented its texture with UNPACK_FLIP_Y_WEBGL, which WebKit
ignores for ImageBitmap uploads: on iOS the captured page rendered
upside down, and the mirrored page back read as rotated 180 degrees
instead of the ink-through-paper horizontal mirror Apple Books shows.
Upload unflipped and sample page coordinates directly so no pixel-store
flag is involved.

The page texture in the browser test was only horizontally asymmetric,
which is how the flip slipped through; it now uses four quadrants fed
through the production PNG-blob-to-ImageBitmap path and pins the
vertical orientation. Verified red/green by running the suite on
Playwright WebKit, which reproduces the iOS behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(reader): curl the whole page including header, footer, and margins (#555)

The mesh curl captured only the margin-inset content box, leaving the
running header, footer, and page margins static while just the text
column turned. A physical page turn takes the whole sheet with it, as
Apple Books does, so the capture and overlay now span the full reader
cell. The overlay mounts above the in-cell header (z-10) and footer, so
the static copies never show through the turning page.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(reader): gate layered View Transition turns and slide from a capture instead (#555)

iOS 18 WebKit ships document.startViewTransition but crashes the WebContent
process when a page-turn transition snapshots the reader, so the mere
presence of the API is not enough for the layered slide/curl turns. Require
nested view-transition groups (Chrome/WebView 140+) as the marker of a
mature engine before setting turn-style on the renderer.

Engines that fail the check no longer lose the slide on Tauri: the mesh
curl's capture pipeline generalizes to CapturedPageTurn and now also drives
a flat slide overlay (capture the outgoing page, turn instantly underneath,
translate the captured page out toward the spine, mirrored for backward
turns), clipped to the content box with an edge shadow like the VT slide.
On the web, engines without full support fall back to push and the
Slide/Page Curl options are hidden from the Animation Style select; a
synced slide/curl setting from another device reads as Push there.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(reader): make the Android page curl start instantly (#555)

The Android capture encoded a full-density PNG: 1080x2400 on a 3x
Xiaomi 13 took ~1.5s per turn, so the page sat frozen long enough to
read as the curl not working at all. Encode JPEG instead (the page is
opaque) and cap the destination bitmap at 2x CSS pixels - PixelCopy
scales into a smaller bitmap for free and the moving page stays sharp.
Measured on device over CDP: the capture invoke drops from 1550ms to
34ms and the curl overlay mounts 132ms after the tap.

The JS side stops hardcoding an image/png blob type and lets the
decoder sniff the platform's actual format.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* perf(reader): encode iOS page-curl captures as capped JPEG (#555)

Apply the Android speedup to iOS: encode the snapshot as JPEG (the
page is opaque) off the main thread, and cap it at 2x CSS pixels via
WKSnapshotConfiguration.snapshotWidth on 3x screens, cutting both the
encode time and the base64 payload crossing the JSON plugin boundary.
The JS side already sniffs the image format from the bytes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 20:49:57 +02:00
Huang Xin
967a7833ca
feat(sentry): add crash reporting for Android, iOS, desktop, and web (#4914)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
PR checks / rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
Report crashes and unhandled errors from every layer to one Sentry project via a
single build-time SENTRY_DSN (empty => disabled, so local and fork builds do not
report):

- JS/WebView + Rust panics via tauri-plugin-sentry (rustls transport; minidump
  handler desktop-only).
- Android native (JVM/NDK/ANR) via sentry-android 8.47.0 with manifest auto-init
  (excludes the discontinued lifecycle-common-java8 transitive).
- iOS native via sentry-cocoa started from a tracked SentrySupport/+load bootstrap
  that reads the DSN from a Rust readest_sentry_dsn() FFI (no generated-file edits).
- SENTRY_DSN resolved at build time from the environment, then .env.local, then
  .env (build.rs bakes it via cargo:rustc-env; build.gradle.kts for Android). CI
  passes the SENTRY_DSN secret through the existing .env.local step.

Crashes + errors only: traces sample rate 0, no session replay, no PII.
Symbolication (source maps / ProGuard / dSYM upload) is a follow-up.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 17:26:26 +02:00
Huang Xin
7da41a65ad
feat(widget): add mobile home-screen reading widgets (#1602) (#4842)
Add a resizable home-screen widget on iOS and Android showing recent
in-progress books with cover, reading progress, and tap-to-open.

- One responsive widget: Android resizable 1x1 to 4x3 (one book per
  column, up to 3); iOS Small/Medium/Large families. Covers are cropped,
  rounded, with a percent badge and a progress bar (baked into the bitmap
  on Android, SwiftUI overlays on iOS).
- TTS controls (previous, play-pause, next) appear in 2+ row sizes when
  TTS is active, wired to the existing media session. Reading progress
  stays live during background TTS via a fraction computed from the baked
  offline locations.
- Publishes a snapshot plus downsized cover thumbnails to the iOS App
  Group and Android SharedPreferences through a new update_reading_widget
  native-bridge command; refresh is debounced and driven by library and
  progress changes, TTS, and app backgrounding.
- Tapping a cover opens readest://book/{hash}, switching the reader in
  place when one is already open.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 18:03:16 +02:00
Huang Xin
7e78f80e14
feat(sync): Google Drive cloud sync + premium Third-party Cloud Sync section (desktop) (#4821)
* feat(sync): add Google Drive file-sync provider core

Second FileSyncProvider for the merged provider-agnostic file-sync engine,
behind the provider seam. This is the CI-testable core only: no settings UI
and no platform OAuth runners yet (those land in later phases).

- GoogleDriveProvider over the Drive v3 REST API: id-addressed path
  resolution with a per-instance id cache, create-then-name uploads, real
  idempotent ensureDir, files.list pagination, Retry-After-aware 429/5xx
  backoff, per-path folder-creation locks with deterministic duplicate
  collapse, stale-id eviction, and FileSyncError mapping (403 split into
  rate-limit vs permission).
- DI OAuth layer: pkce, parseRedirect (redirect-target + CSRF state),
  reverseDnsRedirect, tokenStore (iOS client, no secret), oauthFlow.
- PersistedDriveAuth with single-flight token refresh; keychain-backed
  token store with no ephemeral fallback for the refresh token; account
  label via about.get.
- providerRegistry (backend kind to provider) and buildGoogleDriveProvider
  assembly.
- Shared transport-agnostic provider semantic contract, run against both
  WebDAV and Drive.
- Keyed secure-KV bridge contract (set/get/clear_secure_item); the native
  keychain implementation lands with the desktop OAuth slice that first
  exercises it.

Adapted from ratatabananana-bit/Readest-google-drive-mod-patcher (AGPL-3.0)
with the author's explicit permission.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(sync): multi-provider file-sync settings + sync-state foundation

PR2 foundation for a second file-sync backend (Google Drive). The
behaviour-sensitive reader-hook and Sync-now form generalization land in
PR3 alongside OAuth, where Drive actually connects and the multi-provider
paths can be exercised and live-verified (and the extracted form gets its
second consumer, avoiding a single-use abstraction).

- GoogleDriveSettings type (mirrors WebDAVSettings minus URL/credentials/
  rootPath, plus accountLabel) wired into SystemSettings, with
  DEFAULT_GOOGLE_DRIVE_SETTINGS in the defaults.
- googleDrive.deviceId + googleDrive.lastSyncedAt added to the backup
  blacklist so device-local sync identity / cursors never restore onto
  another device. Covered by the existing backup-settings test.
- Generalize webdavSyncStore into fileSyncStore: per-backend progress keyed
  by provider kind, plus a global library-sync mutex (beginSync returns
  false when another backend already holds the lock) since every backend's
  syncLibrary mutates the same local library. Migrate WebDAVForm and
  IntegrationsPanel to the keyed API; WebDAV behaviour is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(native-bridge): add keyed secure key-value store commands

A generic, keyed secret store over the same OS keychain backends as the
sync passphrase (set/get/clear_secure_item), so secrets that aren't the
single sync passphrase get the same XSS-free cross-launch persistence
without each needing its own native command. The Google Drive OAuth token
store (PR1's KeychainTokenPersistence) is the first consumer; a future
cloud provider's refresh token reuses it.

- Desktop (macOS/Windows/Linux): keyring-core, keyed by the item key as
  the entry account under the existing "Readest Safe Storage" service.
- Android: EncryptedSharedPreferences (a dedicated readest_secure_items_v1
  file, the item key as the pref key).
- iOS: Security framework Keychain (kSecClassGenericPassword, dedicated
  service, the item key as kSecAttrAccount).

Registered in the plugin invoke handler + build COMMANDS + default
permission set (autogenerated permission files regenerated; the passphrase
entries are preserved). The TS bridge wrappers shipped in PR1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(sync): desktop Google Drive OAuth runner + connect flow

The desktop half of Drive sign-in: open consent in the system browser, capture
the reverse-DNS redirect the OS routes back, and exchange the code for tokens.

- oauthDesktop.ts: runDesktopDeepLinkOAuth wires the DI OAuth flow to the
  desktop mechanics (open default browser, capture via single-instance /
  onOpenUrl, cold-browser fallback after a grace period, hard deadline). Fully
  headless-unit-tested via injected deps.
- spawn_fresh_browser.rs (+ registration, Windows-only winreg dep): the cold
  browser the runner falls back to when the user's already-running browser
  snapshotted protocol associations before the scheme was registered (a
  Windows-specific failure). Resolves the default browser from the registry and
  spawns it cold with an isolated --user-data-dir; a no-op on macOS/Linux where
  the default-browser open already routes the redirect. Pure helpers unit-tested.
- connectGoogleDrive.ts: run the platform OAuth runner, persist the token
  (fail-loud — Drive is not reported connected if the refresh token does not
  save), and resolve the account label via about.get (best-effort).

OAuth runner adapted from ratatabananana-bit/Readest-google-drive-mod-patcher
(AGPL-3.0) with the author's permission. Scheme registration + the ingress
redirect filter + the Drive connect UI land in the following commits; live
desktop verification follows once the official Google client id is provisioned.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(sync): filter Google OAuth redirects out of the deep-link ingress

The reverse-DNS OAuth redirect (com.googleusercontent.apps.<id>:/oauthredirect)
is delivered through the same single-instance / onOpenUrl channels as book-file
deep links. Without a filter the book-import consumer would treat the redirect
URL as a file path to open. Drop it at the ingress source (useAppUrlIngress)
before the app-incoming-url broadcast, so no consumer ever sees it; the Drive
sign-in runner still captures it via its own listeners.

isGoogleOAuthRedirectUrl matches the scheme prefix (not a specific client id),
so it stays correct regardless of which client is baked into the build.

Note: registering the scheme in tauri.conf.json (so the OS routes it back to the
app) needs the official Google client id, which is a provisioning prerequisite.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(sync): bake the official Google Drive OAuth client id + redirect scheme

Provisioned the Readest Google Cloud OAuth client (iOS application type, no
secret, drive.file scope). Bake the client id as the default in
getGoogleClientId (overridable via NEXT_PUBLIC_GOOGLE_CLIENT_ID for forkers,
who must also regenerate the manifest schemes) and register the derived
reverse-DNS redirect scheme com.googleusercontent.apps.<id> in tauri.conf.json
(desktop + mobile deep-link) so the OS routes the OAuth redirect back to the
app. The client id is a public client identifier, not a secret.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(sync): Google Drive connect UI + shared FileSyncForm

Make Drive usable from Settings, and extract the now-two-consumer sync controls.

- FileSyncForm: the provider-agnostic sync controls (sub-toggles, conflict
  strategy, manual "Sync now" with progress + result toast), parameterised by
  backend kind and building the provider through the registry. Extracted from
  WebDAVForm now that a second consumer exists. WebDAVForm keeps its
  URL/credentials connect panel + browse pane and renders FileSyncForm for the
  sync section; behaviour is unchanged (WebDAV "Sync now" goes through the same
  provider via the registry).
- GoogleDriveForm: an OAuth connect panel (Connect -> runGoogleDriveConnect ->
  store token in keychain -> "Connected as <email>"; Disconnect) + FileSyncForm.
- googleDriveConnect.ts: assemble the env client id + keychain + desktop runner
  into connectGoogleDrive/disconnectGoogleDrive for the UI.
- IntegrationsPanel: a "Google Drive" row + sub-page, shown only on desktop
  (mobile OAuth runners land in later phases).

Reader-side auto-sync (generalizing useWebDAVSync) is a follow-up; manual
"Sync now" already exercises the full Drive stack. Full suite 6412 green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(settings): unified Third-party Cloud Sync section (exclusive provider)

Group WebDAV + Google Drive into a new "Third-party Cloud Sync" section and make
them mutually exclusive — only one cloud provider syncs the library at a time.

- New unified "Cloud Sync" sub-page (CloudSyncForm): a provider picker (radio,
  the AIPanel mutually-exclusive pattern) on top, the shared FileSyncForm sync
  options below for whichever provider is active. Google Drive is offered only on
  desktop; on mobile the page is WebDAV only and the picker is hidden.
- withActiveCloudProvider helper: enabling one provider disables the other in one
  save. Both panels' connect/activate paths use it. Unit-tested.
- WebDAVForm / GoogleDriveForm refactored into embeddable panels (the unified
  page owns the header). Drive gains a "configured but inactive" state so
  switching back re-activates it without a fresh sign-in; explicit Disconnect
  clears the keychain token.
- IntegrationsPanel: remove the two separate WebDAV / Google Drive rows from
  "Reading Sync" (now KOReader Sync / Readwise / Hardcover only); add the
  Third-party Cloud Sync section with one Cloud Sync row (status = active
  provider). Old webdav/gdrive deep-links route to the unified page.

Also removes the temporary Drive concurrency probe (the upload already runs at
the intended concurrency 4; the probe confirmed it).

Full suite 6416 green; lint + format clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(reader): auto-sync the active cloud provider while reading

Generalize the reader sync hook from useWebDAVSync to useFileSync so the active
third-party cloud provider (WebDAV OR Google Drive) syncs per-book while reading
— pull-on-open, debounced push on progress/booknote changes, cover/file upload —
not just via the manual "Sync now" in settings.

Since the providers are mutually exclusive, the hook drives exactly the one
enabled backend, built through the provider registry. The build is async (the
Google Drive provider probes the OS keychain), so the engine lives in state and
the pull-on-open waits for it; switching providers mid-session resets the
per-book locks. The engine is keyed on connection-relevant settings so a
lastSyncedAt write doesn't re-probe the keychain. deviceId / lastSyncedAt now
write the active provider's settings slice; the auth-failed toast is
provider-neutral; the per-book events are renamed *-file-sync.

WebDAV reader-sync behaviour is unchanged. Full suite 6416 green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(settings): surface cloud providers in the section with inline switch

Show WebDAV + Google Drive as separate rows in the Third-party Cloud Sync
section (instead of one "Cloud Sync" row), so both providers are visible and the
active one can be switched right there.

- CloudProviderRow: a trailing radio makes a provider the single active sync
  target inline (enabled only when it's already configured — WebDAV creds / a
  Drive token); the row body / chevron opens its config sub-page (connect, sync
  options, disconnect). Status reads Active / Configured / Not connected, with a
  Syncing… indicator.
- Each provider drills into its own sub-page again (WebDAV / Google Drive),
  rendering the embeddable panel under a SubPageHeader; the brief unified
  CloudSyncForm picker page is removed (its old deep-link maps to Google Drive).
- Switching stays exclusive via withActiveCloudProvider; an inline switch trusts
  the stored credentials/token (no re-validate / re-OAuth).

Full suite 6416 green; lint + format clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(sync): gate third-party cloud sync behind a premium plan

WebDAV + Google Drive sync is now a premium feature: available on any paid plan
(Plus, Pro, or Lifetime), not on free.

- isCloudSyncInPlan(plan) helper (mirrors isEmailInPlan; plus/pro/purchase).
- IntegrationsPanel: free users see the Third-party Cloud Sync section with an
  upgrade row ("Available on Plus, Pro, or Lifetime") that opens the plans page
  instead of the provider rows; the cloud-sync deep-links are gated too (waiting
  for the plan to load before deciding).
- useFileSync: the reader's auto-sync only runs on a paid plan, so a downgraded
  user's sync stops even if a provider's enabled flag lingers.

Full suite 6418 green; lint + format clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(sync): escape backslashes in Drive query literals (CodeQL)

escapeDriveLiteral escaped single quotes but not the backslash escape
character, so a file name containing a backslash (or ending in one) could
break out of the single-quoted Drive `files.list` query literal and malform
the query. Escape backslashes first, then single quotes, so the backslashes
added for the quotes are not doubled.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 10:28:08 +02:00
Huang Xin
6c7c86f346
feat(applock): biometric unlock (fingerprint / Face ID) at startup on mobile (#4650)
* feat(applock): wire up biometric plugin + biometricUnlockEnabled setting

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(applock): add guarded biometric service wrapper

* feat(applock): auto-prompt biometrics on the lock screen with PIN fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(applock): guard concurrent biometric prompts + tighten lock-screen tests

- Add biometricInFlightRef to prevent concurrent authenticateWithBiometrics calls
- Assert PIN input still rendered after biometric failure (test 2)
- Replace flaky waitFor negative assertion with a 50ms flush in test 3

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(applock): mobile biometric toggle + default-on at PIN setup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(i18n): add biometric app-lock strings

* fix(applock): seed biometricUnlockEnabled via app-lock store init; close test gaps

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* build(applock): pin tauri-plugin-biometric in Cargo.lock

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 18:39:03 +02:00
Huang Xin
57501cc520
feat(updater): nightly update channel (Android/Windows/macOS/Linux) (#4577)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
2026-06-14 16:33:53 +08:00
loveheaven
11d796361e
perf(import+open): native Rust EPUB/MOBI parser, OPF prefetch, parallel TOC enrichment (#4369)
* perf(epub): add native EPUB parser in Rust

Introduce a Rust-side EPUB pre-parser exposing three Tauri commands:

  * parse_epub_metadata     - title/author/cover + partialMD5 in one
                              shot, for the import hot path
  * parse_epub_full         - OPF + nav.xhtml + toc.ncx bytes plus a
                              manifest size table, for the reader open
                              hot path
  * extract_epub_cover_full - full-resolution cover bytes, for the
                              lock-screen wallpaper writer

All three avoid ferrying multi-MB blobs across the JS<->Rust IPC
boundary. Cover bytes returned by parse_epub_metadata are downscaled
to a webview-friendly JPEG when the long edge exceeds the library
thumbnail size.

No JS callers yet -- wired up in the following commits.

* perf(import): use native EPUB parser and downscale covers on Tauri targets

On Tauri (desktop/iOS/Android), importBook now forwards EPUB
metadata + cover extraction to the Rust parse_epub_metadata
command and reuses the partialMD5 it returns, skipping the
foliate-js full archive parse and the second pass over the file
for hashing.

As a side effect, the cover written to cover.png is downscaled
to a webview-friendly JPEG (long edge <= 512px), shrinking the
on-disk thumbnail from multi-MB to ~30-60KB per book. To keep
the lock-screen wallpaper feature unchanged, useAutoSaveBookCover
now pulls the original full-resolution cover via the Rust
extract_epub_cover_full command instead of copying the (now
downscaled) cover.png; falls back to the thumbnail when the
native path is unavailable.

Web targets and non-EPUB formats keep the existing path.

* perf(reader): prefetch EPUB OPF/nav from Rust on book open

When opening an EPUB on Tauri targets, DocumentLoader now calls the
Rust parse_epub_full command up-front to pull the OPF, EPUB3 nav,
NCX and the central-directory size map in a single IPC. The
foliate-js zip loader is wrapped so that loadText() of these
entries (and a synthetic META-INF/container.xml) is served from
that in-memory cache without inflating through zip.js, while
all other assets keep flowing through the original loader.

A small in-flight dedupe is added to the spine-text loader so the
nav pipeline (loadText + createDocument back-to-back on the same
href) doesn't pay for two zip.js inflate calls per chapter on
first open.

Reader store / app service plumbing: readerStore.openBook now
resolves an absolute on-disk path via the new
appService.resolveNativeBookFilePath / bookService.resolveNativeBookFilePath
helper and threads it into DocumentLoader as nativeFilePath so
the prefetch can fire. Web targets, non-EPUB formats and books
without a managed/external on-disk path skip the prefetch and
take the original code path.

* perf(nav): parallelize section scans and memoize fragment lookups

computeBookNav now processes sections via Promise.all instead of
a sequential for-loop, and within each section issues loadText()
and createDocument() concurrently. Combined with the in-flight
loadText dedupe added to the zip loader, each chapter pays for a
single zip inflate per nav build, and the inflates of different
chapters overlap.

enrichTocFromNavElements is restructured into two concurrent
phases: a cheap '<nav' substring filter on the inflated text, and
a parsed-document walk for the survivors. Most chapters fall out
in phase 1 without ever being parsed.

In fragments.ts, calculateFragmentSize now consults a
per-section position cache (makeFragmentPositionCache) so the
N-fragment loop is O(N) over the chapter HTML instead of O(N²).
A small isCfiAddressable guard is added to skip elements that
foliate-js's CFI generator can't address (documentElement, body
itself, detached nodes, nodes outside <body>) — these previously
threw and spammed console.warn for every fragment, now they
silently fall back to the section CFI.

* perf(import): use native MOBI/AZW/AZW3 parser on Tauri targets

On Tauri (desktop/iOS/Android), importBook now forwards
MOBI/AZW/AZW3/PRC metadata + cover extraction to the Rust
parse_mobi_metadata command and reuses the partialMD5 it returns,
skipping the foliate-js full-buffer parse and the second pass over
the file for hashing. Mirrors the existing EPUB native fast-path
added in e3fc4767 — bookService tries EPUB first, then MOBI; both
bridges fall back to the foliate-js DocumentLoader when the native
path is unavailable (web target, parse error, format mismatch).

The new mobi_parser is built on the mobi crate (KF7+KF8 reader,
zero JS-side touch). It reads title, author, publisher, ISBN, ASIN,
publish date, language, subjects and description from the MobiHeader
+ EXTH records, resolves the EXTH 201 cover offset against the PDB
image-record table (with ThumbOffset / first-image fallbacks), and
strips KindleGen's HTML wrapping in EXTH 103 so the description goes
into the library DB as plain text. The parsed cover is funneled
through the same maybe_resize_cover path as EPUB, so MOBI library
thumbnails are also clamped to a 512px-long-edge JPEG.

Cover-resize / partialMD5 / RawCoverImage are extracted into a new
parser_common module shared between epub_parser and mobi_parser, so
a single tweak (e.g. raising the thumbnail target) applies to every
native importer and the partialMD5 implementation can't drift between
the two paths (a divergent algorithm would silently re-import every
existing book under a new hash on the first run).

Web targets and non-Kindle formats keep the existing path.

* test(tauri): verify native Rust EPUB parser parity with foliate-js

Add a Tauri WebView parity suite (epub-parser-parity.tauri.test.ts) that
cross-checks the native Rust parser against foliate-js on the same fixtures:
parse_epub_metadata / parse_epub_full (title, author, language, identifier,
publisher, published, subjects, partialMD5, OPF + per-entry size table), and
that opening with the native prefetch produces the same BookDoc and
computeBookNav (TOC) output as the pure-JS path.

Fix a parity divergence the suite caught: the Rust OPF parser mapped
dcterms:modified onto `published`, but foliate-js keeps them separate and
leaves `published` empty -- so EPUB3 books carrying only the mandatory
dcterms:modified got a bogus publication date on the native import path. Map
only dc:date now; add regression tests.

Test infra:
- vitest.tauri.config.mts: add optimizeDeps (mirroring vitest.browser.config)
  so foliate-js-importing tauri tests load -- otherwise esbuild's dep scan
  can't resolve '@pdfjs/pdf.min.mjs', pre-bundling is skipped, and the CJS
  deps fail to import ("Importing a module script failed").
- capabilities-extra/webdriver.json: fix __test__ -> __tests__ fs scope typo
  so import tests can open fixtures under src/__tests__/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(import): foliate-js owns EPUB/MOBI metadata via standalone extractors

Rust contributes only the mechanical work that's expensive on a
WebView — partialMD5, the downscaled cover, and (for EPUB) the raw
OPF bytes Rust already had to read for cover resolution. Metadata
extraction is delegated to foliate-js's two new standalone entry
points (`parseEpubMetadataFromXML`, `readMobiMetadata`) so the
import-path BookDoc and the reader-path BookDoc share a single
parser implementation.

EPUB
- `parse_epub_metadata` returns
  `{ partialMd5, cover, coverMime, opfPath, opfBytes }`. OPF bytes
  are a free byproduct of the cover-resolution scan.
- `tryNativeParseEpub` runs `parseEpubMetadataFromXML` on the OPF
  bytes and assembles a lightweight BookDoc stub (metadata +
  getCover). The importer doesn't drive `DocumentLoader.open()`, so
  no zip central-directory scan, no nav/ncx inflate, no spine walk.
- `coverMime` is preserved so `bookService.importBook`'s
  `cover.type === 'image/svg+xml'` branch still routes SVG covers
  through svg2png.

MOBI / AZW / AZW3 / PRC
- `parse_mobi_metadata` returns `{ partialMd5, cover, coverMime }`.
  `tryNativeParseMobi` runs foliate's `readMobiMetadata` on the
  same File, which uses `MOBI.open(file, { metadataOnly: true })`
  to parse PalmDB + MobiHeader + EXTH and short-circuit before the
  MOBI6 / KF8 init() that walks every text record.
- `Book.metadata.identifier` is foliate's `mobi.uid.toString()`
  (PalmDB UID), the canonical MOBI identifier the reader path uses.

bookService.importBook
- EPUB and MOBI native branches consume the bridge's BookDoc stub
  directly. The stub's `getCover()` returns the Rust-downscaled
  blob, falling back to foliate's own `getCover` thunk when Rust
  didn't extract a cover.

Other
- Drop the unused `base64` Rust dependency: cover bytes go over IPC
  as `Vec<u8>` (Tauri 2 transports them natively, like opfBytes /
  navBytes / ncxBytes).
- Drop the `nativePrefetch` option on `DocumentLoaderOptions`; no
  caller passes it. `nativeFilePath` keeps driving `parse_epub_full`
  on the open hot path.

Tests
- vitest.tauri parity test asserts byte-equal partialMD5, cover
  presence parity, OPF bytes that decode to a real `<package>`
  document, and that `parseEpubMetadataFromXML` on those bytes
  produces the same user-visible metadata fields (title / author /
  language / identifier / published) as `DocumentLoader.open()`.

* test(tauri): add War and Peace MOBI fixture for native parser parity

The .tauri parser-parity suite previously had no .mobi/.azw3 asset, so the native MOBI parser (metadata + EXTH cover resolution) was uncovered. Adds a real KF8 MOBI ("War and Peace") to enable MOBI parity coverage against foliate-js.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(foliate-js): bump submodule to readest/foliate-js main (91191ca)

Replaces the ad-hoc 02f435a with the merged main commit 91191ca, which lands the standalone OPF/MOBI metadata extractors (parseEpubMetadataFromXML, readMobiMetadata) the import fast-path depends on (foliate#19), plus the RTL multi-view rect-mapper fix (foliate#20). The extractor code is byte-identical to 02f435a, so the bridges are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Huang Xin <chrox.huang@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 16:58:25 +02:00
loveheaven
726f53a64b
fix(reader): use Tauri clipboard plugin for copy on Android (#4409)
navigator.clipboard.writeText is unreliable inside the Tauri Android
WebView, so tapping Copy in the Reader's selection popup silently
no-ops. Route the write through @tauri-apps/plugin-clipboard-manager
on Tauri targets (Android, iOS, macOS, Windows, Linux), with a
graceful navigator.clipboard / execCommand fallback for the web
build and older WebViews.

- Add tauri-plugin-clipboard-manager (Rust + JS)
- Register the plugin in lib.rs
- Grant clipboard-manager:allow-write-text / allow-read-text
- New utils/clipboard.ts wrapper with platform-aware fallback chain
- Annotator handleCopy and handleConfirmExport use the wrapper
2026-06-02 16:02:52 +02:00
Huang Xin
f8d88cca50
chore: bump tauri plugins (#4373) 2026-05-30 22:18:41 +02:00
Huang Xin
4a5674ef4f
chore: bump turso to version 0.6.1 (#4312)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
PR checks / rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
2026-05-26 18:25:28 +02:00
Huang Xin
11469d1e95
chore(deps): bump vulnerable Rust dependencies (#4144)
Update Cargo.lock to resolve Dependabot advisories by bumping:
- openssl to 0.10.79
- openssl-sys to 0.9.115
- rustls-webpki to 0.103.13
2026-05-13 11:33:34 +02:00
Huang Xin
fc71ca9857
feat(android): upgrade in-process WebView on devices stuck on old system WebView (#4142)
Add tauri-plugin-webview-upgrade as a git submodule under
apps/readest-app/src-tauri/plugins/. On Android devices whose system
WebView is locked to an old Chromium build (Huawei phones, Moaan / Onyx
/ Kobo e-ink readers, AOSP forks without Play Store, etc.), the reader
bundle renders as a blank screen. The plugin bootstraps before
Application.onCreate via androidx.startup and redirects the in-process
WebView loader to a recent com.google.android.webview when the user has
one sideloaded — opening the only window in which WebViewUpgrade can
swap the provider, before Tauri/Wry creates any WebView.

Thresholds (minUpgradeMajor / minSupportedMajor) come from
plugins.webview-upgrade in tauri.conf.json and are baked into Kotlin
constants at Gradle build time. Below the supported threshold with no
upgrade option, the plugin shows a localized AlertDialog (15 languages,
English fallback) prompting the user to install Android System WebView.

Plugin source: https://github.com/readest/tauri-plugin-webview-upgrade

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 09:01:13 +02:00
Huang Xin
5774e00c09
feat(sync): opt-in Credentials toggle + keyring v4 migration (#4111)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL Advanced / Analyze (rust) (push) Has been cancelled
PR checks / rust_lint (push) Has been cancelled
PR checks / build_web_app (push) Has been cancelled
PR checks / test_web_app (push) Has been cancelled
PR checks / build_tauri_app (push) Has been cancelled
Deploy to vercel on merge / build_and_deploy (push) Has been cancelled
* feat(sync): add opt-in Credentials toggle to Manage Sync

Adds a new Credentials category (default OFF) that gates the encrypted
fields (OPDS / KOSync / Readwise / Hardcover usernames, passwords, and
tokens) at both the publish and pull pipelines. When off, sensitive
fields never leave the device, the proactive passphrase prompt never
fires, and the Sync passphrase panel is hidden entirely.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* security: bump keyring to version 4

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 19:09:57 +02:00
Huang Xin
712d564e9d
feat(sync): encrypted OPDS credentials + Tauri keychain (PR 4c + 4d) (#4090)
* feat(sync): encrypt opds_catalog credentials end-to-end (TS path)

Wires encrypted-credential sync for opds_catalog via the CryptoSession
shipped in PR 4a (#4084) plus a new publish/pull crypto middleware.
TS-only — native still uses ephemeral storage (re-enter passphrase per
launch); PR 4d wires the OS keychain.

- ReplicaAdapter gains optional `encryptedFields: readonly string[]`.
  Adapters stay sync; the middleware handles the crypto round trip.
- replicaCryptoMiddleware.ts: encryptPackedFields drops the named
  fields from the push when the session is locked (no plaintext
  leak); decryptRowFields drops them on pull failure (local
  plaintext preserved by the store merge).
- replicaPublish / replicaPullAndApply invoke the middleware.
- OPDS adapter declares encryptedFields = [username, password] and
  now pack/unpack them as plaintext.
- passphraseGate.ts: ensurePassphraseUnlocked coalesces concurrent
  calls, prompts via the registered prompter with kind=setup|unlock,
  throws NO_PASSPHRASE on cancel.
- PassphrasePromptModal mounted at the Providers root; registers
  itself as the gate prompter.
- CryptoSession.forget() wipes server-side envelopes + salts.
- Migration 010 + replica_keys_forget RPC; DELETE
  /api/sync/replica-keys + client wrapper.
- SyncPassphraseSection on the user page: status / Set / Unlock /
  Lock / Forgot.
- CatalogManager pre-save: ensurePassphraseUnlocked when credentials
  are present; user cancel saves locally without sync.

Plan updated: PR 4 split documented as 4a/4b/4c/4d.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(sync): persist sync passphrase via OS keychain (Tauri)

Replaces the EphemeralPassphraseStore stub on native with real
OS-keychain storage so users don't re-enter their sync passphrase
every launch. Web stays on the in-memory ephemeral store by design.

Native bridge plugin gains 4 commands wired across all platforms:

- Rust desktop (`keyring` crate): macOS Keychain on apple-native,
  Windows Credential Manager on windows-native, Linux libsecret/
  Secret Service on sync-secret-service. Per-target features so each
  platform compiles only the backend it needs.
- iOS Swift: Security framework Keychain (kSecClassGenericPassword,
  SecItemAdd / Copy / Delete).
- Android Kotlin: androidx.security EncryptedSharedPreferences
  (AndroidKeystore-derived AES-GCM master key,
  AES256_SIV / AES256_GCM key/value encryption).

TS layer:

- TauriPassphraseStore wraps the bridge calls. set is fail-loud
  (surfaces keychain rejection); get is fail-soft (returns null on
  any error so the gate prompts).
- createPassphraseStore returns ephemeral synchronously;
  upgradeToKeychainIfAvailable swaps the singleton to
  TauriPassphraseStore on Tauri after probing the bridge. CryptoSession
  resolves the store via createPassphraseStore() each touch so the
  swap is transparent.
- CryptoSession.tryRestoreFromStore: silent unlock at boot. Stale-
  entry recovery clears the store when the account has no salt
  server-side. unlock/setup persist; forget also clears the store.
- Providers boot effect: upgrade keychain → silent restore.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(sync): make encrypted-credential pull actually decrypt + UX polish

PR 4c shipped the encrypt path but the pull side silently dropped
ciphers when locked, the modal was busy with double-rings, and web
re-prompted on every page refresh. This rolls up the post-test
fixes + UX polish:

Pull-side decrypt:
- decryptRowFields takes an `onLocked` callback the orchestrator
  wires to the passphrase gate; encountering a cipher field with a
  locked session now triggers the lazy-prompt path instead of
  dropping the field.
- replicaPullAndApply re-applies the unpacked row for metadata-only
  kinds even when a local copy exists, so the now-decrypted creds
  reach the store (the binary-kind skip-if-local optimization
  doesn't apply).
- Cipher fingerprint comparison: capture the row's `cipher.c` for
  each encrypted field, compare against the local record's
  lastSeenCipher. Same → skip prompt + decrypt entirely. Different
  (rotation / value change on another device) → prompt to
  re-decrypt. Fingerprint persists via OPDSCatalog.lastSeenCipher.

Web persistence:
- SessionStoragePassphraseStore: passphrase survives page refresh
  within the same tab, dies on tab close. Replaces
  EphemeralPassphraseStore as the default on web. Avoids
  localStorage / IndexedDB to keep the tab-scoped trust boundary.

UI:
- Renamed PassphrasePromptModal → PassphrasePrompt; modernized: filled
  input style with single subtle focus border, btn-primary +
  btn-ghost replaced with leaner custom buttons. eink-bordered +
  btn-primary classes give the dialog correct e-paper rendering.
- globals.css: suppress redundant outline/box-shadow on focused text
  inputs / textareas (the element's own border is the focus
  indicator).
- AGENTS.md: documents the e-ink convention (`eink-bordered`,
  `btn-primary` for inverted CTAs, etc.) so future widgets ship with
  e-paper support.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 13:22:49 +02:00
Huang Xin
aea3fda086
chore: bump turso to the latest version (#4086)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
2026-05-07 20:11:47 +02:00
Huang Xin
71371130e0
fix(android): avoid rsproperties panic on startup, closes #3922 (#3942)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
`rsproperties::get` panics when it can't open or parse the
`/dev/__properties__` layout (documented behavior of the crate).
On some older/unusual Android builds (e.g. MediaTek Android 8.1 on
Xiaomi Mipad), this aborts the app with SIGABRT before the main
window is created.

Replace the crate with a direct FFI call to Android's native
`__system_property_get`, which has existed since the earliest
Android versions and returns an error code instead of panicking.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 06:00:31 +02:00
Huang Xin
be8b946683
chore: update Dependabot dependencies (#3938)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 12:27:39 +02:00
Huang Xin
ab7da981da
fix(eink): remove scroll animation in eink mode and optimize eink detection (#3822)
* fix(eink): remove scroll animation in eink mode

* fix(android): fix startup ANR on e-ink devices from getprop subprocesses
2026-04-10 18:22:06 +02:00
Huang Xin
52ac74bbad
fix: fixed status info layout in vertical mode, fixed Android build (#3735)
Some checks are pending
PR checks / build_tauri_app (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
2026-04-03 21:41:49 +02:00
Huang Xin
29df8522fa
chore(bump): bump Tauri to the latest version (#3716) 2026-04-01 10:06:23 +02:00
Huang Xin
b4207bd742
chore(deps): bump vulnerable dependencies to address Dependabot alerts (#3693) 2026-03-30 15:59:03 +02:00
Huang Xin
26fec924fc
chore: bump turso to the latest version (#3650) 2026-03-27 06:28:59 +01:00
Huang Xin
91bc4ddec7
feat(library): backup to and restore from a zip file (#3571) 2026-03-20 18:27:52 +01:00
Huang Xin
25352efece
chore: bump dependencies for Dependabot alerts (#3533) 2026-03-14 06:57:43 +01:00