mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 22:20:53 +10:00
Test Write
This commit is contained in:
@@ -18,13 +18,8 @@ jobs:
|
|||||||
commitdate: ${{ github.event.head_commit.timestamp }}
|
commitdate: ${{ github.event.head_commit.timestamp }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- run: echo Commit MSG = $commitmsg
|
|
||||||
- run: echo Commit ID = $commitid
|
|
||||||
- run: echo Branch = $branch
|
|
||||||
- run: echo Commit URL = $commiturl
|
|
||||||
- run: echo Commit Date = $commitdate
|
|
||||||
- run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher-GUI.spec
|
- run: /Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller OpenCore-Patcher-GUI.spec
|
||||||
- run: python3 ./payloads/binary.py
|
- run: python3 ./payloads/binary.py $commitmsg $commitid $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"'
|
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"'
|
||||||
- run: cd dist; zip -r ../OpenCore-Patcher-wxPython.app.zip OpenCore-Patcher.app
|
- run: cd dist; zip -r ../OpenCore-Patcher-wxPython.app.zip OpenCore-Patcher.app
|
||||||
- run: ./../sign-wxpython.sh
|
- run: ./../sign-wxpython.sh
|
||||||
|
|||||||
+47
-8
@@ -11,12 +11,51 @@
|
|||||||
# cmdsize 16
|
# cmdsize 16
|
||||||
# version 10.13
|
# version 10.13
|
||||||
# sdk 10.9
|
# sdk 10.9
|
||||||
|
import sys
|
||||||
|
import plistlib
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
path = './dist/OpenCore-Patcher.app/Contents/MacOS/OpenCore-Patcher'
|
def main():
|
||||||
find = b'\x00\x0D\x0A\x00' # 10.13 (0xA0D)
|
patch_load_command()
|
||||||
replace = b'\x00\x0A\x0A\x00' # 10.10 (0xA0A)
|
patch_info_plist()
|
||||||
with open(path, 'rb') as f:
|
|
||||||
data = f.read()
|
|
||||||
data = data.replace(find, replace)
|
def patch_load_command():
|
||||||
with open(path, 'wb') as f:
|
print("- Patching LC_VERSION_MIN_MACOSX")
|
||||||
f.write(data)
|
path = './dist/OpenCore-Patcher.app/Contents/MacOS/OpenCore-Patcher'
|
||||||
|
find = b'\x00\x0D\x0A\x00' # 10.13 (0xA0D)
|
||||||
|
replace = b'\x00\x0A\x0A\x00' # 10.10 (0xA0A)
|
||||||
|
with open(path, 'rb') as f:
|
||||||
|
data = f.read()
|
||||||
|
data = data.replace(find, replace)
|
||||||
|
with open(path, 'wb') as f:
|
||||||
|
f.write(data)
|
||||||
|
|
||||||
|
def patch_info_plist():
|
||||||
|
print("- Updating Info.plist")
|
||||||
|
# Github Actions will supply us with the following environment variables:
|
||||||
|
# - Commit Message
|
||||||
|
# - Commit ID
|
||||||
|
# - Branch
|
||||||
|
# - Commit URL
|
||||||
|
# - Commit Date
|
||||||
|
|
||||||
|
argsv = sys.argv
|
||||||
|
argsv.pop(0)
|
||||||
|
plist_path = './dist/OpenCore-Patcher.app/Contents/Info.plist'
|
||||||
|
plist = plistlib.load(Path(plist_path).open("rb"))
|
||||||
|
print("- Loaded Plist")
|
||||||
|
# Add Github Dictonary
|
||||||
|
print("- Adding Github Dictionary")
|
||||||
|
plist["Github"] = {
|
||||||
|
"Commit Message": argsv[0],
|
||||||
|
"Commit ID": argsv[1],
|
||||||
|
"Branch": argsv[2],
|
||||||
|
"Commit URL": argsv[3],
|
||||||
|
"Commit Date": argsv[4],
|
||||||
|
}
|
||||||
|
print("- Writing Plist")
|
||||||
|
plistlib.dump(plist, Path(plist_path).open("wb"), sort_keys=True)
|
||||||
|
|
||||||
|
|
||||||
|
main()
|
||||||
Reference in New Issue
Block a user