Skip to content

Commit

Permalink
Add SeedUtil option to Advanced Patcher Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
khronokernel committed May 17, 2021
1 parent 69ab0fd commit 93e9a8f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- dGPU must be disabled via NVRAM or deMUXed
- Increment binaries:
- Apple Binaries 478f6a6 (0.0.7 release - 05-16-2021)
- Add SeedUtil option to Advanced Patcher Settings

## 0.1.4
- Fix Device Path formatting on 2012+ iMacs
Expand Down
1 change: 1 addition & 0 deletions OpenCore-Patcher.command
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
#[f"Download more RAM:\t\t\tCurrently {self.constants.download_ram}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).download_more_ram_dot_com],
[f"Disable CPU Friend:\t\t\tCurrently {self.constants.disallow_cpufriend}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).disable_cpufriend],
[f"Set Custom name {self.constants.custom_cpu_model_value}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).custom_cpu],
[f"Set SeedUtil Status", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).set_seedutil],
]

for option in options:
Expand Down
31 changes: 31 additions & 0 deletions Resources/CliMenu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Handle misc CLI menu options
# Copyright (C) 2020-2021, Dhinak G, Mykola Grymalyuk
from __future__ import print_function
import subprocess

from Resources import ModelArray, Constants, Utilities

Expand Down Expand Up @@ -378,3 +379,33 @@ def disable_cpufriend(self):
self.constants.disallow_cpufriend = False
else:
print("Invalid option")

def set_seedutil(self):
Utilities.cls()
Utilities.header(["Set SeedUtil Status"])
print("""Used for setting OS Update Preferences
Valid options:
1. Public Release Seed (Default)
2. Public Beta Seed
3. Developer Beta Seed
4. Check SeedUtil's current status
""")

change_menu = input("Set update status(Press [ENTER] to exit): ")
if change_menu == "1":
subprocess.run(["sudo", "/System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil", "unenroll"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
elif change_menu == "2":
subprocess.run(["sudo", "/System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil", "unenroll"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
subprocess.run(["sudo", "/System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil", "enroll", "PublicSeed"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
elif change_menu == "3":
subprocess.run(["sudo", "/System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil", "unenroll"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
subprocess.run(["sudo", "/System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil", "enroll", "DeveloperSeed"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
elif change_menu == "4":
result = subprocess.run(["sudo", "/System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil", "current"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
result = [i.partition(":")[2] for i in result.stdout.decode().split("\n") if "Currently enrolled in" in i][0]
print(f"SeedUtil Current Status: {result}")
input("\nPress [ENTER] to continue")
self.set_seedutil()
else:
print("Returning to main menu")

0 comments on commit 93e9a8f

Please sign in to comment.