Add a parser for the Proton Mail Android db-mail (MailX) Room store - #1108
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Proton Mail for Android has shipped three local store generations. ALEAPP
protonmail.pycovers 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*Entityclasses (MessageEntity,MessageBodyEntity,ConversationEntity,MessageAttachmentEntity, ...), found populated on the Android 14 Pixel 7a image.New module
protonmailDbMail.py, four artifactsMessageBodyEntity.body, so it is honestly omitted.MessageAttachmentMetadataEntitywhen the user saved a file. Metadata only; the files are not cached on disk in this store.ContactEmailEntityrows.UserEntity+AccountEntity.createdAtUtcis Unix milliseconds (handled), the rest are seconds.The
db-mailfile is dispatched by the presence ofMessageEntity, so the emptydb-mailstub that ships alongside the uniffi store on newer images is skipped.Validation
Real
aleapp.pyprofile 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_datarecords counts only.The older-store
protonmail.pyand the uniffiprotonmailInbox.pyare 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