Skip to content

Commit 5b991b2

Browse files
committed
- #204 Fix [Pyinstaller issue](pyinstaller/pyinstaller#1684 (comment)), thanks to PR from @cjshearer.
- PIF Import favorites can now import recursively including subdirectories. - Added Device | Check otacerts menu option to quickly check if the ROM is signed. - Sync banned kernel list with @osm0sis [published list](https://xdaforums.com/t/module-play-integrity-fix-safetynet-fix.4607985/page-518#post-89308909). - Improved exception handling - Improved debug messages for troubleshooting - Fix timing issue for a corner case cleanup before unzipping is completed. - AVBTool improvements.
1 parent 3966dbc commit 5b991b2

15 files changed

+480
-366
lines changed

.github/workflows/auto_close_tickets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Calculate date threshold
2323
id: calculate_date
2424
run: |
25-
date_threshold=$(date -u -d '15 days ago' +%s)
25+
date_threshold=$(date -u -d '7 days ago' +%s)
2626
echo "date_threshold=$date_threshold" >> $GITHUB_ENV
2727
echo "Debug: Date threshold: $date_threshold"
2828
shell: bash

Main.py

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ def initialize(self):
659659
# self.toast("Firmware SHA256", "SHA256 of the selected file matches the segment in the filename.")
660660
set_firmware_hash_validity(True)
661661
else:
662-
print(f"WARNING: Expected to match {firmware_hash[:8]} in the firmware filename but didn't, please double check to make sure the checksum is good.")
662+
print(f"⚠️ WARNING: Expected to match {firmware_hash[:8]} in the firmware filename but didn't, please double check to make sure the checksum is good.")
663663
puml("#orange:Unable to match the checksum in the filename;\n")
664664
self.toast("Firmware SHA256", "WARNING! SHA256 of the selected file does not match segments in the filename.\nPlease double check to make sure the checksum is good.")
665665
set_firmware_hash_validity(False)
@@ -1283,6 +1283,10 @@ def _build_menu_bar(self):
12831283
self.cancel_ota_menu_item = device_menu.Append(wx.ID_ANY, "Cancel OTA Update", "Cancels and Resets OTA updates by Google (Not PixelFlasher)")
12841284
self.cancel_ota_menu_item.SetBitmap(images.cancel_ota_24.GetBitmap())
12851285
self.Bind(wx.EVT_MENU, self._on_cancel_ota, self.cancel_ota_menu_item)
1286+
# Check otacerts Menu
1287+
self.check_otacerts_menu_item = device_menu.Append(wx.ID_ANY, "Check otacerts", "Used to see if ROM is signed or not.")
1288+
self.check_otacerts_menu_item.SetBitmap(images.check_otacerts_24.GetBitmap())
1289+
self.Bind(wx.EVT_MENU, self._on_check_otacerts, self.check_otacerts_menu_item)
12861290
# # Verity / Verification Menu
12871291
# self.verity_menu_item = device_menu.Append(wx.ID_ANY, "Verity / Verification Status", "Check Verity / Verification Status")
12881292
# self.verity_menu_item.SetBitmap(images.shield_24.GetBitmap())
@@ -2036,11 +2040,29 @@ def _on_xml_view(self, event):
20362040
# _on_cancel_ota
20372041
# -----------------------------------------------
20382042
def _on_cancel_ota(self, event):
2039-
self._on_spin('start')
2040-
timestr = time.strftime('%Y-%m-%d_%H-%M-%S')
2041-
print(f"{datetime.now():%Y-%m-%d %H:%M:%S} User Pressed Cancel OTA Update")
2042-
device = get_phone()
2043-
device.reset_ota_update()
2043+
try:
2044+
self._on_spin('start')
2045+
print(f"{datetime.now():%Y-%m-%d %H:%M:%S} User Pressed Cancel OTA Update")
2046+
device = get_phone()
2047+
device.reset_ota_update()
2048+
except Exception as e:
2049+
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Encountered an error while cancelling OTA Update")
2050+
traceback.print_exc()
2051+
self._on_spin('stop')
2052+
2053+
# -----------------------------------------------
2054+
# _on_check_otacerts
2055+
# -----------------------------------------------
2056+
def _on_check_otacerts(self, event):
2057+
try:
2058+
self._on_spin('start')
2059+
print(f"{datetime.now():%Y-%m-%d %H:%M:%S} User Pressed Check OTA Certs")
2060+
device = get_phone()
2061+
res = device.exec_cmd("unzip -l /system/etc/security/otacerts.zip")
2062+
print(res)
2063+
except Exception as e:
2064+
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Encountered an error while checking OTA Certs")
2065+
traceback.print_exc()
20442066
self._on_spin('stop')
20452067

20462068
# -----------------------------------------------
@@ -2292,15 +2314,15 @@ def get_vbmeta(self, device, message=''):
22922314
message += f" Slot B Verity: {enabled_disabled(device.vbmeta.verity_b)}\n"
22932315
message += f" Slot B Verification: {enabled_disabled(device.vbmeta.verification_b)}\n"
22942316
if ( device.vbmeta.verity_a != device.vbmeta.verity_b ) or ( device.vbmeta.verification_a != device.vbmeta.verification_b ):
2295-
alert += " WARNING! WARNING! WARNING! Slot a verity / verification does not match slot b verity / verification"
2317+
alert += " ⚠️ WARNING! WARNING! WARNING! Slot a verity / verification does not match slot b verity / verification"
22962318
else:
22972319
message += f" Verity: {enabled_disabled(device.vbmeta.verity_a)}\n"
22982320
message += f" Verification: {enabled_disabled(device.vbmeta.verification_a)}\n"
22992321
# self.config.disable_verification is a disable flag, which is the inverse of device.vbmeta.verification
23002322
if ( device.vbmeta.verity_a == self.config.disable_verity ) or ( device.vbmeta.verity_b == self.config.disable_verity ):
2301-
alert += " WARNING! WARNING! WARNING! There is a mismatch of currently selected vbmeta verity state and device's verity state\n"
2323+
alert += " ⚠️ WARNING! WARNING! WARNING! There is a mismatch of currently selected vbmeta verity state and device's verity state\n"
23022324
if ( device.vbmeta.verification_a == self.config.disable_verification ) or ( device.vbmeta.verification_b == self.config.disable_verification ):
2303-
alert += " WARNING! WARNING! WARNING! There is a mismatch of currently selected vbmeta verification state and device's verification state\n"
2325+
alert += " ⚠️ WARNING! WARNING! WARNING! There is a mismatch of currently selected vbmeta verification state and device's verification state\n"
23042326
alert += " This has a device wipe implications, please double check.\n"
23052327
message += alert
23062328
if alert != '':
@@ -2318,7 +2340,7 @@ def _check_for_bad_kernel(self, kernel):
23182340
return
23192341
for bad_kernel in BANNED_KERNELS:
23202342
if bad_kernel in kernel:
2321-
print(f"WARNING! Problematic Kernel: {kernel} is installed. Play Integrity would possibly fail.")
2343+
print(f"⚠️ WARNING! Problematic Kernel: {kernel} is installed. Play Integrity would possibly fail.")
23222344
print(f"Kernel string: {bad_kernel} is known to be banned.\n")
23232345
self.toast("WARNING! Banned Kernel", f"Kernel string: {bad_kernel} is known to be banned.\nPlay Integrity would possibly fail.")
23242346
puml(f"#red:Kernel: {kernel} is detected;\n")
@@ -2332,10 +2354,10 @@ def _check_for_bad_magisk(self, m_version, m_app_version):
23322354
bad_m_app_version = False
23332355
if m_version in KNOWN_BAD_MAGISKS:
23342356
bad_m_version = True
2335-
print(f"WARNING! Problematic Magisk Version: {m_version} is installed. Advised not to use this version.")
2357+
print(f"⚠️ WARNING! Problematic Magisk Version: {m_version} is installed. Advised not to use this version.")
23362358
if m_app_version in KNOWN_BAD_MAGISKS:
23372359
bad_m_app_version = True
2338-
print(f"WARNING! Problematic Magisk Manager Version: {m_app_version} is installed. Advised not to use this version.")
2360+
print(f"⚠️ WARNING! Problematic Magisk Manager Version: {m_app_version} is installed. Advised not to use this version.")
23392361

23402362
if bad_m_version and bad_m_app_version:
23412363
dlg = wx.MessageDialog(None, f"Magisk Version: {m_version} is detected.\nMagisk Manager Version: {m_app_version} is detected.\n\nThese versions of Magisk are known to have issues.\nRecommendation: Install stable version or one that is known to be good.",'Problematic Magisk Versions.',wx.OK | wx.ICON_EXCLAMATION)
@@ -2667,6 +2689,7 @@ def update_widget_states(self):
26672689
self.props_as_json_menu_item: ['device_attached'],
26682690
self.xml_view_menu_item: ['device_attached'],
26692691
self.cancel_ota_menu_item: ['device_attached', 'device_mode_adb', 'device_is_rooted'],
2692+
self.check_otacerts_menu_item: ['device_attached', 'device_mode_adb'],
26702693
self.push_menu: ['device_attached'],
26712694
self.push_file_to_tmp_menu: ['device_attached'],
26722695
self.push_file_to_download_menu: ['device_attached'],
@@ -4006,13 +4029,15 @@ def _on_boot_selected(self, event):
40064029
boot_img_info = get_boot_image_info(boot.boot_path)
40074030
if boot.is_init_boot == 0:
40084031
message += f"Init Boot: False\n"
4009-
if boot_img_info:
4032+
if boot_img_info and boot_img_info['com.android.build.boot.security_patch']:
40104033
boot.spl = boot_img_info['com.android.build.boot.security_patch']
4034+
if boot_img_info and boot_img_info['com.android.build.boot.fingerprint']:
40114035
boot.fingerprint = boot_img_info['com.android.build.boot.fingerprint']
40124036
elif boot.is_init_boot == 1:
40134037
message += f"Init Boot: True\n"
4014-
if boot_img_info:
4038+
if boot_img_info and boot_img_info['com.android.build.init_boot.security_patch']:
40154039
boot.spl = boot_img_info['com.android.build.init_boot.security_patch']
4040+
if boot_img_info and boot_img_info['com.android.build.init_boot.fingerprint']:
40164041
boot.fingerprint = boot_img_info['com.android.build.init_boot.fingerprint']
40174042
message += f"Date: {ts.strftime('%Y-%m-%d %H:%M:%S')}\n"
40184043
message += f"Firmware Fingerprint: {boot.package_sig}\n"
@@ -4122,7 +4147,7 @@ def _on_delete_boot(self, event):
41224147
print(f"Deleting {boot_img_path} ...")
41234148
os.remove(boot_img_path)
41244149
else:
4125-
print(f"Warning: Boot file: {boot.boot_path} does not exist")
4150+
print(f"⚠️ Warning: Boot file: {boot.boot_path} does not exist")
41264151
except Exception as e:
41274152
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Encountered an error.")
41284153
puml("#red:Encountered an error;\n", True)

0 commit comments

Comments
 (0)