Preferences com.apple.screensaver doesn't contain few keys

In previous versions of macOS the settings from System Preferences -> Security & Privacy -> General were displaying in ~/Library/Preferences/com.apple.screensaver.plist. But starting from 10.13 com.apple.screensaver.plist contains only one key.

com.apple.screensaver.plist
10.12

ml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>askForPassword</key>
  <integer>1</integer>
  <key>askForPasswordDelay</key>
  <real>5</real>
  <key>tokenRemovalAction</key>
  <integer>0</integer>
</dict>
</plist>


com.apple.screensaver.plist 10.13

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>tokenRemovalAction</key>
  <integer>0</integer>
</dict>
</plist>

Is it a bug or askForPassword and askForPasswordDelay were moved to another location? How can I get these settings?


Thanks,
Artem

Hello,


I also have this problem and currently I didn't find any solution for that. Probably Apple changed implementation where these values are stored. Values

askForPassword and askForPasswordDelay are from Security Pane and I think that Apple redesigned this solution to be more secure.


As you can see special file User.kb in the location ~/Library/Keychains/your-super-udid/ is modified when you edit values in the security pane.
Also Console.app is showing console log for updating delay password values. It's completely different then in 10.12


/System/Library/PreferencesPanes/Security.prefPane/Contents/XPCServices/com.apple.preference.security.remoteservice.xpc/
Contents/MacOS/com.apple.preference.security.remoteservice


Do you know some methods how can I read this values via terminal / Objective-C on 10.13 machine?


I will greatly appreciate your feedback.

Best,
Adrian

Hello,


I have the same issue. Lack of ability to read and modify screensaver settings stopping us. These settings are used it various projects around the web.

Would be good to know if there is some replacement for High Sierra or read/modify these settings no longer possible.

Hello Adrian,


I'm afraid, if these settings are moved to keychain we won't get it. Probably, Apple see some security issues in storing these values in plist. I hope com.apple.preference.security.remoteservice.xpc will provide a read-only interface somehow. I don't see any ways to get these settings for now. I wonder if Apple can comment it.


Thanks, Artem

I see the same thing in 10.13. Although this may not be useful for you, it is possible to READ the values for one of the keys:


This will return true or false for whether the password is required after wake:


osascript -e 'tell application "System Events" to tell security preferences to get require password to wake'



You can read the delay until the screen saver starts:

osascript -e 'tell application "System Events" to tell screen saver preferences to get delay interval'



But, I don't see a way to read the "Require password after X minutes after sleep or screen saver begins"

Hmm, perhaps I'm wrong?


In fact, this command:


osascript -e 'tell application "System Events" to tell security preferences to get require password to wake'


in both 10.12.6 and 10.13.0 beta 9 is always returning 'true' regardless of the setting. Another bug?

In fact, this command:


osascript -e 'tell application "System Events" to tell security preferences to get require password to wake' 


in both 10.12.6 and 10.13.0 beta 9 is always returning 'true' regardless of the setting.   Another bug?

I've submitted this one as rdar://34431876

You know, thanks for this. It gives me a starting point to try to track down an issue we are seeing


We are injecting a profile that contains the "10.12" keys for com.apple.screensaver and if we inject the profile while at the login screen *with the screensaver on* -- the screensaver is going black with just a cursor visible -- and we can't clear out the "black-with-cursor" screen without closing/reopening the laptop lid.


and the system.log shows that the screensaver process crashes.


So maybe our old profiles need to be modified to not include those keys. I hope that's the issue!