-
Notifications
You must be signed in to change notification settings - Fork 59
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
smscalls: parse mms from smscalls export #370
Conversation
Probably instead of adding it to messages, we can just add helpers...? If there are multiple content parts, pretty common case is for there to be one Maybe a property that checks if theres only one part and its text, with no other parts attached it might be nice to be able to handle the common mime types as well, like parsing images into heres what I have:
Other todos:
|
On the seems that stuff often breaks when things are re-imported or when you move sim cards, so its likely some translation happening in-app and its not saved perfectly in an export Was looking to see if I could match any ids like in here:
but my basic exploration of grepping IDs across the file doesnt seem to have worked. Theres lots of random key/values/ids though, maybe it could be indexes in conversation/some auto-indexed ID...? cant figure it out, just guessing |
Ahhh, any group convo is converted into a MMS since otherwise it cant accurately encode who sent which message. So thats why there are messages that are 'just text'
where it specifies which number and then a type tells you who actually sent it...
|
Was able to use it nicely in some scripts I have to preview convos, and save any images found to ~/.cache/sms-images, synced those scripts up here: seanbreckenridge/HPI-personal@d8b0539 $ sms-images
....
Saving /home/sean/.cache/sms-images/.../1716941561.0-IMG_7345.jpg.jpg
Done, saved 465 images, using 82.697 MB am sure these some small issues I may have missed, but those will get found with more usage - I think this is good enough to merge and start using. |
lowers the chance that if the value is actually "NULL" or 'Null' or something, it isn't misidentified
@karlicoss this should be good to review/merge |
Thanks! I literally never received or sent an MMS, so don't really have any option, happy to merge :) |
I didnt think I had that many either, but any group chat turns itself into an MMS because theres no other way to encode who the message is coming from when there are multiple people (see comment)... So, apparently I had a couple hundred because am in group chats with family etc. I mostly care about this for random images that are stored in it though, am going to embed the correct date into that and add it to my eventual photos module. thanks 👍 |
Oh, you may have to edit this line then, I assumed you had a few so I just put the standard, eh, "check if theres 10 things in this" test |
Yeah, noticed this as well, but sadly this isn't running regularly anyway. Ideally we'd add some test file to https://github.com/karlicoss/hpi-testdata or something like that, so it can run on CI |
Yeah, I always get paranoid about pushing location data test files or a modified xml export just because I always think Ive missed something, I've been wanting to write some tool that takes JSON/XML as input and creates valid-looking dummy-data. |
parses all the MMS file/content parts, left comments alongside me exploring the data object
want to actually try consuming the output of this somewhere before I think it should be merged
also, there are some items parsed as MMS which are actually just text (like, theyre SMIL (XML-format) containers which contain a single
text/plain
file), with no pictures attached. So, its just a text thats stored in a MMS container, in an ideal world we can filter those out and add them tomessages
? But may not always work perfectlySo, we should probably at least note that mms can have text items, or... maybe combine them/have some helper
.property
methods on theMMS
that give you nicer filtering/output?will post some examples when I'm playing with this, gonna go sleep now