-
Notifications
You must be signed in to change notification settings - Fork 230
Maite modules batch 3 #1302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maite modules batch 3 #1302
Changes from all commits
26d2648
fe23ded
486a50e
1eddfae
62832e1
e03901c
c2862b6
70d588f
1f6db8f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| "description": "Extraction of alarms set", | ||
| "author": "Anna-Mariya Mateyna", | ||
| "creation_date": "2021-01-17", | ||
| "last_update_date": "2024-12-22", | ||
| "last_update_date": "2025-12-16", | ||
| "requirements": "none", | ||
| "category": "Clock", | ||
| "notes": "", | ||
|
|
@@ -14,7 +14,7 @@ | |
| } | ||
| } | ||
|
|
||
| from scripts.ilapfuncs import artifact_processor, get_file_path, get_plist_file_content, convert_plist_date_to_utc | ||
| from scripts.ilapfuncs import artifact_processor, get_file_path, get_plist_file_content, convert_plist_date_to_utc, logfunc | ||
|
|
||
| def decode_repeat_schedule(repeat_schedule_value): | ||
| days_list = { | ||
|
|
@@ -43,15 +43,21 @@ def decode_repeat_schedule(repeat_schedule_value): | |
|
|
||
|
|
||
| @artifact_processor | ||
| def alarms(files_found, report_folder, seeker, wrap_text, timezone_offset): | ||
| def alarms(context): | ||
| files_found = context.get_files_found() | ||
| source_path = get_file_path(files_found, "com.apple.mobiletimerd.plist") | ||
| data_list = [] | ||
|
|
||
| pl = get_plist_file_content(source_path) | ||
|
|
||
| # Check if plist is valid before processing | ||
| if not pl or not isinstance(pl, dict): | ||
| return (), [], '' | ||
|
|
||
| if 'MTAlarms' in pl: | ||
| if 'MTAlarms' in pl['MTAlarms']: | ||
| for alarms in pl['MTAlarms']['MTAlarms']: | ||
| alarms_dict = alarms['$MTAlarm'] | ||
| for alarm in pl['MTAlarms']['MTAlarms']: | ||
| alarms_dict = alarm['$MTAlarm'] | ||
|
|
||
| alarm_title = alarms_dict.get('MTAlarmTitle', 'Alarm') | ||
| alarm_hour = alarms_dict.get('MTAlarmHour', '') | ||
|
|
@@ -82,6 +88,7 @@ def alarms(files_found, report_folder, seeker, wrap_text, timezone_offset): | |
|
|
||
| if 'MTSleepAlarm' in pl['MTAlarms']: | ||
| for sleep_alarms in pl['MTAlarms']['MTSleepAlarm']: | ||
| logfunc(sleep_alarms) | ||
| sleep_alarm_dict = pl['MTAlarms']['MTSleepAlarm'][sleep_alarms] | ||
|
|
||
| alarm_title = sleep_alarm_dict.get('MTAlarmTitle', 'Bedtime') | ||
|
|
@@ -95,6 +102,7 @@ def alarms(files_found, report_folder, seeker, wrap_text, timezone_offset): | |
|
|
||
| data_list.append( | ||
| (fire_date, | ||
| None, # alarm time | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great catch on this data misalignment. i am not super familiar with this artifact, is the 'MTSleepAlarm' condition never having a time? did you find any examples to validate in test data?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just put None in there to fix the alignment. I thought about getting the hour and minute to build the time string, but I have no idea what the internal structure for that artifact looks like and didn't want to assume those fields exist. I couldn't find any test data. |
||
| alarm_title, | ||
| sleep_alarm_dict['MTAlarmEnabled'], | ||
| dismiss_date, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.