Skip to content

Commit

Permalink
Fixes a bug in Android SMS parsing #526 (#530)
Browse files Browse the repository at this point in the history
Co-authored-by: Donncha Ó Cearbhaill <[email protected]>
  • Loading branch information
Te-k and DonnchaC authored Oct 16, 2024
1 parent 052c4e2 commit aced1aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/mvt/android/modules/adb/sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ def _parse_db(self, db_path: str) -> None:
message["isodate"] = convert_unix_to_iso(message["timestamp"])

# Extract links in the message body
links = check_for_links(message["body"])
message["links"] = links
body = message.get("body", None)
if body:
links = check_for_links(message["body"])
message["links"] = links

self.results.append(message)

Expand Down
4 changes: 3 additions & 1 deletion src/mvt/android/parsers/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ def parse_sms_file(data):
entry["body"] = entry["mms_body"]
entry.pop("mms_body")

message_links = check_for_links(entry["body"])
body = entry.get("body", None)
if body:
message_links = check_for_links(entry["body"])

entry["isodate"] = convert_unix_to_iso(int(entry["date"]) / 1000)
entry["direction"] = "sent" if int(entry["date_sent"]) else "received"
Expand Down

0 comments on commit aced1aa

Please sign in to comment.