Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unknown sender" when importing MMS messages #213

Closed
nybblr opened this issue Sep 17, 2024 · 2 comments
Closed

"Unknown sender" when importing MMS messages #213

nybblr opened this issue Sep 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@nybblr
Copy link

nybblr commented Sep 17, 2024

I'm on the latest stable GrapheneOS (Android 14) with a Pixel 7. I'm importing a SMSIE backup made with 2.4.0, using 2.4.0, and struggling to get MMS messages to show a sender. On both the backup and restore device, I'm using Google Messages.

All the messages import successfully (everything else looks good), and the entry in messages.ndjson looks good at a glance, but MMS messages directed to me (which are usually to multiple people) show up in Google Messages as "Unknown sender". I also checked with Graphene's default Messaging app, and the info on the message says "From: Hidden sender address".

Screenshot_20240917-190041

Here's one of the messages giving me trouble (formatted, plus phone numbers and a few IDs redacted). The original phone numbers are in the same format of 10 digits, no spaces or non-digits:

{
    "_id": "43897",
    "thread_id": "43",
    "date": "1726518279",
    "date_sent": "1726518275",
    "msg_box": "1",
    "read": "1",
    "m_id": "RED000000000000000000000",
    "ct_t": "application\/vnd.wap.multipart.related",
    "ct_l": "http:\/\/RED.D0.00.00\/servlets\/mms?message-id=RED00000000000000000000001",
    "m_cls": "personal",
    "m_type": "132",
    "v": "16",
    "m_size": "767",
    "pri": "129",
    "tr_id": "proto:RED000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "d_rpt": "129",
    "locked": "0",
    "sub_id": "2",
    "seen": "1",
    "creator": "com.google.android.apps.messaging",
    "text_only": "1",
    "__sender_address": {
        "_id": "150429",
        "msg_id": "43897",
        "address": "6666661111",
        "type": "137",
        "charset": "106",
        "sub_id": "2",
        "__display_name": "Alice"
    },
    "__recipient_addresses": [
        {
            "_id": "150428",
            "msg_id": "43897",
            "address": "6666662222",
            "type": "130",
            "charset": "106",
            "sub_id": "2",
            "__display_name": "Bob"
        },
        {
            "_id": "150430",
            "msg_id": "43897",
            "address": "666666333",
            "type": "151",
            "charset": "106",
            "sub_id": "2"
        }
    ],
    "__parts": [
        {
            "_id": "62277",
            "mid": "43897",
            "seq": "-1",
            "ct": "application\/smil",
            "name": "smil.xml",
            "chset": "3",
            "cid": "<smil>",
            "cl": "smil.xml",
            "text": "<smil>\r\n    <head>\r\n        <layout>\r\n            <root-layout width=\"240\" height=\"160\"\/>\r\n            <region id=\"Image\" width=\"100%\" height=\"67%\" left=\"0%\" top=\"0%\" fit=\"meet\"\/>\r\n            <region id=\"Text\" width=\"100%\" height=\"33%\" left=\"0%\" top=\"67%\" fit=\"meet\"\/>\r\n        <\/layout>\r\n    <\/head>\r\n    <body>\r\n    <par dur=\"8000ms\"><text src=\"text.000000.txt\" region=\"Text\"\/><\/par><\/body>\r\n<\/smil>",
            "sub_id": "2"
        },
        {
            "_id": "62278",
            "mid": "43897",
            "seq": "0",
            "ct": "text\/plain",
            "name": "text.000000.txt",
            "chset": "106",
            "cid": "<text.000000>",
            "cl": "text.000000.txt",
            "text": "Sure I'll probably just be reading most of the evening lol when do y'all usually wrap up?",
            "sub_id": "2"
        }
    ]
}

I tried the import process several times, each time wiping all messages and clearing cache / storage for each messaging app. I'm using default options in SMSIE to import.

It seems like the sender address is not being set/imported, though it does look like that attribute was backed up. Any ideas?

@nybblr
Copy link
Author

nybblr commented Sep 18, 2024

Quick update: it looks like this has to do with the sub_id. My backup has 3 distinct values (-1, 1, 2), and on the new phone, the only valid sub_id is 1. If I use the default setting to ignore the sub_id when importing (which overrides sub_id to -1), all the messages import, but this unknown sender issue shows up. If I disable the option, such that the sub_id is NOT ignored, the messages with sub_id: 2 disappear.

The correct sequence that seems to avoid both issues, is to manually find and replace all values of "sub_id" to a valid value for the device (in my case, 1) and enable importing with sub_id.

So to wrap up, it seems overriding sub_id to -1 (the default behavior) isn't without side effects. Possibly the more reliable option is to instead override with the current SIM's sub_id (in my case, 1).

Would it make sense to allow specifying the sub_id override as a preference if it can't be easily / reliably detected? Or is it probable it would just introduce a different issue?

@tmo1 tmo1 closed this as completed in 1a6ec44 Sep 20, 2024
@tmo1 tmo1 added the bug Something isn't working label Sep 20, 2024
@tmo1
Copy link
Owner

tmo1 commented Sep 20, 2024

Thanks for reporting this. The solution turns out to have been simpler than anticipated: While previous commits provided for setting the sub_id to -1 in the main MMS message metadata and the MMS part metadata, these did not apply to the MMS address metadata, since I had never encountered sub_ids there (and the API documentation makes no mention of sub_ids there). Extending those commits to the MMS address metadata fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants