From c7cd22bf6522dd1444451039d1d30061673a2b2a Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Sun, 20 Jun 2021 13:31:23 -0600 Subject: [PATCH] Fix codesign --- Resources/SysPatch.py | 60 +++++++++++++++++++++---------------------- entitlements.plist | 2 ++ 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/Resources/SysPatch.py b/Resources/SysPatch.py index 0f421bce9..17bf3c0c1 100644 --- a/Resources/SysPatch.py +++ b/Resources/SysPatch.py @@ -5,9 +5,9 @@ # - Temporary Work-around: sudo bless --mount /System/Volumes/Update/mnt1 --bootefi --last-sealed-snapshot # - Work-around battery throttling on laptops with no battery (IOPlatformPluginFamily.kext/Contents/PlugIns/ACPI_SMC_PlatformPlugin.kext/Contents/Resources/) -#import hashlib +import hashlib import os -#mport requests +import requests import shutil import subprocess import zipfile @@ -338,35 +338,35 @@ class PatchSysVolume: print("- Removing old Apple Binaries zip") Path(self.constants.payload_apple_root_path_zip).unlink() - Utilities.cls() - print("- Downloading Apple binaries") - popen_oclp = subprocess.Popen( - ["curl", "-S", "-L", link, "--output", self.constants.payload_apple_root_path_zip], - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - universal_newlines=True, - ) - for stdout_line in iter(popen_oclp.stdout.readline, ""): - print(stdout_line, end="") - popen_oclp.stdout.close() + #Utilities.cls() + #print("- Downloading Apple binaries") + #popen_oclp = subprocess.Popen( + # ["curl", "-S", "-L", link, "--output", self.constants.payload_apple_root_path_zip], + # stdin=subprocess.PIPE, + # stdout=subprocess.PIPE, + # stderr=subprocess.STDOUT, + # universal_newlines=True, + #) + #for stdout_line in iter(popen_oclp.stdout.readline, ""): + # print(stdout_line, end="") + #popen_oclp.stdout.close() - #response = requests.get(link, stream=True) - #with self.constants.payload_apple_root_path_zip.open("wb") as file: - # count = 0 - # for chunk in response.iter_content(1024 * 1024 * 4): - # file.write(chunk) - # count += len(chunk) - # Utilities.cls() - # print(f"- Downloading Apple binaries ({os_ver}) from PatcherSupportPkg") - # print(f"- {count / 1024 / 1024}MB Downloaded") - #checksum = hashlib.sha256() - #with self.constants.payload_apple_root_path_zip.open("rb") as file: - # chunk = file.read(1024 * 1024 * 16) - # while chunk: - # checksum.update(chunk) - # chunk = file.read(1024 * 1024 * 16) - #print(f"- Checksum: {checksum.hexdigest()}") + response = requests.get(link, stream=True) + with self.constants.payload_apple_root_path_zip.open("wb") as file: + count = 0 + for chunk in response.iter_content(1024 * 1024 * 4): + file.write(chunk) + count += len(chunk) + Utilities.cls() + print(f"- Downloading Apple binaries ({os_ver}) from PatcherSupportPkg") + print(f"- {count / 1024 / 1024}MB Downloaded") + checksum = hashlib.sha256() + with self.constants.payload_apple_root_path_zip.open("rb") as file: + chunk = file.read(1024 * 1024 * 16) + while chunk: + checksum.update(chunk) + chunk = file.read(1024 * 1024 * 16) + print(f"- Checksum: {checksum.hexdigest()}") if self.constants.payload_apple_root_path_zip.exists(): print("- Download completed") print("- Unzipping download...") diff --git a/entitlements.plist b/entitlements.plist index 8cc185af8..b3804faad 100644 --- a/entitlements.plist +++ b/entitlements.plist @@ -4,5 +4,7 @@ com.apple.security.cs.disable-library-validation + com.apple.security.cs.disable-executable-page-protection +