Fixes datetime issues in iOS SMS parsing

This commit is contained in:
tek 2024-04-26 13:13:15 +02:00
parent cbd41b2aff
commit 32b24604d8
2 changed files with 12 additions and 3 deletions

View File

@ -144,7 +144,9 @@ class SMS(IOSExtraction):
# We convert Mac's ridiculous timestamp format. # We convert Mac's ridiculous timestamp format.
message["isodate"] = convert_mactime_to_iso(message["date"]) message["isodate"] = convert_mactime_to_iso(message["date"])
message["isodate_read"] = convert_mactime_to_iso(message["date_read"]) if message["date_read"]:
message["isodate_read"] = convert_mactime_to_iso(message["date_read"])
message["direction"] = ( message["direction"] = (
"sent" if message.get("is_from_me", 0) == 1 else "received" "sent" if message.get("is_from_me", 0) == 1 else "received"
) )

View File

@ -112,8 +112,15 @@ class SMSAttachments(IOSExtraction):
value = b64encode(value).decode() value = b64encode(value).decode()
attachment[names[index]] = value attachment[names[index]] = value
attachment["isodate"] = convert_mactime_to_iso(attachment["created_date"]) if attachment["created_date"]:
attachment["start_date"] = convert_mactime_to_iso(attachment["start_date"]) attachment["isodate"] = convert_mactime_to_iso(
attachment["created_date"]
)
if attachment["start_date"]:
attachment["start_date"] = convert_mactime_to_iso(
attachment["start_date"]
)
attachment["direction"] = ( attachment["direction"] = (
"sent" if attachment["is_outgoing"] == 1 else "received" "sent" if attachment["is_outgoing"] == 1 else "received"
) )