Hi, The Application launches a Privileged XPC. To running Privileged tasks we use “AuthorizationCreate” AuthorizationCreate(_ rights: UnsafePointer?, _ environment: UnsafePointer?, _ flags: AuthorizationFlags, _ authorization: UnsafeMutablePointer<AuthorizationRef?>?) -> OSStatus which launches a authentication alert where we need to enter user name and password and it returns a AuthorizationRef , After receiving the “AuthorizationRef “ we pass the same AuthorizationRef to XPC while launching XPC via SMJobless SMJobBless(_ domain: CFString!, _ executableLabel: CFString, _ auth: AuthorizationRef!, _ outError: UnsafeMutablePointer<Unmanaged?>!) -> Bool The XPC is used to run Privileged tasks. Now I want to run my application on silent mode without any UI, using terminal. Is there any way to skip the authentication alert and get AuthorizationRef without any UI via terminal. The idea here is to uninstall the product silently using shell-script. So our app provides a silent mode which can be invoked from shell script. How do we handle privileged helper installation part? We are running shell-script using admin / sudo mode. Is there anyway to skip privileged mode instalation. prompt when we run the app from shell script? Thanks Majuj
Silently uninstall the product
Hi,
The Application launches a Privileged XPC. To running Privileged tasks we use “AuthorizationCreate” AuthorizationCreate(_ rights: UnsafePointer?, _ environment: UnsafePointer?, _ flags: AuthorizationFlags, _ authorization: UnsafeMutablePointer<AuthorizationRef?>?) -> OSStatus which launches a authentication alert where we need to enter user name and password and it returns a AuthorizationRef ,
After receiving the “AuthorizationRef “ we pass the same AuthorizationRef to XPC while launching XPC via SMJobless SMJobBless(_ domain: CFString!, _ executableLabel: CFString, _ auth: AuthorizationRef!, _ outError: UnsafeMutablePointer<Unmanaged?>!) -> Bool
The XPC is used to run Privileged tasks. Now I want to run my application on silent mode without any UI, using terminal. Is there any way to skip the authentication alert and get AuthorizationRef without any UI via terminal.
The idea here is to uninstall the product silently using shell-script. So our app provides a silent mode which can be invoked from shell script. How do we handle privileged helper installation part?
We are running shell-script using admin / sudo mode. Is there anyway to skip privileged mode instalation. prompt when we run the app from shell script? Thanks Majuj