Skip to content

feat(mobile): send AZW3 and TXT files - #4

Merged
listlessbird merged 3 commits into
mainfrom
feat/more-formats
Nov 21, 2026
Merged

listlessbird merged 3 commits into
mainfrom
feat/more-formats

Conversation

@listlessbird

Copy link
Copy Markdown
Owner

Only EPUB (converted) and PDF (sent as is) could be sent. Sharing an AZW3 showed "Kindle Drop sends EPUB and PDF files", and Kindle Drop didn't appear in the share sheet for .txt files at all.

How

  • AZW3 goes as is. Sender.add copies the file in, reads its cover with KindleCore.deviceThumbnail, and stores the book as Ready, the same way a PDF starts. It uploads the thumbnail and then the book, so the lock screen gets its cover. An AZW3 with no readable cover (no ASIN, or a personal document) is still sent, just without a thumbnail. The cover read only takes milliseconds, so it happens while adding, and an AZW3 never shows "Converting".
  • TXT goes as is. The Kindle reads .txt natively as a personal document. Converting it would mean building an EPUB, then an AZW3, which is a lot of machinery for no benefit to the reader.
  • The "Converted" step. Only an EPUB is converted (isConvertible), so the timeline for AZW3, PDF and TXT starts at Uploaded, as it already did for PDF.
  • Format detection. MIME type first (application/vnd.amazon.mobi8-ebook, application/x-mobi8-ebook, text/plain), then the file extension. On the emulator, Android's MediaStore reports .azw3 as application/octet-stream, so in practice the extension match is what catches AZW3. The share-sheet intent filters and the Choose a file picker accept the new types.
  • Copy. The empty state, the unsupported-file message, the format labels (AZW3, TXT) and the UI skill now list the four formats. Small files show their size in kB: a text file read "TXT · 0.0 MB" before this change.

Native Change: the share sheet's AndroidManifest.xml gains intent filters, which changes the Android fingerprint.

The text/plain filter also matches shared text that has no file, such as a link. Those shares get the unsupported-file message for now. Article URLs are a separate piece of work.

Verification

  • Tests written first for formatOf, itemNameOf, and the sender: an AZW3 is sent with its cover first, an AZW3 without a cover is sent alone, and a TXT is sent as is. Also a test for fileSize. check:changed passes.
  • On the emulator, with a new dev client and a local alchemy dev Worker: I shared an AZW3 (made by calibre, EBOK with an ASIN) and a TXT from the Files app. Both reached Waiting for Kindle. The mailbox held thumbnail_<asin>_EBOK_portrait.jpg then ….azw3, and then Field Notes.txt. Cancel sending emptied the mailbox. The dev app is paired with prod again.
Before: sharing an AZW3 After: AZW3 After: TXT
After: TXT in the chooser (missing before) After: Library After: AZW3 timeline

The "before" AZW3 shot runs main's JavaScript on the new client. Before this change, Kindle Drop didn't appear in the chooser for a .txt at all.

The screenshots live on the assets/more-formats branch, so they stay out of main. That branch can be deleted after merge.

#3 renames the app to Dropcap, so whichever of these lands second should update the "Kindle Drop sends …" line.

@github-actions github-actions Bot added the Native Change Changes the native fingerprint; OTAs stop reaching users until a new build ships. label Nov 21, 2026
@listlessbird
listlessbird merged commit 82df4e5 into main Nov 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Native Change Changes the native fingerprint; OTAs stop reaching users until a new build ships.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant