You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release scope
Android metadata is versionCode 10011 and versionName "1.0.11". It keeps the com.readwide.manager applicationId and the readwide release signing key, so 1.0.11 updates in place over 1.0.10, 1.0.9, 1.0.8, 1.0.7, and 1.0.6.
This release adds a reader for legacy binary Word documents (.doc, the Word 97-2003 format). Previously only the newer .docx family opened; a .doc was grouped under Word but reported as unsupported. The reader is a self-contained pure-Java parser and adds no new dependency and no new permission.
Documents - legacy .doc rendering
.doc files (the OLE2 compound-file Word 97-2003 format) now open in the document viewer. A read-only compound-file reader extracts the WordDocument and table streams, the piece table reconstructs the document text (both the 16-bit UTF-16 and the 8-bit/compressed piece forms are handled), and the result is shown through the same paginated viewer used for .docx and HWP, so paging, search, and bookmarks work the same way.
Character formatting is applied. Bold, italic, underline, strike-through, font size, and text color are decoded from the document's character-property runs, and each paragraph is split into styled runs at formatting boundaries.
Paragraph formatting is applied. Horizontal alignment (left, center, right, justified) and left, right, and first-line (including hanging) indents are decoded from the paragraph-property runs and applied per paragraph. Tables and inline images are not yet rendered: table cells are flattened to their text and pictures are omitted, so a heavily laid-out .doc opens as readable, formatted text rather than a pixel-faithful reproduction.
Detection is by content, not by extension. A Word-grouped file is routed to the legacy reader only when it is an actual OLE2 compound file, so a mis-named .doc that is really a .docx still opens through the .docx path, and a .doc that is really OOXML is handled correctly.
The parser is pure Java added under the app, needs no INTERNET permission, and pulls in no library. .docx, HWP/HWPX, PDF, and the archive/comic viewers are untouched by the .doc reader itself.
Archives - Zstandard and LZ4
The tar family gains Zstandard and LZ4 members: .tar.zst (also .tzst) and .tar.lz4 archives now list and extract like the existing .tar.gz/.tar.bz2/.tar.xz/.tar.lzma/.tar.Z forms, including numeric split parts (.001) and the sequential image-reading path used by the comic viewer.
Single-file .zst and .lz4 files decompress like the existing .gz/.bz2/.xz/.lzma/.Z forms, restoring the original name (notes.txt.zst extracts to notes.txt).
No new dependency: Zstandard decodes through the already-bundled zstd-jni codec (previously used only for ZIP entries) and LZ4 decodes through the pure-Java framed reader already inside Commons Compress. A new unit test extracts real zstd and LZ4 fixtures end to end.
Home screen - recent list swipe
Swiping a recent-file row left to remove it from the read list now requires a clearly horizontal gesture. Diagonal drags (steeper than about 27 degrees off the horizontal) no longer grab the row, so a sloppy vertical scroll cannot slide a card sideways or delete it. Once a legitimate horizontal swipe has started, finger wobble during the drag does not cancel it, and the existing 45%-of-width commit threshold is unchanged.
Archives - 7z PPMd, BCJ2, and Deflate64 coverage verified
The three 7z compression variants outside the everyday LZMA/LZMA2/BZip2 set are now verified and tested. Deflate64 decodes on the primary (pure-Java) path, confirmed end to end by a new unit test with a real fixture. PPMd and BCJ2 are decoded by the bundled native libarchive backend, which the existing fallback routing already reaches from every path (listing, single-entry, whole-archive, and the image viewer's sequential reader degradation); byte-identical output for the exact test fixtures was verified against libarchive 3.7.2. The two decoders are complementary - libarchive does not read Deflate64 and the Java path does not read PPMd/BCJ2 - so together all three work on device for unencrypted streams. (An AES-encrypted PPMd or BCJ2 stream is out of scope: the Java path lacks the coder and libarchive decrypts but then cannot decode PPMd/BCJ2, so that specific combination fails cleanly as unsupported rather than producing output.) The pass adds tests and provenance notes (the PPMd implementation inside libarchive is Igor Pavlov's public-domain Ppmd7 code; nothing from 7-Zip or libarchive enters this repository).
One listing fix came out of running the new tests on a plain JVM: entry listing had iterated 7z entries with getNextEntry(), which in Commons Compress also builds each entry's decoder chain and therefore throws for PPMd ("Unsupported compression method [3, 4, 1]") and BCJ2 ("Multi input/output stream coders are not yet supported") even though the names and sizes are fully readable from the header. Listing now walks the parsed header metadata via getEntries() instead, so PPMd/BCJ2 archives are browsable on the primary path without needing the libarchive fallback at all; extraction is unchanged (decode paths still use getNextEntry() and fall back to libarchive). Password behavior is unchanged too: header-encrypted archives still prompt at open (the header itself cannot be parsed), and AES content streams fail only when read.
Archives - EGG fixes for real ALZip files, and split volume support
The EGG reader now opens real ALZip-created archives. Verification against genuine ALZip files uncovered three layout bugs the previous synthetic test files had masked: the archive header's extra-field prefix (terminated by an END field) was not parsed, so every real file was rejected as unsupported; the END field that terminates each block header was not consumed, shifting every data offset by four bytes; and the LZMA properties were read from the wrong position in the block preamble. All three are fixed and the reader is verified end to end (CRC-checked) against real store, deflate, and LZMA archives, including Unicode file names.
Split EGG archives (name.vol1.egg, name.vol2.egg, ...) now list and extract. Volumes are presented as one logical stream (the first volume whole, later volumes minus their own headers) with the prev/next header-id chain validated volume by volume, so blocks that straddle a volume boundary decode correctly and a missing or mismatched volume fails cleanly instead of producing partial output. Opening any volume of the set resolves to the full chain.
ZipCrypto-encrypted EGG entries (ALZip's default password mode) now extract. The password is verified against the entry's 12-byte check data before any output is written, so a wrong password is reported as such instead of producing garbage; the per-file keystream is carried across all of the entry's blocks, which real multi-block files require. AES- and LEA-encrypted entries and solid archives are still reported as unsupported (now by method name) rather than risking corrupt output. The container layout, including the encryption field, is documented in docs/EGG_FORMAT_NOTES.md.
Archives - ALZ bzip2: the ALZip 4.x bitstream variant now decodes
ALZip 4.x-era archives compressed with bzip2 (method 1) carry a trimmed bitstream variant, not standard bzip2: the stream magic, block-size byte, per-block CRC, randomised flag, and end-of-stream CRC are all absent, and block framing is DLZ+0x01/0x02 - so standard decoders fail on them at the first block header, and the previous "prepend the missing magic" path could never decode one. A first-party decoder for the variant was added (AlzBzip2InputStream, a modified copy of Apache Commons Compress's Apache-2.0 BZip2CompressorInputStream with the framing differences applied; change notice in the file and in THIRD_PARTY_NOTICES.md). The first payload bytes select between the variant and plain bzip2 (which some real archives carry, and which keeps working), so both flavors extract with the container CRC verified. The variant bitstream facts follow the zlib-licensed unalz reference decoder, and the embedded test fixtures - a single-block and a four-block stream - were validated byte-identical through a compiled unalz 0.65 before being checked in. Details in docs/ALZ_FORMAT_NOTES.md.
Archives - solid EGG archives now extract
Solid EGG archives (ALZip's "solid compression" option, marked by the SOLID field in the archive header) previously listed their entries but refused extraction. They now extract: the decoded blocks form one continuous stream carrying every file's data in order, and a single sequential pass splits it by each entry's declared size, verifying every block's CRC as in the non-solid path. Extracting one entry from a solid archive decodes from the stream start up to that entry and stops there. A stream shorter than the declared entry sizes fails cleanly with no partial output. The layout and CRC semantics were validated as a black box against ESTsoft's own unegg decoder (first-party fixtures with a block boundary falling inside a file extract byte-identically through it); no vendor code was used. Encrypted solid archives remain unsupported. Details in docs/EGG_FORMAT_NOTES.md.
Archives - AES-encrypted EGG entries now extract
AES-128 and AES-256 encrypted EGG entries (ALZip's non-default encryption options) now extract with the password. The scheme is the WinZip AES construction - PBKDF2-HMAC-SHA1 (1000 iterations) key derivation from the per-file salt, AES-CTR data with a little-endian counter, a 2-byte password verifier, and a 10-byte HMAC-SHA1 footer over the ciphertext - implemented with the platform's JCE primitives only. A wrong password is rejected at the verifier before any output; tampered ciphertext is rejected by the HMAC footer ("EGG AES data authentication failed"); non-ASCII passwords are also tried as legacy Windows-949 bytes. The scheme was confirmed by black-box testing against ESTsoft's own unegg decoder: first-party-built AES archives (store and deflate, both key sizes) decrypt byte-identically through it with the password, and those oracle-validated fixtures are embedded in the unit tests. LEA-encrypted entries remain unsupported and are reported by name. Details in docs/EGG_FORMAT_NOTES.md.
Image preview - smoother continuous paging through sequential archives
Continuous paging through RAR/7z/compressed-TAR previews is decode-bound: the shared forward stream can only produce entries so fast, and the fixed symmetric three-page prefetch window left it idle exactly when a reader flipping steadily forward was about to need eight more pages. Prefetch planning is now direction-aware (ImagePrefetchMath): after two page turns in the same direction the file-extraction window deepens to eight pages ahead (keeping one behind for a quick step back), while the decoded-bitmap warm-up stays at the nearest neighbors so memory use is unchanged. Stale prefetch plans - windows centered on pages the user already left - now exit as soon as a newer page turn re-plans, and the existing rule that read-ahead always yields the shared stream to the page the user actually requested is unchanged. Jumps and direction changes fall back to the historical symmetric window.
Documents - read-aloud button on the bottom toolbar
The TTS button that the text reader has always had on its bottom toolbar is now also on the document viewer's (EPUB/Word/HWP/PDF-text and the other page-based formats). It appears once the document's pages are ready and read-aloud is supported, and opens the same dialog as the existing More-dialog row, which stays in place.
TXT reader - switching files no longer resurrects the previous file
Opening file A, switching to file B in the same reader, and then passing through a background memory trim could reopen A over B: the trim stores a restore intent for the file it released, and the file switch never discarded it. onNewIntent now saves the previous file's state and then drops every transient restore artifact (pending trim, released-memory flag, stored restore intent, loaded text snapshot, in-flight large-TXT partition switch) before the new file loads, and the restore path independently verifies that the stored target matches the reader's current target before executing - with a deliberately strict rule: when the current intent names an explicit path or URI, only the intent decides, so a mid-switch stale loaded-file path can never let the previous file's restore through. Matching logic lives in the pure-Java ReaderRestoreTargetMath with unit tests covering the mismatch and fallback cases. Large-TXT autosave needed no change: the displayed-page getters already report the pending partition-switch page in 1.0.11.
Archives - filenames in legacy encodings no longer break per name
Entry-name charset detection for ZIP/ALZ/EGG now makes one decision per archive instead of one per name, borrowing the text viewer's encoding-detection principle (judge one large sample once) at a scale that works for filenames: readers collect every legacy-path raw name during the entry scan, pick the single code page that best explains all of them, and decode every name with that shared decision - so a one-syllable CP949 name can no longer flip to a different encoding than its longer siblings. Scoring also gained structural naturalness checks (Thai combining-mark placement, Greek final-sigma and accent positions, Russian marker-letter positions, and case-structure sanity for Cyrillic/Greek), which fixes cases per-name scoring could never win, such as DOS-era Russian archives losing to Thai at any name length. UTF-8 flags, valid UTF-8, and EGG locale hints keep their existing precedence. Validated across eight language corpora plus genuine Thai/Greek/Turkish guards against over-correction. Details in docs/ARCHIVE_NAME_CORPUS_READWIDE_1_0_11.md.
Archives - RAR5 header-encrypted (-hp) archives now open
RAR5 archives created with header encryption (-hp) previously had no path at all: the bundled libarchive cannot decrypt RAR5 headers (it cannot even list such archives), and the first-party reader raised a clean unsupported error. The reader now derives the header key from the archive encryption block (reusing the real-file-validated Rar5Crypto key derivation) and reads every following header through AES-256-CBC, after which all existing first-party machinery - stored-entry decryption, compressed decrypt+decode, solid chains, split payloads, and multi-volume resolution - applies unchanged. Validated byte-for-byte against UNRAR 7.00 across stored/compressed/max-compression/solid/multi-volume -hp fixtures, Korean entry names, and an 84 KB mixed payload; missing and wrong passwords re-prompt cleanly with no partial output. Details in docs/RAR5_HEADER_ENCRYPTION_READWIDE_1_0_11.md.
Archives - 7z PPMd first-party decoder; AES-encrypted PPMd now extracts
7z archives compressed with PPMd now decode first party, closing the last unsupported 7z combination: AES-encrypted PPMd archives, which no bundled backend could handle (Commons Compress has no PPMd coder, and the bundled libarchive cannot decrypt 7z). SevenZPpmd7Decoder is a Java port of the public-domain Ppmd7 reference (Dmitry Shkarin's PPMd var.H, Igor Pavlov's Ppmd7 codec - both explicitly public domain, which is Apache-2.0 compatible; provenance in THIRD_PARTY_NOTICES.md). The model lives in one flat byte array mirroring the reference memory layout, because in PPMd the memory allocator is part of the format: the encoder and decoder must rescale, glue free blocks, and restart the model at exactly the same points. Validation followed the project's oracle discipline - a Python reference was debugged to byte-exactness first, then the Java port re-verified against the reference 7z tool and pyppmd across orders 2-32, memory sizes 64 KiB-1 MiB, and text/repetitive/random/zero payloads, with the hard paths instrumented to confirm they ran (one fixture alone triggers 8 model restarts and 7 free-block glue passes, all byte-exact). Wired into the same gated fallback as BCJ2: only archives actually containing PPMd or BCJ2 folders are intercepted, and on any failure other than a missing password the previous libarchive path still runs, so existing behaviour cannot regress. Plain PPMd, and AES+PPMd with an encrypted header, all extract byte-identically; wrong passwords fail cleanly. Details in docs/SEVENZ_PPMD_READER_READWIDE_1_0_11.md.
Archives - 7z BCJ2 archives now extract, including AES-encrypted ones
7z archives whose entries use the BCJ2 branch filter (7-Zip applies it to executables; it is a four-input coder) now extract. Apache Commons Compress cannot decode BCJ2 - it rejects the folder with "Multi input/output stream coders are not yet supported" - and the bundled native libarchive cannot decrypt 7z at all, so AES-encrypted BCJ2 archives previously had no working path and plain BCJ2 depended on the native fallback. A first-party 7z reader (SevenZBcj2ArchiveReader) now parses the container, resolves each folder's coder graph, decodes the base streams with the bundled LZMA/LZMA2 decoders, decrypts AES-256 folders (including archives with an AES-encrypted header) with a first-party 7z key schedule, and applies a first-party BCJ2 join. It runs only as a fallback and only when the archive actually contains a BCJ2 folder, so all other 7z archives are unaffected. Everything is clean-room Java from the documented 7z format and published algorithms (no 7-Zip or libarchive source); self-made fixtures across three coder chains (BCJ2 over stored inputs, BCJ2 over LZMA, and AES+LZMA+BCJ2 with an encrypted header) decode byte-identically to the reference 7z tool. Details in docs/SEVENZ_BCJ2_READER_READWIDE_1_0_11.md.
Archives - RAR/7z encryption boundaries verified against real archives
The encryption edges of RAR and 7z support were re-checked with real archives (WinRAR 7.00 for RAR5, p7zip for 7z), and the error reporting was made precise. Header-encrypted RAR5 archives (created with -hp) are not readable by any bundled backend - the libarchive engine itself reports encryption as unsupported for them - so the app now says exactly that instead of a generic header-encryption message, while header-encrypted RAR4 keeps its working first-party decryptor. On the positive side, password-protected stored RAR5 archives were confirmed to decrypt correctly with the app's own key derivation against a genuine WinRAR-created file (byte-identical output). For 7z, PPMd- or BCJ2-compressed archives that are also AES-encrypted remain unsupported (no backend decrypts 7z and also decodes those methods); they fail cleanly with a password prompt or an unsupported message and never produce partial output. Unencrypted PPMd/BCJ2 and all common 7z variants are unaffected.
Archives - ALZ revalidation and split support
The ALZ reader was re-verified against real ALZip-created archives the same way EGG was, with a better outcome: store, deflate, bzip2, ZipCrypto-encrypted entries, and CP949 file names already decoded correctly (CRC-verified; the ? characters in some legacy names are baked into the file by ALZip itself for characters CP949 cannot encode).
Split ALZ archives (name.alz + name.a00, name.a01, ...) now extract. Previously the app resolved a continuation part to the first .alz but read only that one file, so anything past the first segment was cut off. Segments are now presented as one logical stream with each segment's framing (a 16-byte trailer per segment, plus an 8-byte header on continuations) stripped, so entries that straddle a segment boundary decode normally; a missing segment fails cleanly with no partial output, and opening any part of the set resolves the whole chain. Verified end to end (CRC) against a real two-segment archive.
Directory and empty-file entries that omit the method/CRC/size fields (a zero size nibble in the header) no longer cause the whole archive to be rejected as unsupported.
Internals: the EGG split-volume view was renamed EggVolumeInput -> SplitVolumeInput and is now shared by both readers; the ALZ-only RandomAccessFileBoundedInputStream class became unused and was removed. Format notes added in docs/ALZ_FORMAT_NOTES.md.
Image preview - split archives
Viewing images inside numeric split archives (comic.zip.001 style) is much faster: the volumes are assembled once for the whole viewing session instead of once per page and per prefetched neighbor.
Read-aloud (TTS) - no more silence on unmatched voices, smoother page seams
Text-to-speech no longer goes silent when the selected language or voice is not available on the installed engine. Previously, if the engine reported the chosen locale as unsupported (common with neural engines such as sherpa-onnx / VoxSherpa and their Kokoro/Piper voices, which often expose only their own default locale), read-aloud stopped before producing any audio. It now falls back to the engine's default voice, then the device default, and only reports a problem if none can speak - so "Play" produces sound instead of nothing.
Continuous read-aloud no longer pauses audibly at page boundaries. For documents whose text is fully in memory, the start of the next page is now queued onto the speech engine ahead of time, while the current page's last sentence is still playing, so a high-latency neural voice keeps synthesizing across the seam instead of leaving a gap. The on-screen page turn, sentence highlight, and saved position follow the audio as before. The lazily paged very-large-text path keeps its existing behavior.
Read-aloud (TTS) - Markdown documents
Markdown files now support read-aloud in the document viewer, like EPUB and Word. Because Markdown renders as one long scrolling page rather than discrete pages, playback follows along by scrolling the view to roughly the passage being spoken. "Continue reading aloud" from the main screen now resumes Markdown (and EPUB/Word) playback automatically at the saved spot in the document viewer.
Read-aloud (TTS) - toolbar button in the PDF viewer, next to the bookmark
The PDF viewer now has a read-aloud button directly on the bottom toolbar (it previously lived only in the More menu), placed immediately to the right of the bookmark button. The EPUB/Word/HWP document viewer's read-aloud button was moved to the same spot - right of the bookmark - so the two page-based viewers match. You can still reorder or hide it per viewer in Settings' button-order customization.
Read-aloud (TTS) - phrase length and pause reduction controls
Read-aloud gains two text-level controls in the TTS dialog, aimed at neural voices (for example Kokoro) that either add latency on long passages or pause too long at punctuation. Phrase length (Short/Medium/Long) sets how much text is sent to the engine at a time - shorter phrases start faster and can sound snappier, longer phrases give the most natural prosody (Long matches previous behavior). Pause reduction (Off/Medium/Aggressive) smooths punctuation so the voice keeps moving: Medium runs clauses together, Aggressive also softens sentence stops. Both are text-only settings that take effect on the next page; playback still uses your installed TTS engine and no audio is modified.
Read-aloud (TTS) - PDF documents
Read-aloud now works in the PDF viewer too. PDFs render as page images and have no text layer of their own, so the text is extracted with the same PDF text library the in-document search already uses; the reader then offers the full read-aloud experience - language and voice, speed and pitch, pause/resume, sleep timer, the playback notification, and continuous reading that turns the page as speech crosses each boundary. It is opened from the PDF viewer's More menu; the first start extracts the document's text in the background, which can take a moment on large PDFs. Scanned or image-only PDFs have no selectable text, so instead of playing silence the reader now says the PDF has no text to read aloud. Following the spoken word with an on-page highlight is not part of this first version.
Read-aloud (TTS) - EPUB, Word, and HWP documents
Read-aloud now works in the document viewer: EPUB, .docx, legacy .doc, and HWP/HWPX documents gain the same text-to-speech the plain-text/Markdown reader has - language and voice choice, speed and pitch, pause/resume, the sleep timer, the playback notification with media controls, and continuous reading that turns the page as speech crosses each boundary (with the same ahead-of-the-seam queueing, so neural voices do not pause between pages). It is opened from the viewer's More menu; the first start extracts the book's text in the background, which can take a moment on very large books.
Internals: the playback controller was decoupled from the text reader behind two small interfaces (TtsTextSource for the text/position/highlight surface, TtsHost for everything the controller needs from its activity), with the text reader implementing them unchanged. The document viewer supplies a page-indexed plain-text buffer built from the rendered page HTML, so spoken positions map exactly to pages; saved positions resume from the read-aloud dialog. Spoken-sentence highlight on the WebView page and the floating control card are not part of this first version, and Markdown opened as a document is excluded (it already has full read-aloud in the text reader). The home screen's "continue listening" prompt now opens document formats in the document viewer instead of the text reader.
Documents - EPUB images kept inside the screen
Images in reflowable EPUBs no longer overflow the screen. Books frequently ship covers and illustrations larger than the display with their own sizing CSS; the viewer previously capped only the width, so a full-bleed cover could still run several screens tall (most visibly on tablets). Images (and embedded SVG) are now fitted to the visible page on both axes with their aspect ratio preserved, matching how the same page looks in the PDF viewer. Fixed-layout EPUBs keep their own page geometry and are unaffected.
Documents - HWP/HWPX embedded images that can't be shown
When an HWP or HWPX document embeds a picture in a vector or object format the reader can't display (WMF, EMF, or an OLE object), it no longer vanishes without a trace. A framed placeholder box is now shown at the picture's authored size, so the layout keeps its shape and it's clear an image belongs there. Raster pictures (PNG, JPEG, GIF, BMP, WebP) continue to render normally. The placeholder uses a language-neutral picture symbol, so it adds no new translated text.
Documents - HWP paragraph formatting
Binary .hwp documents now render paragraph indents, paragraph spacing, and line spacing, not just alignment. Left/right margins, first-line indent (including hanging indents), space before/after a paragraph, and line spacing (percent and fixed) are read from each paragraph's shape and applied, matching what .hwpx, .docx, and .doc already did. A document written with indented outline levels or 160% line spacing now looks like it does in Hangul instead of collapsing to flush-left, single-spaced text.