Closed erikng closed 3 years ago
Full profiles can be found here:
https://github.com/macadmins/nudge/tree/main/Example%20Assets
But what happens if other things are missing or added? Or what if fake keys are added? How will the code currently work?
If I set requiredMinimumOSVersion to MobileConfig: 11.6 JSON Config: 11.5
and install both, it will default to the MobileConfig, if I remove that key from mobileconfig but have the JSON it uses the 11.5 from JSON, If I remove the JSON file then the UI doesn't launch and this is logged
2021-02-18 04:34:46.070493-0800 localhost Nudge[48988]: [com.github.macadmins.Nudge:utilities] Current operating system (11.1) is greater than or equal to required operating system (0.0)
Putting an invalid 11.abc
results in the comparison failing and no line Current operating system (11.1) is greater than or equal to required operating system xxx
Putting in unsused keys has no effect.
All in all it's pretty robust, are we comfortable mixing JSON and Profile prefs like this? Have DM'ed you some questions on some of the logic.
Yeah I have no issue with profile and json doing that. In fact that's exactly what I want.
One thing I'm curious about is what happens with the aboutUpdateURL and text if you supply a locale but nothing in it. Or specify the keys but no locale.
Thanks, Erik Gomez
From: Rory Murdock notifications@github.com Sent: Thursday, February 18, 2021 7:30:00 AM To: macadmins/nudge nudge@noreply.github.com Cc: Erik Gomez e@eriknicolasgomez.com; Author author@noreply.github.com Subject: Re: [macadmins/nudge] Test preferences with mobileconfig and json and see if anything breaks if keys are missing. (#114)
But what happens if other things are missing or added? Or what if fake keys are added? How will the code currently work?
If I set requiredMinimumOSVersion to MobileConfig: 11.6 JSON Config: 11.5
and install both, it will default to the MobileConfig, if I remove that key from mobileconfig but have the JSON it uses the 11.5 from JSON, If I remove the JSON file then the UI doesn't launch and this is logged 2021-02-18 04:34:46.070493-0800 localhost Nudge[48988]: [com.github.macadmins.Nudge:utilities] Current operating system (11.1) is greater than or equal to required operating system (0.0)
Putting an invalid 11.abc results in the comparison failing and no line Current operating system (11.1) is greater than or equal to required operating system xxx
Putting in unsused keys has no effect.
All in all it's pretty robust, are we comfortable mixing JSON and Profile prefs like this? Have DM'ed you some questions on some of the logic.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/macadmins/nudge/issues/114#issuecomment-781344421, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABLL6GDHRSHBVNXB6436CZLS7UI5RANCNFSM4XZPAJSQ.
Putting an invalid 11.abc results in the comparison failing and no line Current operating system (11.1) is greater than or equal to required operating system xxx
This is incorrect. I tested this a Swift Playground
print("11.2".compare("11.3", options: .numeric))
orderedAscending
print("11.2".compare("11.abc", options: .numeric))
orderedAscending
print("11.2".compare("11.1", options: .numeric))
orderedDescending
The comparison is actually happening and Nudge is detecting that the machine is out of date. That line only gets printed if the machine is running a higher OS than the requiredOSVersion.
One thing I'm curious about is what happens with the aboutUpdateURL and text if you supply a locale but nothing in it. Or specify the keys but no locale.
Tested this now. In both cases, Nudge does the right thing and does not display the More Info
button.
I'm closing this. Feeling good about this.
I need people to test permutations of the configurations and report here if things break. We know that at the very least to get Nudge working you need a configuration that contains at least this.
But what happens if other things are missing or added? Or what if fake keys are added? How will the code currently work?
com.github.macadmins.Nudge.json
com.github.macadmins.Nudge.mobileconfig