Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 12.3 issue for profiles show #45

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion payload/Library/umad/Resources/umad_check_dep_record
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,25 @@ def has_dep_activation_record(plist_path):
if os.path.isfile(bad_record):
os.remove(bad_record)
run = subprocess.Popen(cmd, preexec_fn=os.setpgrp)
if get_os_version() >= LooseVersion('10.12'):
if get_os_version() >= LooseVersion("12.3"):
# running cmd on 12.3 will result in err 90% of the time but need to run at least
# once to write these files.
good_record = '/private/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound'
bad_record = '/private/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound'
if os.path.exists(bad_record):
return False
try:
with open(good_record, "rb") as file:
plist = plistlib.load(file)
except: # noqa
return False
if "CloudConfigFetchError" in plist:
# This happens for invalid serial numbers
return False
else:
copyfile(good_record, plist_path)
return True
elif get_os_version() >= LooseVersion("10.12") and get_os_version() < LooseVersion("12.3"~):
if err:
return False
try:
Expand Down