Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Oct 16, 2024
1 parent 28678ab commit 44e8f8f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion plaso/data/formatters/ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,4 @@ message:
short_message:
- 'Activity description: {activity_description}'
short_source: 'PLIST'
source: 'Apple iOS Mobile Backup application plist'
source: 'Apple iOS Mobile Backup application plist'
2 changes: 1 addition & 1 deletion plaso/data/timeliner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1800,4 +1800,4 @@ data_type: 'ios:mobile:backup:entry'
attribute_mappings:
- name: 'activity_time'
description: 'Activity Time'
place_holder_event: false
place_holder_event: false
18 changes: 13 additions & 5 deletions plaso/parsers/plist_plugins/ios_mobilebackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
The plist contains history of opened applications in the Mobile Backup.
"""

from dfdatetime import posix_time as dfdatetime_posix_time
import datetime
from dfdatetime import posix_time as dfdatetime_posix_time

from plaso.containers import events
from plaso.lib import definitions
Expand Down Expand Up @@ -49,7 +49,6 @@ def _getEventData(self, description, datetime_value):
timestamp = int(timestamp * definitions.NANOSECONDS_PER_SECOND)
event_data.activity_time = dfdatetime_posix_time.PosixTimeInNanoseconds(
timestamp=timestamp)

return event_data

# pylint: disable=arguments-differ
Expand All @@ -63,15 +62,24 @@ def _ParsePlist(self, parser_mediator, match=None, **unused_kwargs):
"""

datetime_value = match.get('AccountEnabledDate', {})
parser_mediator.ProduceEventData(self._getEventData("AccountEnabledDate", datetime_value))
parser_mediator.ProduceEventData(
self._getEventData("AccountEnabledDate", datetime_value)
)

plist_key = match.get('BackupStateInfo', {})
for key, value in plist_key.items():
if key == "date":
parser_mediator.ProduceEventData(self._getEventData(f"BackupStateInfo - date", value))
parser_mediator.ProduceEventData(
self._getEventData("BackupStateInfo - date", value)
)

elif key == "errors":
for val in value:
parser_mediator.ProduceEventData(self._getEventData(f"BackupStateInfo - {val['localizedDescription']}", val['date']))
parser_mediator.ProduceEventData(
self._getEventData(
f"BackupStateInfo - {val['localizedDescription']}",
val['date']
)
)

plist.PlistParser.RegisterPlugin(IOSMobileBackupPlistPlugin)

0 comments on commit 44e8f8f

Please sign in to comment.