Skip to content

Commit

Permalink
Circular reference in SMS module serialization (#444)
Browse files Browse the repository at this point in the history
* Fix circular reference in SMS module serialization
* Modify SMS test artifact to include date_read
  • Loading branch information
roaree committed Jan 3, 2024
1 parent b7df87a commit 2838bac
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mvt/ios/modules/mixed/sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(
def serialize(self, record: dict) -> Union[dict, list]:
text = record["text"].replace("\n", "\\n")
sms_data = f"{record['service']}: {record['guid']} \"{text}\" from {record['phone_number']} ({record['account']})"
sms_data = [
records = [
{
"timestamp": record["isodate"],
"module": self.__class__.__name__,
Expand All @@ -54,15 +54,15 @@ def serialize(self, record: dict) -> Union[dict, list]:
]
# If the message was read, we add an extra event.
if record["isodate_read"]:
sms_data.append(
records.append(
{
"timestamp": record["isodate_read"],
"module": self.__class__.__name__,
"event": "sms_read",
"data": sms_data,
}
)
return sms_data
return records

def check_indicators(self) -> None:
for message in self.results:
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/ios_backup/test_sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_sms(self):
m = SMS(target_path=get_ios_backup_folder())
run_module(m)
assert len(m.results) == 1
assert len(m.timeline) == 1
assert len(m.timeline) == 2
assert len(m.detected) == 0

def test_detection(self, indicator_file):
Expand Down

0 comments on commit 2838bac

Please sign in to comment.