Skip to content

Add a parser for the Proton Mail Android db-mail (MailX) Room store - #1108

Merged
abrignoni merged 1 commit into
mainfrom
feat/protonmail-dbmail-store
Aug 14, 2026
Merged

Add a parser for the Proton Mail Android db-mail (MailX) Room store#1108
abrignoni merged 1 commit into
mainfrom
feat/protonmail-dbmail-store

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Summary

Proton Mail for Android has shipped three local store generations. ALEAPP protonmail.py covers the oldest (*-MessagesDatabase.db), and #1107 added the newest (uniffi Inbox cache). This PR fills the middle one: a Room database named db-mail whose tables are the *Entity classes (MessageEntity, MessageBodyEntity, ConversationEntity, MessageAttachmentEntity, ...), found populated on the Android 14 Pixel 7a image.

New module protonmailDbMail.py, four artifacts

  • MailX Messages — time, subject, from (sender address + name), to/cc/bcc (decoded from JSON), read/replied/forwarded flags, attachment count, size, conversation id, message id. No body: it is kept PGP-encrypted in MessageBodyEntity.body, so it is honestly omitted.
  • MailX Attachments — name, size, mime type, disposition, and the saved content URI from MessageAttachmentMetadataEntity when the user saved a file. Metadata only; the files are not cached on disk in this store.
  • MailX ContactsContactEmailEntity rows.
  • MailX Account — the signed-in account from UserEntity + AccountEntity. createdAtUtc is Unix milliseconds (handled), the rest are seconds.

The db-mail file is dispatched by the presence of MessageEntity, so the empty db-mail stub that ships alongside the uniffi store on newer images is skipped.

Validation

Real aleapp.py profile run on the Android 14 Pixel 7a image: 12 messages, 86 attachments, 2 contacts, 1 account; LAVA record counts match exactly, matching direct reads of the store. Pylint 10.00, claim-language and validate_sample_data clean. Test image not public; sample_data records counts only.

The older-store protonmail.py and the uniffi protonmailInbox.py are untouched. Together the three modules now cover all three Proton Mail Android store generations in the corpus.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

🤖 Generated with Claude Code

Between the old *-MessagesDatabase.db store (parsed by protonmail.py)
and the current uniffi Inbox cache (parsed by protonmailInbox.py),
Proton Mail for Android shipped a Room database named db-mail whose
tables are the *Entity classes (MessageEntity, MessageBodyEntity,
ConversationEntity, MessageAttachmentEntity, ...). Neither existing
parser reads it.

New module protonmailDbMail.py with four artifacts:
- MailX Messages: time, subject, from (sender address and name),
  to/cc/bcc (decoded from JSON), read/replied/forwarded flags,
  attachment count, size, conversation id, message id. The body is kept
  PGP-encrypted in MessageBodyEntity and is not shown.
- MailX Attachments: name, size, mime type, disposition, and the saved
  content URI from MessageAttachmentMetadataEntity when the user saved
  the file. Metadata only; the files are not held in an app cache
  directory in this store.
- MailX Contacts: contact emails.
- MailX Account: the signed-in account from UserEntity and
  AccountEntity. createdAtUtc is Unix milliseconds; the rest are seconds.

The db-mail file is dispatched by the presence of MessageEntity, so an
empty db-mail stub (present alongside the uniffi store on newer images)
is skipped. Verified with an aleapp.py profile run on the Android 14
Pixel 7a image: 12 messages, 86 attachments, 2 contacts, 1 account;
LAVA record counts match. The older-store protonmail.py and the uniffi
protonmailInbox.py are unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@abrignoni
abrignoni merged commit c32b0da into main Aug 14, 2026
8 checks passed
@abrignoni
abrignoni deleted the feat/protonmail-dbmail-store branch August 14, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant