Post

Replies

Boosts

Views

Activity

Mass deployment of certificates and marking it as trusted
Hello, I have a system, which is able to execute bash/zsh scripts on a set of machines. The default behaviour is that the signature of the script is checked on the machine, which is executing it, and in case if it is not signed properly, the system rejects the execution. An own certificate has to be created for signing the scripts, which means that the certificate has to be installed and marked as trusted on the target machines (which are executing the script). I've been using : "/usr/bin/security add-trusted-cert ..." command to install the certificate on the machines as trusted. Since macOS Big Sur, the above command was prompting the local user for admin credentials. To avoid this, Apple suggested to use the following command to temporarily disable and re-enable the confirmation dialog : 1.: /usr/bin/security authorizationdb write com.apple.trust-settings.admin allow 2.: /usr/bin/security authorizationdb write com.apple.trust-settings.admin admin Now with the release of macOS Sequoia, the above command : "/usr/bin/security authorizationdb write com.apple.trust-settings.admin allow" does not work any more. It gives the following output : NO (-60005) I have the following questions : 1.: Could you please suggest an alternative way for IT administrators to install certificates on their machines, without any user confirmation? 2.: Could you please suggest how the same could be achieved using a bash/zsh script? In which context could the above commands : "/usr/bin/security authorizationdb write com.apple.trust-settings.admin allow" and "/usr/bin/security authorizationdb write com.apple.trust-settings.admin admin" still work? Thank you for your help in advance!
6
2
529
Oct ’24
Detect when (internal or external) microphone is being used
Hello, I used kAudioDevicePropertyDeviceIsRunningSomewhere to check if an internal or external microphone is being used. My code works well for the internal microphone, and for microphones which are connected using a cable. External microphones which are connected using bluetooth are not reporting their status. The status is always requested successfully, but it is always reported as inactive. Main relevant parts in my code : static inline AudioObjectPropertyAddress makeGlobalPropertyAddress(AudioObjectPropertySelector selector) { AudioObjectPropertyAddress address = { selector, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster, }; return address; } static BOOL getBoolProperty(AudioDeviceID deviceID, AudioObjectPropertySelector selector) { AudioObjectPropertyAddress const address = makeGlobalPropertyAddress(selector); UInt32 prop; UInt32 propSize = sizeof(prop); OSStatus const status = AudioObjectGetPropertyData(deviceID, &address, 0, NULL, &propSize, &prop); if (status != noErr) { return 0; //this line never gets executed in my tests. The call above always succeeds, but it always gives back "false" status. } return static_cast<BOOL>(prop == 1); } ... __block BOOL microphoneActive = NO; iterateThroughAllInputDevices(^(AudioObjectID object, BOOL *stop) { if (getBoolProperty(object, kAudioDevicePropertyDeviceIsRunningSomewhere) != 0) { microphoneActive = YES; *stop = YES; } }); What could cause this and how could it be fixed? Thank you for your help in advance!
3
0
870
Nov ’23
NSApplicationPresentationDisableHideApplication is not disabling the "Hide" option from the dock menu
Hello, I am trying to use the following code to disable the Hide option for my application : NSApplicationPresentationOptions options = [NSApp presentationOptions]; options |= NSApplicationPresentationDisableHideApplication; [NSApp setPresentationOptions:options]; , but it doesn't have any effect : the Hide option is still clickable : How could I remove this option? Thanks for any help in advance!
0
0
355
Jul ’24
macOS Camera extension is not reported as a video device by `kCMIOHardwarePropertyDevices`
I have a macOS app, which detects if a camera is being used via the kCMIOHardwarePropertyDevices : typedef void (^DeviceIterator)(CMIOObjectID cameraObject, BOOL *stop); static void iterateThroughAllInputDevices(DeviceIterator deviceIterator) { // Check the number of devices. CMIOObjectPropertyAddress address = makeGlobalPropertyAddress(kCMIOHardwarePropertyDevices); UInt32 devicesDataSize; auto status = CMIOObjectGetPropertyDataSize(kCMIOObjectSystemObject, &address, 0, nil, &devicesDataSize); if (isError(status)) { return; } // Get the devices. UInt32 devicesDataUsed; int count = devicesDataSize / sizeof(CMIOObjectID); if (!count) { LOG_INFO("video device list is empty"); return; } I am using virtual machines for my automated end-to-end tests (which tests are written in Python). These Virtual Machines don't have a Camera device available, so I quickly wrote a macOS Camera Extension (based on the "Create camera extensions with Core Media IO" WWDC session ) in hope that it could act like a real camera. Unfortunately this Virtual Camera is not being detected by the code above. I am getting the video device list is empty message. How could I create a virtual (software) camera that would be listed by the API above?
2
0
2.0k
Oct ’22