diff --git a/Main.py b/Main.py index 9a8403d..e5ae6a6 100644 --- a/Main.py +++ b/Main.py @@ -3986,10 +3986,19 @@ def _on_boot_selected(self, event): message += f"Stock Boot: False\n" elif boot.is_stock_boot == 1: message += f"Stock Boot: True\n" + + # get boot image info + boot_img_info = get_boot_image_info(boot.boot_path) if boot.is_init_boot == 0: message += f"Init Boot: False\n" + if boot_img_info: + boot.spl = boot_img_info['com.android.build.boot.security_patch'] + boot.fingerprint = boot_img_info['com.android.build.boot.fingerprint'] elif boot.is_init_boot == 1: message += f"Init Boot: True\n" + if boot_img_info: + boot.spl = boot_img_info['com.android.build.init_boot.security_patch'] + boot.fingerprint = boot_img_info['com.android.build.init_boot.fingerprint'] message += f"Date: {ts.strftime('%Y-%m-%d %H:%M:%S')}\n" message += f"Firmware Fingerprint: {boot.package_sig}\n" message += f"Firmware: {boot.package_path}\n" @@ -3999,12 +4008,6 @@ def _on_boot_selected(self, event): message += f"\nINFO: Multiple PACKAGE_BOOT records found for {boot.boot_hash}." print(f"{message}") puml(f"note right\n{message}\nend note\n") - - # get boot image info - boot_img_info = get_boot_image_info(boot.boot_path) - if boot_img_info: - boot.spl = boot_img_info['com.android.build.boot.security_patch'] - boot.fingerprint = boot_img_info['com.android.build.boot.fingerprint'] else: self.config.boot_id = None self.config.selected_boot_md5 = None diff --git a/build-on-mac.spec b/build-on-mac.spec index db00d90..17eeecd 100644 --- a/build-on-mac.spec +++ b/build-on-mac.spec @@ -28,6 +28,6 @@ exe = EXE(pyz, icon='images/icon-dark-256.icns') app = BUNDLE(exe, name='PixelFlasher.app', - version='6.9.3.0', + version='6.9.3.1', icon='./images/icon-dark-256.icns', bundle_identifier='com.badabing.pixelflasher') diff --git a/build.sh b/build.sh index a3ff3a2..a09c4ed 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash rm -rf build dist -VERSION=6.9.3.0 +VERSION=6.9.3.1 NAME="PixelFlasher" DIST_NAME="PixelFlasher" diff --git a/constants.py b/constants.py index 6970d84..94e9914 100644 --- a/constants.py +++ b/constants.py @@ -2,7 +2,7 @@ APPNAME = 'PixelFlasher' CONFIG_FILE_NAME = 'PixelFlasher.json' -VERSION = '6.9.3.0' +VERSION = '6.9.3.1' SDKVERSION = '33.0.3' MAIN_WIDTH = 1400 MAIN_HEIGHT = 1040 diff --git a/modules.py b/modules.py index 1c4e817..f551d77 100644 --- a/modules.py +++ b/modules.py @@ -1166,7 +1166,8 @@ def setup_for_downgrade(self): Unless you know what you're doing, it is recommended that you take the default suggested selection. ''' message += f"
Rooted:                       {device_is_rooted}\n"
-        message += f"Target boot.security_patch:   {target_boot_info['com.android.build.boot.security_patch']}\n"
+        with contextlib.suppress(Exception):
+            message += f"Target boot.security_patch:   {target_boot_info['com.android.build.boot.security_patch']}\n"
         message += f"Recommended Patch option:     {option_text}
\n" clean_message = message.replace("
", "").replace("", "").replace("
", "")
         print(f"\n*** Dialog ***\n{clean_message}\n______________\n")
@@ -1222,10 +1223,19 @@ def setup_for_downgrade(self):
 
         # Compare the two boot image info objects and do validations to make sure the target is a downgrade and the current matches current OS version
         print(f"\nChecking if the target boot.img is a downgrade ...")
-        current_patch = current_boot_info['com.android.build.boot.security_patch']
-        target_patch = target_boot_info['com.android.build.boot.security_patch']
+        current_patch = '1970-01-01'
+        with contextlib.suppress(Exception):
+            current_patch = current_boot_info['com.android.build.boot.security_patch']
+        target_patch = '1970-01-01'
+        with contextlib.suppress(Exception):
+            target_patch = target_boot_info['com.android.build.boot.security_patch']
         print(f"Current Security Patch: {current_patch}")
         print(f"Target Security Patch: {target_patch}")
+        if current_patch == '1970-01-01' or target_patch == '1970-01-01':
+            print(f"\n❌ {datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Could not determine the security patch level of the boot images.")
+            puml("#red:Could not determine the security patch level of the boot images;\n")
+            print("Aborting ...\n")
+            return -1
         if target_patch >= current_patch and not checkbox_values[1]:
             print(f"\n⚠️ {datetime.now():%Y-%m-%d %H:%M:%S} WARNING: The target boot.img is not a downgrade.\nAre you sure want to continue?")
             dlg = wx.MessageDialog(None, "WARNING: The target boot.img is not a downgrade.\nAre you sure want to continue?",'Confirm',wx.YES_NO | wx.ICON_EXCLAMATION)
diff --git a/windows-metadata.yaml b/windows-metadata.yaml
index 478ac5e..fc6cf8c 100644
--- a/windows-metadata.yaml
+++ b/windows-metadata.yaml
@@ -1,6 +1,6 @@
 # https://github.com/DudeNr33/pyinstaller-versionfile
 # create-version-file windows-metadata.yaml --outfile windows-version-info.txt
-Version: 6.9.3.0
+Version: 6.9.3.1
 FileDescription: PixelFlasher
 InternalName: PixelFlasher
 OriginalFilename: PixelFlasher.exe
diff --git a/windows-version-info.txt b/windows-version-info.txt
index 7955aaa..b149103 100644
--- a/windows-version-info.txt
+++ b/windows-version-info.txt
@@ -7,8 +7,8 @@ VSVersionInfo(
   ffi=FixedFileInfo(
     # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
     # Set not needed items to zero 0. Must always contain 4 elements.
-    filevers=(6,9,3,0),
-    prodvers=(6,9,3,0),
+    filevers=(6,9,3,1),
+    prodvers=(6,9,3,1),
     # Contains a bitmask that specifies the valid bits 'flags'r
     mask=0x3f,
     # Contains a bitmask that specifies the Boolean attributes of the file.
@@ -32,12 +32,12 @@ VSVersionInfo(
         u'040904B0',
         [StringStruct(u'CompanyName', u''),
         StringStruct(u'FileDescription', u'PixelFlasher'),
-        StringStruct(u'FileVersion', u'6.9.3.0'),
+        StringStruct(u'FileVersion', u'6.9.3.1'),
         StringStruct(u'InternalName', u'PixelFlasher'),
         StringStruct(u'LegalCopyright', u''),
         StringStruct(u'OriginalFilename', u'PixelFlasher.exe'),
         StringStruct(u'ProductName', u'PixelFlasher'),
-        StringStruct(u'ProductVersion', u'6.9.3.0')])
+        StringStruct(u'ProductVersion', u'6.9.3.1')])
       ]),
     VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
   ]