Add password to zip

This commit is contained in:
Mykola Grymalyuk
2022-05-18 14:19:50 -06:00
parent 416138344a
commit b98fa0ced9
2 changed files with 5 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: python3 create_offline_build.py
- run: zip -r payloads.zip payloads
- run: zip -P password -r payloads.zip payloads
- run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher-GUI.spec
- run: python3 ./payloads/binary.py $branch $commiturl $commitdate
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"'

View File

@@ -76,12 +76,12 @@ class OpenCoreLegacyPatcher:
print("- Creating payloads directory")
Path(self.temp_dir.name / Path("payloads")).mkdir(parents=True, exist_ok=True)
use_zip = False
use_zip = True
# unzip payloads.zip to payloads directory
if use_zip is True:
print("- Unzipping payloads.zip")
output = subprocess.run(["unzip", "-o", "-q", "-d", self.temp_dir.name, f"{self.constants.payload_path}.zip"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = subprocess.run(["unzip", "-P", "password", "-o", "-q", "-d", self.temp_dir.name, f"{self.constants.payload_path}.zip"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if output.returncode == 0:
print(f"- Unzipped payloads.zip successfully: {self.temp_dir.name}")
self.constants.current_path = Path(self.temp_dir.name)
@@ -90,6 +90,8 @@ class OpenCoreLegacyPatcher:
print(f"self.constants.payload_path: {self.constants.payload_path}")
else:
print("- Failed to unzip payloads.zip, skipping")
print(f"Output: {output.stdout.decode('utf-8')}")
print(f"Return code: {output.returncode}")
else:
output = subprocess.run(["hdiutil", "attach", f"{self.constants.payload_path}.dmg", "-mountpoint", Path(self.temp_dir.name / Path("payloads")), "-nobrowse", "-shadow", Path(self.temp_dir.name / Path("payloads_overlay"))], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if output.returncode == 0: