From 206c83f95643120baf371c9cda7ff089e508f44b Mon Sep 17 00:00:00 2001 From: Allen Golbig Date: Wed, 25 Jan 2023 15:26:35 -0500 Subject: [PATCH] fix[rule] updated check for USB restricted mode Updated system_settings_usb_restricted_mode issue #222 --- .../system_settings_USB_restricted_mode.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rules/system_settings/system_settings_USB_restricted_mode.yaml b/rules/system_settings/system_settings_USB_restricted_mode.yaml index 6cf6e54d..b82538b6 100644 --- a/rules/system_settings/system_settings_USB_restricted_mode.yaml +++ b/rules/system_settings/system_settings_USB_restricted_mode.yaml @@ -9,8 +9,15 @@ discussion: | ==== check: | /usr/bin/osascript -l JavaScript << EOS - $.NSUserDefaults.alloc.initWithSuiteName('com.apple.applicationaccess')\ - .objectForKey('allowUSBRestrictedMode').js + function run() { + let pref1 = ObjC.unwrap($.NSUserDefaults.alloc.initWithSuiteName('com.apple.applicationaccess')\ + .objectForKey('allowUSBRestrictedMode')) + if ( pref1 == false ) { + return("false") + } else { + return("true") + } + } EOS result: string: "true"