toffer/iphone-sms-backup — pull request #10 by vilcsak (2014-09-03 06:50:43+00:00)
Title: Attachment filename support

This PR adds support to look up any related attachments (photos, contacts, map pins, etc) to a message, and to include a path to the file in the final result under a `filename` key.

This is the first Python I've written – I can't imagine this is great code. I'm just sticking it up here so somebody else might get some mileage out of it. The `replace` on `ORIG_DB` is particularly gross, and I'm sure I've done other things wrong as well.

Sample response:

{
"date": "2014-08-04 14:25:33",
"filename": "/Users/Andrew/Library/Application Support/MobileSync/Backup/[...]/69153a839cda555c05a8f25aed66c9817ba06822",
"from": "[...]",
"text": "￼I thought you might appreciate this lovely photo.",
"to": "Me"
},

The `filename` points to a path on the local file system within the iOS backup that is a JPEG/PNG/VCard file.