跨 iOS / 安卓(含墨水屏)的 EPUB 阅读器,带不剧透的 X-Ray。完整计划见 xray-reader-plan.md。
当前进度:M0–M2 已在 iPhone 真机验证;M3(X-Ray 完整版,含搜索、关系图、手动编辑)、M4(墨水屏模式、点名字弹卡片、翻页键)、M5(WebDAV 同步)、M6(排版自定义、单本设置、常驻页眉页脚)、M7(翻页模式)、M8(书签、高亮、笔记)代码完成,待真机验证。
| 目录 | 内容 |
|---|---|
mobile/ |
Expo / React Native app(TypeScript) |
mobile/src/app/ |
Expo Router 页面:index.tsx 书架,reader/[id].tsx 阅读 |
mobile/src/storage/ |
SQLite 书架与进度(library.ts),阅读设置(kv-store) |
mobile/src/core/xray/ |
X-Ray 数据格式、校验、防剧透查询、名字扫描、提示词与合并(纯 TS,Vitest) |
mobile/src/core/ai/ |
DeepSeek 客户端(key 存系统钥匙串) |
mobile/src/core/sync/ |
WebDAV 客户端与双向同步逻辑(测试时连本机 WebDAV 服务器) |
mobile/src/sync/ |
同步服务:进度、X-Ray、可选书本文件 |
mobile/src/reader/ |
WebView 外壳、与阅读页的消息协议 protocol.ts |
reader/ |
跑在 WebView 里的阅读页(Vite + foliate-js),构建为单个 HTML |
vendor/foliate-js/ |
git submodule,锁定 commit 78914ae |
reader/构建成单个 HTML,嵌入 app(mobile/src/reader/readerHtml.generated.ts)- app 启动时写到
documents/reader/index.html,书导入到documents/books/<sha256>.epub - WebView 以
file://打开阅读页;阅读页用 XHR 直接读书本文件,不经 postMessage- 安卓:
allowFileAccess+allowFileAccessFromFileURLs - iOS:
allowingReadAccessToURL指向整个 documents 目录
- 安卓:
首次克隆:
git submodule update --initnpm --prefix reader installnpm --prefix mobile install阅读页实时预览(Chrome 打开 http://localhost:5173/?book=/samples/sample-zh.epub):
npm --prefix reader run dev改完阅读页后重新嵌入 app:
npm --prefix reader run build核心逻辑测试(watch 模式):
npm --prefix mobile test启动 app(Expo Go 扫码):
npm --prefix mobile start示例书 reader/public/samples/sample-zh.epub 由 python reader/scripts/make_sample_epub.py 生成,是一篇原创短篇,人物带别名,用于测试 X-Ray。