Skip to content

Commit d375d5e

Browse files
committed
new file: assets/diag_tv.png
modified: ufade_gui.py
1 parent b9e6c09 commit d375d5e

File tree

2 files changed

+62
-50
lines changed

2 files changed

+62
-50
lines changed

assets/diag_tv.png

28 KB
Loading

ufade_gui.py

+62-50
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ def choose_cwd(self, outputbox):
464464
os.mkdir(user_input)
465465
os.chdir(user_input)
466466
dir = os.getcwd()
467-
if d_class == "Watch":
467+
if d_class == "Watch" or d_class == "AppleTV":
468468
self.show_watch_menu()
469469
else:
470470
self.show_main_menu()
@@ -504,7 +504,7 @@ def show_save_device_info(self):
504504
text = text + "- app information"
505505
self.text = ctk.CTkLabel(self.dynamic_frame, width=420, height=200, font=self.stfont, text=text, anchor="w", justify="left")
506506
self.text.pack(pady=50)
507-
if d_class == "Watch":
507+
if d_class == "Watch" or d_class == "AppleTV":
508508
ctk.CTkButton(self.dynamic_frame, text="OK", font=self.stfont, command=self.show_watch_menu).pack(pady=10)
509509
else:
510510
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):
536536
self.wait_variable(self.waitul)
537537
self.progress.stop()
538538
self.progress.pack_forget()
539-
if d_class == "Watch":
539+
if d_class == "Watch" or d_class == "AppleTV":
540540
ctk.CTkButton(self.dynamic_frame, text="OK", font=self.stfont, command=self.show_watch_menu).pack(pady=10)
541541
else:
542542
ctk.CTkButton(self.dynamic_frame, text="OK", font=self.stfont, command=self.show_main_menu).pack(pady=10)
543543
else:
544-
if d_class == "Watch":
544+
if d_class == "Watch" or d_class == "AppleTV":
545545
self.show_watch_menu()
546546
else:
547547
self.show_main_menu()
@@ -567,7 +567,7 @@ def show_crash_report(self, dir="Crash Report", flow=False):
567567
self.prog_text.pack_forget()
568568
if flow == False:
569569
self.text.configure(text="Extraction of crash reports completed!")
570-
if d_class == "Watch":
570+
if d_class == "Watch" or d_class == "AppleTV":
571571
ctk.CTkButton(self.dynamic_frame, text="OK", font=self.stfont, command=self.show_watch_menu).pack(pady=10)
572572
else:
573573
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):
593593
self.text.pack_forget()
594594
if d_class == "Watch":
595595
self.text.configure(text="To trigger the creation of the Sysdiagnose files,\npress: 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,\npress: Play/Pause + Volume Down for 6 seconds on the remote.")
596598
else:
597599
self.text.configure(text="To trigger the creation of the Sysdiagnose files,\npress: Power/Side + VolUp + VolDown for 0.215 seconds.")
598600
self.text.pack(pady=10)
599601
if d_class == "Watch":
600602
self.diag_image = ctk.CTkImage(dark_image=Image.open(os.path.join(os.path.dirname(__file__), "assets" , "diag_watch.png")), size=(600, 300))
601603
elif d_class == "iPad":
602604
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))
603607
else:
604608
self.diag_image = ctk.CTkImage(dark_image=Image.open(os.path.join(os.path.dirname(__file__), "assets" , "diag.png")), size=(600, 300))
605609
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):
609613
self.diag = threading.Thread(target=lambda: self.sysdiag(self.text, self.progress, self.waitsys))
610614
self.diag.start()
611615
self.wait_variable(self.waitsys)
612-
if d_class == "Watch":
616+
if d_class == "Watch" or d_class == "AppleTV":
613617
ctk.CTkButton(self.dynamic_frame, text="OK", font=self.stfont, command=self.show_watch_menu).pack(pady=10)
614618
else:
615619
ctk.CTkButton(self.dynamic_frame, text="OK", font=self.stfont, command=lambda: self.switch_menu("AdvMenu")).pack(pady=10)
616620
else:
617-
if d_class == "Watch":
621+
if d_class == "Watch" or d_class == "AppleTV":
618622
self.show_watch_menu()
619623
else:
620624
self.switch_menu("AdvMenu")
@@ -1559,7 +1563,7 @@ def show_media(self):
15591563
self.text.configure(text="AFC Extraction complete.")
15601564
self.prog_text.pack_forget()
15611565
self.progress.pack_forget()
1562-
if d_class == "Watch":
1566+
if d_class == "Watch" or d_class == "AppleTV":
15631567
self.after(100, lambda: ctk.CTkButton(self.dynamic_frame, text="OK", font=self.stfont, command=lambda: self.switch_menu("WatchMenu")).pack(pady=40))
15641568
else:
15651569
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
16671671
with open(os.path.join("Report", "files", "Diagnostics", "devvalues.plist"), "wb") as file:
16681672
plistlib.dump(de_va_di, file)
16691673

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
17081715

17091716
try: os.mkdir(os.path.join("Report", "files", "Diagnostics", "~DiagnosticRelay"))
17101717
except: pass
@@ -1728,7 +1735,11 @@ def watch_report(self, text, prog_text, progress, change, now, case_number="", c
17281735
try: os.mkdir(os.path.join("Report", "files", "Applications"))
17291736
except: pass
17301737
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+
17321743
for app in appfile:
17331744
app_report_dict = {}
17341745
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,
29412952
except:
29422953
pass
29432954

2944-
if d_class == "Watch":
2955+
if d_class == "Watch" or d_class == "AppleTV":
29452956
with open(f"afc_files_{udid}.json", "w") as file:
29462957
json.dump(filedict, file)
29472958
else:
@@ -2965,7 +2976,8 @@ def crash_report(crash_dir, change, progress, prog_text):
29652976
for entry in crash_list:
29662977
c_nr += 1
29672978
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="")
29692981
except:
29702982
pass
29712983
cpro = c_nr/crash_count
@@ -3240,7 +3252,7 @@ def pull(self, relative_src, dst, callback=None, src_dir=''):
32403252
log(f"Error reading file: {src}")
32413253
readable = 0
32423254
if readable == 1:
3243-
if d_class == "Watch":
3255+
if d_class == "Watch" or d_class == "AppleTV":
32443256
textfiles = [".txt", ".doc", ".docx", ".odt"]
32453257
dbfiles = [".db", ".sqlite", ".realm", ".kgdb"]
32463258
configfiles = [".plist", ".xml"]

0 commit comments

Comments
 (0)