@@ -464,7 +464,7 @@ def choose_cwd(self, outputbox):
464
464
os .mkdir (user_input )
465
465
os .chdir (user_input )
466
466
dir = os .getcwd ()
467
- if d_class == "Watch" :
467
+ if d_class == "Watch" or d_class == "AppleTV" :
468
468
self .show_watch_menu ()
469
469
else :
470
470
self .show_main_menu ()
@@ -504,7 +504,7 @@ def show_save_device_info(self):
504
504
text = text + "- app information"
505
505
self .text = ctk .CTkLabel (self .dynamic_frame , width = 420 , height = 200 , font = self .stfont , text = text , anchor = "w" , justify = "left" )
506
506
self .text .pack (pady = 50 )
507
- if d_class == "Watch" :
507
+ if d_class == "Watch" or d_class == "AppleTV" :
508
508
ctk .CTkButton (self .dynamic_frame , text = "OK" , font = self .stfont , command = self .show_watch_menu ).pack (pady = 10 )
509
509
else :
510
510
ctk .CTkButton (self .dynamic_frame , text = "OK" , font = self .stfont , command = self .show_main_menu ).pack (pady = 10 )
@@ -536,12 +536,12 @@ def show_collect_ul(self):
536
536
self .wait_variable (self .waitul )
537
537
self .progress .stop ()
538
538
self .progress .pack_forget ()
539
- if d_class == "Watch" :
539
+ if d_class == "Watch" or d_class == "AppleTV" :
540
540
ctk .CTkButton (self .dynamic_frame , text = "OK" , font = self .stfont , command = self .show_watch_menu ).pack (pady = 10 )
541
541
else :
542
542
ctk .CTkButton (self .dynamic_frame , text = "OK" , font = self .stfont , command = self .show_main_menu ).pack (pady = 10 )
543
543
else :
544
- if d_class == "Watch" :
544
+ if d_class == "Watch" or d_class == "AppleTV" :
545
545
self .show_watch_menu ()
546
546
else :
547
547
self .show_main_menu ()
@@ -567,7 +567,7 @@ def show_crash_report(self, dir="Crash Report", flow=False):
567
567
self .prog_text .pack_forget ()
568
568
if flow == False :
569
569
self .text .configure (text = "Extraction of crash reports completed!" )
570
- if d_class == "Watch" :
570
+ if d_class == "Watch" or d_class == "AppleTV" :
571
571
ctk .CTkButton (self .dynamic_frame , text = "OK" , font = self .stfont , command = self .show_watch_menu ).pack (pady = 10 )
572
572
else :
573
573
ctk .CTkButton (self .dynamic_frame , text = "OK" , font = self .stfont , command = lambda : self .switch_menu ("AdvMenu" )).pack (pady = 10 )
@@ -593,13 +593,17 @@ def show_sysdiag(self):
593
593
self .text .pack_forget ()
594
594
if d_class == "Watch" :
595
595
self .text .configure (text = "To trigger the creation of the Sysdiagnose files,\n press: Power/Side + Digital Crown for 0.215 seconds." )
596
+ elif d_class == "AppleTV" :
597
+ self .text .configure (text = "To trigger the creation of the Sysdiagnose files,\n press: Play/Pause + Volume Down for 6 seconds on the remote." )
596
598
else :
597
599
self .text .configure (text = "To trigger the creation of the Sysdiagnose files,\n press: Power/Side + VolUp + VolDown for 0.215 seconds." )
598
600
self .text .pack (pady = 10 )
599
601
if d_class == "Watch" :
600
602
self .diag_image = ctk .CTkImage (dark_image = Image .open (os .path .join (os .path .dirname (__file__ ), "assets" , "diag_watch.png" )), size = (600 , 300 ))
601
603
elif d_class == "iPad" :
602
604
self .diag_image = ctk .CTkImage (dark_image = Image .open (os .path .join (os .path .dirname (__file__ ), "assets" , "diag_ipad.png" )), size = (600 , 300 ))
605
+ elif d_class == "AppleTV" :
606
+ self .diag_image = ctk .CTkImage (dark_image = Image .open (os .path .join (os .path .dirname (__file__ ), "assets" , "diag_tv.png" )), size = (600 , 300 ))
603
607
else :
604
608
self .diag_image = ctk .CTkImage (dark_image = Image .open (os .path .join (os .path .dirname (__file__ ), "assets" , "diag.png" )), size = (600 , 300 ))
605
609
self .diaglabel = ctk .CTkLabel (self .dynamic_frame , image = self .diag_image , text = " " , width = 600 , height = 300 , font = self .stfont , anchor = "w" , justify = "left" )
@@ -609,12 +613,12 @@ def show_sysdiag(self):
609
613
self .diag = threading .Thread (target = lambda : self .sysdiag (self .text , self .progress , self .waitsys ))
610
614
self .diag .start ()
611
615
self .wait_variable (self .waitsys )
612
- if d_class == "Watch" :
616
+ if d_class == "Watch" or d_class == "AppleTV" :
613
617
ctk .CTkButton (self .dynamic_frame , text = "OK" , font = self .stfont , command = self .show_watch_menu ).pack (pady = 10 )
614
618
else :
615
619
ctk .CTkButton (self .dynamic_frame , text = "OK" , font = self .stfont , command = lambda : self .switch_menu ("AdvMenu" )).pack (pady = 10 )
616
620
else :
617
- if d_class == "Watch" :
621
+ if d_class == "Watch" or d_class == "AppleTV" :
618
622
self .show_watch_menu ()
619
623
else :
620
624
self .switch_menu ("AdvMenu" )
@@ -1559,7 +1563,7 @@ def show_media(self):
1559
1563
self .text .configure (text = "AFC Extraction complete." )
1560
1564
self .prog_text .pack_forget ()
1561
1565
self .progress .pack_forget ()
1562
- if d_class == "Watch" :
1566
+ if d_class == "Watch" or d_class == "AppleTV" :
1563
1567
self .after (100 , lambda : ctk .CTkButton (self .dynamic_frame , text = "OK" , font = self .stfont , command = lambda : self .switch_menu ("WatchMenu" )).pack (pady = 40 ))
1564
1568
else :
1565
1569
self .after (100 , lambda : ctk .CTkButton (self .dynamic_frame , text = "OK" , font = self .stfont , command = lambda : self .switch_menu ("AdvMenu" )).pack (pady = 40 ))
@@ -1667,44 +1671,47 @@ def watch_report(self, text, prog_text, progress, change, now, case_number="", c
1667
1671
with open (os .path .join ("Report" , "files" , "Diagnostics" , "devvalues.plist" ), "wb" ) as file :
1668
1672
plistlib .dump (de_va_di , file )
1669
1673
1670
- allappsinfo = installation_proxy .InstallationProxyService (lockdown ).get_apps ()
1671
- with open (os .path .join ("Report" , "files" , "Diagnostics" , "allappsinfo.plist" ), "wb" ) as file :
1672
- plistlib .dump (allappsinfo , file )
1673
-
1674
- allappsitunes = {}
1675
- itunes = installation_proxy .InstallationProxyService (lockdown ).browse (attributes = ['CFBundleIdentifier' , 'iTunesMetadata' ])
1676
- for app in itunes :
1677
- allappsitunes [app ['CFBundleIdentifier' ]] = app
1678
- with open (os .path .join ("Report" , "files" , "Diagnostics" , "allappsitunes.plist" ), "wb" ) as file :
1679
- plistlib .dump (allappsitunes , file )
1680
-
1681
- allappsicons = {}
1682
- icons = installation_proxy .InstallationProxyService (lockdown ).browse (attributes = ['CFBundleIdentifier' ,'CFBundleIcon' , 'CFBundleName' ])
1683
- for app in icons :
1684
- icon = {}
1685
- try :
1686
- icon ['CFBundleIcon' ] = app ['CFBundleIcon' ]
1687
- icon ['CFBundleName' ] = app ['CFBundleName' ]
1688
- except :
1689
- icon ['CFBundleIcon' ] = bytes (0 )
1690
- icon ['CFBundleName' ] = app ['CFBundleName' ]
1691
- allappsicons [app ['CFBundleIdentifier' ]] = icon
1692
- with open (os .path .join ("Report" , "files" , "Diagnostics" , "allappsicons.plist" ), "wb" ) as file :
1693
- plistlib .dump (allappsicons , file )
1694
-
1695
- allappsusage = {}
1696
- usages = installation_proxy .InstallationProxyService (lockdown ).browse (attributes = ['CFBundleIdentifier' ,'DynamicDiskUsage' , 'StaticDiskUsage' ])
1697
- for app in usages :
1698
- usage = {}
1699
- try :
1700
- usage ['CFBundleIdentifier' ] = app ['CFBundleIdentifier' ]
1701
- usage ['DynamicDiskUsage' ] = app ['DynamicDiskUsage' ]
1702
- usage ['StaticDiskUsage' ] = app ['StaticDiskUsage' ]
1703
- except :
1704
- usage ['CFBundleIdentifier' ] = app ['CFBundleIdentifier' ]
1705
- allappsusage [app ['CFBundleIdentifier' ]] = usage
1706
- with open (os .path .join ("Report" , "files" , "Diagnostics" , "allappsusage.plist" ), "wb" ) as file :
1707
- plistlib .dump (allappsusage , file )
1674
+ try :
1675
+ allappsinfo = installation_proxy .InstallationProxyService (lockdown ).get_apps ()
1676
+ with open (os .path .join ("Report" , "files" , "Diagnostics" , "allappsinfo.plist" ), "wb" ) as file :
1677
+ plistlib .dump (allappsinfo , file )
1678
+
1679
+ allappsitunes = {}
1680
+ itunes = installation_proxy .InstallationProxyService (lockdown ).browse (attributes = ['CFBundleIdentifier' , 'iTunesMetadata' ])
1681
+ for app in itunes :
1682
+ allappsitunes [app ['CFBundleIdentifier' ]] = app
1683
+ with open (os .path .join ("Report" , "files" , "Diagnostics" , "allappsitunes.plist" ), "wb" ) as file :
1684
+ plistlib .dump (allappsitunes , file )
1685
+
1686
+ allappsicons = {}
1687
+ icons = installation_proxy .InstallationProxyService (lockdown ).browse (attributes = ['CFBundleIdentifier' ,'CFBundleIcon' , 'CFBundleName' ])
1688
+ for app in icons :
1689
+ icon = {}
1690
+ try :
1691
+ icon ['CFBundleIcon' ] = app ['CFBundleIcon' ]
1692
+ icon ['CFBundleName' ] = app ['CFBundleName' ]
1693
+ except :
1694
+ icon ['CFBundleIcon' ] = bytes (0 )
1695
+ icon ['CFBundleName' ] = app ['CFBundleName' ]
1696
+ allappsicons [app ['CFBundleIdentifier' ]] = icon
1697
+ with open (os .path .join ("Report" , "files" , "Diagnostics" , "allappsicons.plist" ), "wb" ) as file :
1698
+ plistlib .dump (allappsicons , file )
1699
+
1700
+ allappsusage = {}
1701
+ usages = installation_proxy .InstallationProxyService (lockdown ).browse (attributes = ['CFBundleIdentifier' ,'DynamicDiskUsage' , 'StaticDiskUsage' ])
1702
+ for app in usages :
1703
+ usage = {}
1704
+ try :
1705
+ usage ['CFBundleIdentifier' ] = app ['CFBundleIdentifier' ]
1706
+ usage ['DynamicDiskUsage' ] = app ['DynamicDiskUsage' ]
1707
+ usage ['StaticDiskUsage' ] = app ['StaticDiskUsage' ]
1708
+ except :
1709
+ usage ['CFBundleIdentifier' ] = app ['CFBundleIdentifier' ]
1710
+ allappsusage [app ['CFBundleIdentifier' ]] = usage
1711
+ with open (os .path .join ("Report" , "files" , "Diagnostics" , "allappsusage.plist" ), "wb" ) as file :
1712
+ plistlib .dump (allappsusage , file )
1713
+ except :
1714
+ pass
1708
1715
1709
1716
try : os .mkdir (os .path .join ("Report" , "files" , "Diagnostics" , "~DiagnosticRelay" ))
1710
1717
except : pass
@@ -1728,7 +1735,11 @@ def watch_report(self, text, prog_text, progress, change, now, case_number="", c
1728
1735
try : os .mkdir (os .path .join ("Report" , "files" , "Applications" ))
1729
1736
except : pass
1730
1737
app_report_list = []
1731
- appfile = installation_proxy .InstallationProxyService (lockdown ).browse (attributes = ['CFBundleIdentifier' , 'iTunesMetadata' , 'ApplicationDSID' , 'ApplicationSINF' , 'ApplicationType' , 'CFBundleDisplayName' , 'CFBundleExecutable' , 'CFBundleName' , 'CFBundlePackageType' , 'CFBundleShortVersionString' , 'CFBundleVersion' , 'Container' , 'GroupContainers' , 'MinimumOSVersion' , 'Path' , 'UIDeviceFamily' , 'DynamicDiskUsage' , 'StaticDiskUsage' , 'UIFileSharingEnabled' ])
1738
+ try :
1739
+ appfile = installation_proxy .InstallationProxyService (lockdown ).browse (attributes = ['CFBundleIdentifier' , 'iTunesMetadata' , 'ApplicationDSID' , 'ApplicationSINF' , 'ApplicationType' , 'CFBundleDisplayName' , 'CFBundleExecutable' , 'CFBundleName' , 'CFBundlePackageType' , 'CFBundleShortVersionString' , 'CFBundleVersion' , 'Container' , 'GroupContainers' , 'MinimumOSVersion' , 'Path' , 'UIDeviceFamily' , 'DynamicDiskUsage' , 'StaticDiskUsage' , 'UIFileSharingEnabled' ])
1740
+ except :
1741
+ appfile = []
1742
+
1732
1743
for app in appfile :
1733
1744
app_report_dict = {}
1734
1745
app_report_dict ["id" ] = str (uuid .uuid4 ())
@@ -2941,7 +2952,7 @@ def media_export(l_type, dest="Media", archive=None, text=None, prog_text=None,
2941
2952
except :
2942
2953
pass
2943
2954
2944
- if d_class == "Watch" :
2955
+ if d_class == "Watch" or d_class == "AppleTV" :
2945
2956
with open (f"afc_files_{ udid } .json" , "w" ) as file :
2946
2957
json .dump (filedict , file )
2947
2958
else :
@@ -2965,7 +2976,8 @@ def crash_report(crash_dir, change, progress, prog_text):
2965
2976
for entry in crash_list :
2966
2977
c_nr += 1
2967
2978
try :
2968
- AfcService (lockdown , service_name = "com.apple.crashreportcopymobile" ).pull (relative_src = entry , dst = crash_dir , src_dir = "" )
2979
+ pull (self = AfcService (lockdown , service_name = "com.apple.crashreportcopymobile" ),relative_src = entry , dst = crash_dir )
2980
+ #AfcService(lockdown, service_name="com.apple.crashreportcopymobile").pull(relative_src=entry, dst=crash_dir, src_dir="")
2969
2981
except :
2970
2982
pass
2971
2983
cpro = c_nr / crash_count
@@ -3240,7 +3252,7 @@ def pull(self, relative_src, dst, callback=None, src_dir=''):
3240
3252
log (f"Error reading file: { src } " )
3241
3253
readable = 0
3242
3254
if readable == 1 :
3243
- if d_class == "Watch" :
3255
+ if d_class == "Watch" or d_class == "AppleTV" :
3244
3256
textfiles = [".txt" , ".doc" , ".docx" , ".odt" ]
3245
3257
dbfiles = [".db" , ".sqlite" , ".realm" , ".kgdb" ]
3246
3258
configfiles = [".plist" , ".xml" ]
0 commit comments