Skip to content
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

Repaired some bugs #223

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 37 additions & 73 deletions scripts/artifacts/routineDLocationsLocal.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ def get_routineDLocationsLocal(files_found, report_folder, seeker):
else:
for file_found in files_found:
file_found = str(file_found)

if file_found.endswith('Local.sqlite'):
break

db = open_sqlite_db_readonly(file_found)
cursor = db.cursor()
if version.parse(iOSversion) >= version.parse("14"): # Tested 14.1
if version.parse(iOSversion) >= version.parse("14"): # Tested 14.1
cursor.execute('''
select
datetime(zrtlearnedlocationofinterestvisitmo.zentrydate + 978307200, 'unixepoch'),
Expand All @@ -45,32 +45,35 @@ def get_routineDLocationsLocal(files_found, report_folder, seeker):

all_rows = cursor.fetchall()
usageentries = len(all_rows)
data_list = []
data_list = []
if usageentries > 0:
for row in all_rows:
data_list.append((row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12]))

data_list.append((row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9],
row[10], row[11], row[12]))

description = 'Significant Locations - Location of Interest Entry (Historical)'
report = ArtifactHtmlReport('Locations')
report.start_artifact_report(report_folder, 'RoutineD Locations Entry', description)
report.add_script()
data_headers = ('Timestamp','Exit','Entry Time (Minutes)','Latitude', 'Longitude','Confidence','Location Vertical Uncertainty','Location Horizontal Uncertainty','Data Point Count','Place Creation Date','Expiration','Visit latitude', 'Visit Longitude' )
data_headers = ('Timestamp', 'Exit', 'Entry Time (Minutes)', 'Latitude', 'Longitude', 'Confidence',
'Location Vertical Uncertainty', 'Location Horizontal Uncertainty', 'Data Point Count',
'Place Creation Date', 'Expiration', 'Visit latitude', 'Visit Longitude')
report.write_artifact_data_table(data_headers, data_list, file_found)
report.end_artifact_report()

tsvname = 'RoutineD Locations Entry'
tsv(report_folder, data_headers, data_list, tsvname)

tlactivity = 'RoutineD Locations Entry'
timeline(report_folder, tlactivity, data_list, data_headers)

kmlactivity = 'RoutineD Locations Entry'
kmlgen(report_folder, kmlactivity, data_list, data_headers)

else:
logfunc('No RoutineD Significant Locations Entry data available')
else: # < ios 14

else: # < ios 14
cursor.execute('''
select
datetime(zrtlearnedlocationofinterestvisitmo.zentrydate + 978307200, 'unixepoch'),
Expand All @@ -96,28 +99,31 @@ def get_routineDLocationsLocal(files_found, report_folder, seeker):
data_list = []
if usageentries > 0:
for row in all_rows:
data_list.append((row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11]))

data_list.append((row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9],
row[10], row[11]))

description = 'Significant Locations - Location of Interest Entry (Historical)'
report = ArtifactHtmlReport('Locations')
report.start_artifact_report(report_folder, 'RoutineD Locations Entry', description)
report.add_script()
data_headers = ('Timestamp','Exit','Entry Time (Minutes)','Latitude', 'Longitude','Confidence','Location Uncertainty','Data Point Count','Place Creation Date','Expiration','Visit latitude', 'Visit Longitude' )
data_headers = ('Timestamp', 'Exit', 'Entry Time (Minutes)', 'Latitude', 'Longitude', 'Confidence',
'Location Uncertainty', 'Data Point Count', 'Place Creation Date', 'Expiration',
'Visit latitude', 'Visit Longitude')
report.write_artifact_data_table(data_headers, data_list, file_found)
report.end_artifact_report()

tsvname = 'RoutineD Locations Entry'
tsv(report_folder, data_headers, data_list, tsvname)

tlactivity = 'RoutineD Locations Entry'
timeline(report_folder, tlactivity, data_list, data_headers)

kmlactivity = 'RoutineD Locations Entry'
kmlgen(report_folder, kmlactivity, data_list, data_headers)

else:
logfunc('No RoutineD Significant Locations Entry data available')

if version.parse(iOSversion) >= version.parse("12"):
cursor.execute('''
select
Expand All @@ -129,75 +135,33 @@ def get_routineDLocationsLocal(files_found, report_folder, seeker):
zrtlearnedlocationofinterestmo.zlocationlongitude
from
zrtlearnedlocationofinteresttransitionmo
left join
zrtlearnedlocationofinterestmo
left join zrtlearnedlocationofinterestmo
on zrtlearnedlocationofinterestmo.z_pk = zrtlearnedlocationofinteresttransitionmo.zlocationofinterest
''')

all_rows = cursor.fetchall()
usageentries = len(all_rows)
data_list = []
data_list = []
if usageentries > 0:
for row in all_rows:
data_list.append((row[0], row[1], row[2], row[3], row[4], row[5]))

description = 'Significant Locations - Location of Interest Transition Start (Historical)'
report = ArtifactHtmlReport('Locations')
report.start_artifact_report(report_folder, 'RoutineD Transtition Start', description)
report.add_script()
data_headers = ('Timestamp','Stop','Creation Date', 'Expiration','Latitude','Longitude' )
report.write_artifact_data_table(data_headers, data_list, file_found)
report.end_artifact_report()

tsvname = 'RoutineD Transtition Start'
tsv(report_folder, data_headers, data_list, tsvname)

tlactivity = 'RoutineD Transtition Start'
timeline(report_folder, tlactivity, data_list, data_headers)

tlactivity = 'RoutineD Transtition Start'
timeline(report_folder, tlactivity, data_list, data_headers)

else:
logfunc('No RoutineD Significant Locations Transtition Start data available')

if (version.parse(iOSversion) >= version.parse("12")):
cursor.execute('''
select
datetime(zrtlearnedlocationofinteresttransitionmo.zstartdate + 978307200, 'unixepoch'),
datetime(zrtlearnedlocationofinteresttransitionmo.zstopdate + 978307200, 'unixepoch'),
datetime(zrtlearnedlocationofinteresttransitionmo.zcreationdate + 978307200, 'unixepoch'),
datetime(zrtlearnedlocationofinteresttransitionmo.zexpirationdate + 978307200, 'unixepoch'),
zrtlearnedlocationofinterestmo.zlocationlatitude,
zrtlearnedlocationofinterestmo.zlocationlongitude
from
zrtlearnedlocationofinteresttransitionmo, zrtlearnedlocationofinterestmo
where zrtlearnedlocationofinterestmo.z_pk = zrtlearnedlocationofinteresttransitionmo.zlocationofinterest
''')

all_rows = cursor.fetchall()
usageentries = len(all_rows)
data_list = []
if usageentries > 0:
for row in all_rows:
data_list.append((row[0], row[1], row[2], row[3], row[4], row[5]))

description = 'Significant Locations - Location of Interest Transition Stop (Historical)'
description = 'Significant Locations - Location of Interest Transition(Historical)'
report = ArtifactHtmlReport('Locations')
report.start_artifact_report(report_folder, 'RoutineD Transtition Stop', description)
report.start_artifact_report(report_folder, 'RoutineD Transition', description)
report.add_script()
data_headers = ('Timestamp','Stop','Creation Date', 'Expiration','Latitude','Longitude' )
data_headers = ('Start', 'Stop', 'Creation Date', 'Expiration', 'Latitude', 'Longitude')
report.write_artifact_data_table(data_headers, data_list, file_found)
report.end_artifact_report()
tsvname = 'RoutineD Transtition Stop'

tsvname = 'RoutineD Transition'
tsv(report_folder, data_headers, data_list, tsvname)
tlactivity = 'RoutineD Transtition Stop'

tlactivity = 'RoutineD Transition'
timeline(report_folder, tlactivity, data_list, data_headers)
tlactivity = 'RoutineD Transtition Stop'

tlactivity = 'RoutineD Transition'
timeline(report_folder, tlactivity, data_list, data_headers)

else:
logfunc('No RoutineD Significant Locations Transtition Stop data available')
logfunc('No RoutineD Significant Locations Transition data available')
1 change: 0 additions & 1 deletion scripts/artifacts/weatherAppLocations.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,3 @@ def get_weatherAppLocations(files_found, report_folder, seeker):

else:
logfunc('No data available for Weather App Locations')

Loading