Skip to content

Commit

Permalink
bugfix: crash_reports: sysdiagnose waiting on redacted logs
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Nov 25, 2021
1 parent acb4786 commit 1a1cfbb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pymobiledevice3/services/crash_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def get_new_sysdiagnose(self, out: str, erase: bool = True):
:param out: filename
:param erase: remove after pulling
"""
filename = None
sysdiagnose_filename = None

for syslog_entry in OsTraceService(lockdown=self.lockdown).syslog():
if (posixpath.basename(syslog_entry.filename) != 'sysdiagnose') or \
Expand All @@ -289,11 +289,12 @@ def get_new_sysdiagnose(self, out: str, erase: bool = True):

if message.startswith('SDArchive: Successfully created tar at '):
self.logger.info('sysdiagnose creation has begun')

if message.startswith('Results written to '):
filename = message.split()[-1].replace('IN_PROGRESS_', '').replace(
'/var/mobile/Library/Logs/CrashReporter/', '/')
for filename in self.ls('DiagnosticLogs/sysdiagnose'):
# search for an IN_PROGRESS archive
if 'IN_PROGRESS_' in filename and filename.endswith('.tar.gz'):
sysdiagnose_filename = filename.replace('IN_PROGRESS_', '')
break
break

self.afc.wait_exists(filename)
self.pull(out, entry=filename, erase=erase)
self.afc.wait_exists(sysdiagnose_filename)
self.pull(out, entry=sysdiagnose_filename, erase=erase)

0 comments on commit 1a1cfbb

Please sign in to comment.