Open hyfen opened 2 years ago
@wongjustin99, I'm using the local address book directory (~/Library/Application Support/AddressBook
) to try and guess a user's phone number (so that a message's actor can be set properly) and it's hard to know what's typical in accounts that aren't mine.
If you open Contacts.app, do you have an entry at the top for yourself? Does it have a phone number associated with it?
This is what mine looks like:
I had an empty one for myself - probably since I use contacts synced to an external service. I clicked "Make this my Card" and now I have some phone numbers there.
however, I still see the same error and stacktrace.
I have 10+ numbers, but it appears you have just one. Could that be contributing?
I pushed updates for chronicle-imessage
and chronicle-etl
that at least prevent the full crash. You can try again with:
gem install chronicle-etl -v 0.4.4
gem install chronicle-imessage -v 0.2.5
chronicle-etl -e imessage -t imessage --limit 10
I suspect it won't work because #4 isn't handled yet. But you can always pass in the missing information manually:
chronicle-etl -e imessage -t imessage --limit 10 --extractor-opts my_phone_number:123-1234-1234 my_name:foo
The general problem is that the local iMessage sqlite database only contains the identifiers of participants, not your own number. Your iCloud account (for setting the sender of iMessages) is easy to figure out but not your phone number (for setting the sender of SMS). I might consider adding an option for users who don't care about sending the sender field.
Regarding your 10+ numbers, that's another thing I'll have to figure out with some sqlite reverse engineering but I have a feeling it might not be possible to correctly guess which is the sender because I don't see a concept of a default phone number in iCloud contacts.
I didn't need to manually pass that option in. Actually seems to be working now! Thanks so much for the help.
Now that I have this set up, this might be a conversation for somewhere else besides this issue - but how are you using these plugins? Are they piped into something else for viewing/analysis? Or do you have any ideas you were planning to flesh out?
The extractor uses the
LocalContacts
module to try and infer information about a user's icloud account and phone number (via local Address Book sqlite dbs). If these details can't be found and no options are passed in manually (viamy_phone_number
setting, etc), the extractor should raise an exception instead of crashing.This was encountered by @wongjustin99 in #chronicle-etl/33: