systemextensions

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package systemextensions provides Go bindings for the SystemExtensions framework.

Install and manage user space code that extends the capabilities of macOS.

Extend the capabilities of macOS by installing and managing system extensions—drivers and other low-level code—in user space rather than in the kernel. By running in user space, system extensions can’t compromise the security or stability of macOS. The system grants these extensions a high level of privilege, so they can perform the kinds of tasks previously reserved for kernel extensions (KEXTs).

Essentials

  • Implementing drivers, system extensions, and kexts: Create drivers and system extensions to communicate with hardware and provide low-level services, and only use kernel extensions for a few tasks.
  • Debugging and testing system extensions: Debug your system extensions by temporarily disabling the security checks that macOS performs during the installation process.
  • System Extension Entitlement: A Boolean value that indicates whether your app has permission to activate or deactivate system extensions.

Usage descriptions

  • NSSystemExtensionUsageDescriptionKey: A message that tells the user why the app is trying to install a system extension bundle.
  • OSBundleUsageDescriptionKey: A message that tells the user why the app is trying to install a driver extension bundle.

Extension activation and deactivation

  • Installing System Extensions and Drivers: Activate system extensions and drivers to make them available to the system, and update or deactivate them as needed.
  • OSSystemExtensionManager: A type that facilitates activation and deactivation of system extensions. (OSSystemExtensionRequest)
  • OSSystemExtensionRequest: A request to activate or deactivate a system extension. (OSSystemExtensionRequestDelegate)
  • System Extension Redistributable Entitlement: A Boolean value that indicates whether other development teams may distribute a system extension you create.

Errors

  • OSSystemExtensionError: An error that describes a failed extension manager request.
  • OSSystemExtensionError.Code: Error codes for system extensions.
  • OSSystemExtensionErrorDomain: The error domain identifying system extension errors.

Classes

  • OSSystemExtensionInfo
  • OSSystemExtensionsWorkspace

Protocols

  • OSSystemExtensionsWorkspaceObserver

Key Types

Code generated from Apple documentation. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	// SystemExtensionUsageDescriptionKey is a message that tells the user why the app is trying to install a system extension bundle.
	//
	// See: https://developer.apple.com/documentation/SystemExtensions/NSSystemExtensionUsageDescriptionKey
	SystemExtensionUsageDescriptionKey string
	// OSBundleUsageDescriptionKey is a message that tells the user why the app is trying to install a driver extension bundle.
	//
	// See: https://developer.apple.com/documentation/SystemExtensions/OSBundleUsageDescriptionKey
	OSBundleUsageDescriptionKey string
	// See: https://developer.apple.com/documentation/SystemExtensions/OSRelatedKernelExtensionKey
	OSRelatedKernelExtensionKey string
)
View Source
var (
	// OSSystemExtensionErrorDomain is the error domain identifying system extension errors.
	//
	// See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionErrorDomain
	OSSystemExtensionErrorDomain foundation.NSErrorDomain
)

Functions

This section is empty.

Types

type IOSSystemExtensionInfo

type IOSSystemExtensionInfo interface {
	objectivec.IObject

	BundleIdentifier() string
	BundleShortVersion() string
	BundleVersion() string
}

An interface definition for the OSSystemExtensionInfo class.

Instance Properties

  • [IOSSystemExtensionInfo.BundleIdentifier]
  • [IOSSystemExtensionInfo.BundleShortVersion]
  • [IOSSystemExtensionInfo.BundleVersion]

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionInfo

type IOSSystemExtensionManager

type IOSSystemExtensionManager interface {
	objectivec.IObject

	// Submits a system extension request to the manager.
	SubmitRequest(request IOSSystemExtensionRequest)

	// A delegate to receive updates about the progress of a request.
	Delegate() OSSystemExtensionRequestDelegate
	SetDelegate(value OSSystemExtensionRequestDelegate)
}

An interface definition for the OSSystemExtensionManager class.

Submitting Requests

  • [IOSSystemExtensionManager.SubmitRequest]: Submits a system extension request to the manager.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionManager

type IOSSystemExtensionProperties

type IOSSystemExtensionProperties interface {
	objectivec.IObject

	// The bundle identifier of the extension.
	BundleIdentifier() string
	// The bundle version of the extension.
	BundleVersion() string
	// The bundle short version string of the extension.
	BundleShortVersion() string

	// The file URL of the extension bundle.
	URL() foundation.INSURL

	IsAwaitingUserApproval() bool
	IsEnabled() bool
	IsUninstalling() bool
}

An interface definition for the OSSystemExtensionProperties class.

Identifying the Extension

  • [IOSSystemExtensionProperties.BundleIdentifier]: The bundle identifier of the extension.
  • [IOSSystemExtensionProperties.BundleVersion]: The bundle version of the extension.
  • [IOSSystemExtensionProperties.BundleShortVersion]: The bundle short version string of the extension.

Locating the Extension’s Installed Location

  • [IOSSystemExtensionProperties.URL]: The file URL of the extension bundle.

Instance Properties

  • [IOSSystemExtensionProperties.IsAwaitingUserApproval]
  • [IOSSystemExtensionProperties.IsEnabled]
  • [IOSSystemExtensionProperties.IsUninstalling]

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionProperties

type IOSSystemExtensionRequest

type IOSSystemExtensionRequest interface {
	objectivec.IObject

	// A delegate to receive updates about the progress of a request.
	Delegate() OSSystemExtensionRequestDelegate
	SetDelegate(value OSSystemExtensionRequestDelegate)

	// The bundle identifier of the target extension.
	Identifier() string
}

An interface definition for the OSSystemExtensionRequest class.

Working with a Delegate

  • [IOSSystemExtensionRequest.Delegate]: A delegate to receive updates about the progress of a request.
  • [IOSSystemExtensionRequest.SetDelegate]

Identifying the Target Extension

  • [IOSSystemExtensionRequest.Identifier]: The bundle identifier of the target extension.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequest

type IOSSystemExtensionsWorkspace

type IOSSystemExtensionsWorkspace interface {
	objectivec.IObject

	AddObserverError(observer OSSystemExtensionsWorkspaceObserver) (bool, error)
	RemoveObserver(observer OSSystemExtensionsWorkspaceObserver)
}

An interface definition for the OSSystemExtensionsWorkspace class.

Instance Methods

  • [IOSSystemExtensionsWorkspace.AddObserverError]
  • [IOSSystemExtensionsWorkspace.RemoveObserver]

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionsWorkspace

type OSSystemExtensionErrorCode

type OSSystemExtensionErrorCode int

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionError/Code

const (
	// OSSystemExtensionErrorAuthorizationRequired: An error code that indicates the system was unable to obtain the proper authorization.
	OSSystemExtensionErrorAuthorizationRequired OSSystemExtensionErrorCode = 13
	// OSSystemExtensionErrorCodeSignatureInvalid: An error code that indicates the extension’s signature is invalid.
	OSSystemExtensionErrorCodeSignatureInvalid OSSystemExtensionErrorCode = 8
	// OSSystemExtensionErrorDuplicateExtensionIdentifer: An error code that indicates the extension identifier duplicates an existing identifier.
	OSSystemExtensionErrorDuplicateExtensionIdentifer OSSystemExtensionErrorCode = 6
	// OSSystemExtensionErrorExtensionMissingIdentifier: An error code that indicates the extension identifier is missing.
	OSSystemExtensionErrorExtensionMissingIdentifier OSSystemExtensionErrorCode = 5
	// OSSystemExtensionErrorExtensionNotFound: An error code that indicates the manager can’t find the system extension.
	OSSystemExtensionErrorExtensionNotFound OSSystemExtensionErrorCode = 4
	// OSSystemExtensionErrorForbiddenBySystemPolicy: An error code that indicates the system policy prohibits activating the system extension.
	OSSystemExtensionErrorForbiddenBySystemPolicy OSSystemExtensionErrorCode = 10
	// OSSystemExtensionErrorMissingEntitlement: An error code that indicates the system extension lacks a required entitlement.
	OSSystemExtensionErrorMissingEntitlement OSSystemExtensionErrorCode = 2
	// OSSystemExtensionErrorRequestCanceled: An error code that indicates the system extension manager request was canceled.
	OSSystemExtensionErrorRequestCanceled OSSystemExtensionErrorCode = 11
	// OSSystemExtensionErrorRequestSuperseded: An error code that indicates the system extension request failed because the system already has a pending request for the same identifier.
	OSSystemExtensionErrorRequestSuperseded OSSystemExtensionErrorCode = 12
	// OSSystemExtensionErrorUnknown: An error code that indicates an unknown error occurred.
	OSSystemExtensionErrorUnknown OSSystemExtensionErrorCode = 1
	// OSSystemExtensionErrorUnknownExtensionCategory: An error code that indicates the extension manager can’t recognize the extension’s category identifier.
	OSSystemExtensionErrorUnknownExtensionCategory OSSystemExtensionErrorCode = 7
	// OSSystemExtensionErrorUnsupportedParentBundleLocation: An error code that indicates the extension’s parent app isn’t in a valid location for activation.
	OSSystemExtensionErrorUnsupportedParentBundleLocation OSSystemExtensionErrorCode = 3
	// OSSystemExtensionErrorValidationFailed: An error code that indicates the manager can’t validate the extension.
	OSSystemExtensionErrorValidationFailed OSSystemExtensionErrorCode = 9
)

func (OSSystemExtensionErrorCode) String

type OSSystemExtensionInfo

type OSSystemExtensionInfo struct {
	objectivec.Object
}

Instance Properties

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionInfo

func NewOSSystemExtensionInfo

func NewOSSystemExtensionInfo() OSSystemExtensionInfo

NewOSSystemExtensionInfo creates a new OSSystemExtensionInfo instance.

func OSSystemExtensionInfoFromID

func OSSystemExtensionInfoFromID(id objc.ID) OSSystemExtensionInfo

OSSystemExtensionInfoFromID constructs a OSSystemExtensionInfo from an objc.ID.

func (OSSystemExtensionInfo) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (OSSystemExtensionInfo) BundleIdentifier

func (o OSSystemExtensionInfo) BundleIdentifier() string

Discussion

The bundle identifier of the extension (CFBundleIdentifier)

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionInfo/bundleIdentifier

func (OSSystemExtensionInfo) BundleShortVersion

func (o OSSystemExtensionInfo) BundleShortVersion() string

Discussion

The bundle short version string of the extension (CFBundleShortVersionString)

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionInfo/bundleShortVersion

func (OSSystemExtensionInfo) BundleVersion

func (o OSSystemExtensionInfo) BundleVersion() string

Discussion

The bundle version of the extension (CFBundleVersion)

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionInfo/bundleVersion

func (OSSystemExtensionInfo) Init

Init initializes the instance.

type OSSystemExtensionInfoClass

type OSSystemExtensionInfoClass struct {
	// contains filtered or unexported fields
}

func GetOSSystemExtensionInfoClass

func GetOSSystemExtensionInfoClass() OSSystemExtensionInfoClass

GetOSSystemExtensionInfoClass returns the class object for OSSystemExtensionInfo.

func (OSSystemExtensionInfoClass) Alloc

Alloc allocates memory for a new instance of the class.

func (OSSystemExtensionInfoClass) Class

Class returns the underlying Objective-C class pointer.

type OSSystemExtensionManager

type OSSystemExtensionManager struct {
	objectivec.Object
}

A type that facilitates activation and deactivation of system extensions.

Overview

Create an instance of OSSystemExtensionRequest with the class methods on that type, and submit it to the shared instance of the extension manager with OSSystemExtensionManager.SubmitRequest. Set the OSSystemExtensionManager.Delegate on the request to receive the result of the activation or deactivation. The delegate also receives notifications if the user needs to authorize the extension or if a version conflict occurs.

Submitting Requests

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionManager

func NewOSSystemExtensionManager

func NewOSSystemExtensionManager() OSSystemExtensionManager

NewOSSystemExtensionManager creates a new OSSystemExtensionManager instance.

func OSSystemExtensionManagerFromID

func OSSystemExtensionManagerFromID(id objc.ID) OSSystemExtensionManager

OSSystemExtensionManagerFromID constructs a OSSystemExtensionManager from an objc.ID.

A type that facilitates activation and deactivation of system extensions.

func (OSSystemExtensionManager) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (OSSystemExtensionManager) Delegate

A delegate to receive updates about the progress of a request.

See: https://developer.apple.com/documentation/systemextensions/ossystemextensionrequest/delegate

func (OSSystemExtensionManager) Init

Init initializes the instance.

func (OSSystemExtensionManager) SetDelegate

func (OSSystemExtensionManager) SubmitRequest

func (o OSSystemExtensionManager) SubmitRequest(request IOSSystemExtensionRequest)

Submits a system extension request to the manager.

request: The request to process.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionManager/submitRequest(_:)

type OSSystemExtensionManagerClass

type OSSystemExtensionManagerClass struct {
	// contains filtered or unexported fields
}

func GetOSSystemExtensionManagerClass

func GetOSSystemExtensionManagerClass() OSSystemExtensionManagerClass

GetOSSystemExtensionManagerClass returns the class object for OSSystemExtensionManager.

func (OSSystemExtensionManagerClass) Alloc

Alloc allocates memory for a new instance of the class.

func (OSSystemExtensionManagerClass) Class

Class returns the underlying Objective-C class pointer.

func (OSSystemExtensionManagerClass) SharedManager

func (_OSSystemExtensionManagerClass OSSystemExtensionManagerClass) SharedManager() OSSystemExtensionManager

The shared instance of the extension manager.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionManager/shared

type OSSystemExtensionProperties

type OSSystemExtensionProperties struct {
	objectivec.Object
}

Properties that identify a specific version of a system extension.

Identifying the Extension

Locating the Extension’s Installed Location

Instance Properties

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionProperties

func NewOSSystemExtensionProperties

func NewOSSystemExtensionProperties() OSSystemExtensionProperties

NewOSSystemExtensionProperties creates a new OSSystemExtensionProperties instance.

func OSSystemExtensionPropertiesFromID

func OSSystemExtensionPropertiesFromID(id objc.ID) OSSystemExtensionProperties

OSSystemExtensionPropertiesFromID constructs a OSSystemExtensionProperties from an objc.ID.

Properties that identify a specific version of a system extension.

func (OSSystemExtensionProperties) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (OSSystemExtensionProperties) BundleIdentifier

func (o OSSystemExtensionProperties) BundleIdentifier() string

The bundle identifier of the extension.

Discussion

This is the CFBundleIdentifier of the extension bundle.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionProperties/bundleIdentifier

func (OSSystemExtensionProperties) BundleShortVersion

func (o OSSystemExtensionProperties) BundleShortVersion() string

The bundle short version string of the extension.

Discussion

This is the CFBundleShortVersionString of the extension bundle.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionProperties/bundleShortVersion

func (OSSystemExtensionProperties) BundleVersion

func (o OSSystemExtensionProperties) BundleVersion() string

The bundle version of the extension.

Discussion

This is the CFBundleVersion of the extension bundle.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionProperties/bundleVersion

func (OSSystemExtensionProperties) Init

Init initializes the instance.

func (OSSystemExtensionProperties) URL

The file URL of the extension bundle.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionProperties/url

type OSSystemExtensionPropertiesClass

type OSSystemExtensionPropertiesClass struct {
	// contains filtered or unexported fields
}

func GetOSSystemExtensionPropertiesClass

func GetOSSystemExtensionPropertiesClass() OSSystemExtensionPropertiesClass

GetOSSystemExtensionPropertiesClass returns the class object for OSSystemExtensionProperties.

func (OSSystemExtensionPropertiesClass) Alloc

Alloc allocates memory for a new instance of the class.

func (OSSystemExtensionPropertiesClass) Class

Class returns the underlying Objective-C class pointer.

type OSSystemExtensionReplacementAction

type OSSystemExtensionReplacementAction int

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequest/ReplacementAction

const (
	// OSSystemExtensionReplacementActionCancel: An action that tells the manager to cancel replacement of a system extension.
	OSSystemExtensionReplacementActionCancel OSSystemExtensionReplacementAction = 0
	// OSSystemExtensionReplacementActionReplace: An action that tells the manager to replace an existing system extension.
	OSSystemExtensionReplacementActionReplace OSSystemExtensionReplacementAction = 1
)

func (OSSystemExtensionReplacementAction) String

type OSSystemExtensionRequest

type OSSystemExtensionRequest struct {
	objectivec.Object
}

A request to activate or deactivate a system extension.

Working with a Delegate

Identifying the Target Extension

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequest

func NewOSSystemExtensionRequest

func NewOSSystemExtensionRequest() OSSystemExtensionRequest

NewOSSystemExtensionRequest creates a new OSSystemExtensionRequest instance.

func OSSystemExtensionRequestFromID

func OSSystemExtensionRequestFromID(id objc.ID) OSSystemExtensionRequest

OSSystemExtensionRequestFromID constructs a OSSystemExtensionRequest from an objc.ID.

A request to activate or deactivate a system extension.

func (OSSystemExtensionRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (OSSystemExtensionRequest) Delegate

A delegate to receive updates about the progress of a request.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequest/delegate

func (OSSystemExtensionRequest) Identifier

func (o OSSystemExtensionRequest) Identifier() string

The bundle identifier of the target extension.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequest/identifier

func (OSSystemExtensionRequest) Init

Init initializes the instance.

func (OSSystemExtensionRequest) SetDelegate

type OSSystemExtensionRequestClass

type OSSystemExtensionRequestClass struct {
	// contains filtered or unexported fields
}

func GetOSSystemExtensionRequestClass

func GetOSSystemExtensionRequestClass() OSSystemExtensionRequestClass

GetOSSystemExtensionRequestClass returns the class object for OSSystemExtensionRequest.

func (OSSystemExtensionRequestClass) ActivationRequestForExtensionQueue

func (_OSSystemExtensionRequestClass OSSystemExtensionRequestClass) ActivationRequestForExtensionQueue(identifier string, queue dispatch.Queue) OSSystemExtensionRequest

Creates a request to activate a System Extension.

identifier: The bundle identifier of the target extension.

queue: The dispatch queue to use when calling delegate methods.

Return Value

A new extension request.

Discussion

Create and submit an activation request whenever you want to use a given extension. If the extension is inactive, the system may need to prompt the user for approval. The request succeeds only after the user gives their approval.

If the extension is already active, the request succeeds in short order, without significant delay or user interaction. If you request activation of a new version of an already-active extension, the system prompts the user to resolve the conflict before proceeding.

An activation request may succeed, but also indicate that the extension requires a restart to become active. This can occur when replacing an extension that required a restart to deactivate. The most recently activated extension becomes active when the user restarts their Mac.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequest/activationRequest(forExtensionWithIdentifier:queue:)

func (OSSystemExtensionRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

func (OSSystemExtensionRequestClass) Class

Class returns the underlying Objective-C class pointer.

func (OSSystemExtensionRequestClass) DeactivationRequestForExtensionQueue

func (_OSSystemExtensionRequestClass OSSystemExtensionRequestClass) DeactivationRequestForExtensionQueue(identifier string, queue dispatch.Queue) OSSystemExtensionRequest

Creates a request to deactivate a System Extension.

identifier: The bundle identifier of the extension to deactivate.

queue: The dispatch queue to use when calling delegate methods.

Discussion

The system discovers existing system extensions in the `Contents/Library/SystemExtensions` directory of the main app bundle.

A deactivation request may require a restart before deactivating the extension. If the request succeeds but requires a restart to complete, the extension may still appear operational until the next restart.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequest/deactivationRequest(forExtensionWithIdentifier:queue:)

type OSSystemExtensionRequestDelegate

type OSSystemExtensionRequestDelegate interface {
	objectivec.IObject

	// Tells the delegate that the manager completed the request.
	//
	// See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequestDelegate/request(_:didFinishWithResult:)
	RequestDidFinishWithResult(request IOSSystemExtensionRequest, result OSSystemExtensionRequestResult)

	// Tells the delegate the manager failed to complete the request.
	//
	// See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequestDelegate/request(_:didFailWithError:)
	RequestDidFailWithError(request IOSSystemExtensionRequest, error_ foundation.INSError)

	// Tells the delegate that the user must grant approval before the manager can activate the extension.
	//
	// See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequestDelegate/requestNeedsUserApproval(_:)
	RequestNeedsUserApproval(request IOSSystemExtensionRequest)

	// Tells the delegate that the user has a different version of the extension installed on their system.
	//
	// See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequestDelegate/request(_:actionForReplacingExtension:withExtension:)
	RequestActionForReplacingExtensionWithExtension(request IOSSystemExtensionRequest, existing IOSSystemExtensionProperties, ext IOSSystemExtensionProperties) OSSystemExtensionReplacementAction
}

A type that receives updates about the progress of a request.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequestDelegate

type OSSystemExtensionRequestDelegateConfig

type OSSystemExtensionRequestDelegateConfig struct {

	// Handling Success and Failure
	// RequestDidFinishWithResult — Tells the delegate that the manager completed the request.
	RequestDidFinishWithResult func(request OSSystemExtensionRequest, result OSSystemExtensionRequestResult)
	// RequestDidFailWithError — Tells the delegate the manager failed to complete the request.
	RequestDidFailWithError func(request OSSystemExtensionRequest, error_ foundation.NSError)

	// Handling Indeterminate Installs
	// RequestNeedsUserApproval — Tells the delegate that the user must grant approval before the manager can activate the extension.
	RequestNeedsUserApproval func(request OSSystemExtensionRequest)
	// RequestActionForReplacingExtensionWithExtension — Tells the delegate that the user has a different version of the extension installed on their system.
	RequestActionForReplacingExtensionWithExtension func(request OSSystemExtensionRequest, existing OSSystemExtensionProperties, ext OSSystemExtensionProperties) OSSystemExtensionReplacementAction
}

OSSystemExtensionRequestDelegateConfig holds optional typed callbacks for OSSystemExtensionRequestDelegate methods. Set non-nil fields to register the corresponding Objective-C delegate method. Methods with nil callbacks are not registered, so [NSObject.RespondsToSelector] returns false for them — matching the Objective-C delegate pattern exactly.

See Apple Documentation for protocol details.

type OSSystemExtensionRequestDelegateObject

type OSSystemExtensionRequestDelegateObject struct {
	objectivec.Object
}

OSSystemExtensionRequestDelegateObject wraps an existing Objective-C object that conforms to the OSSystemExtensionRequestDelegate protocol.

func NewOSSystemExtensionRequestDelegate

func NewOSSystemExtensionRequestDelegate(config OSSystemExtensionRequestDelegateConfig) OSSystemExtensionRequestDelegateObject

NewOSSystemExtensionRequestDelegate creates an Objective-C object implementing the OSSystemExtensionRequestDelegate protocol.

Each call registers a unique Objective-C class containing only the methods set in config. This means [NSObject.RespondsToSelector] works correctly for optional delegate methods — only non-nil callbacks are registered.

The returned OSSystemExtensionRequestDelegateObject satisfies the OSSystemExtensionRequestDelegate interface and can be passed directly to SetDelegate and similar methods.

See Apple Documentation for protocol details.

func OSSystemExtensionRequestDelegateObjectFromID

func OSSystemExtensionRequestDelegateObjectFromID(id objc.ID) OSSystemExtensionRequestDelegateObject

OSSystemExtensionRequestDelegateObjectFromID constructs a OSSystemExtensionRequestDelegateObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (OSSystemExtensionRequestDelegateObject) BaseObject

func (OSSystemExtensionRequestDelegateObject) RequestActionForReplacingExtensionWithExtension

Tells the delegate that the user has a different version of the extension installed on their system.

request: The request that encountered a conflict.

existing: A properties object that describes the installed version of the extension.

ext: A properties object that describes the updated version of the extension.

Return Value

A replacement action the manager should take to resolve the conflict.

Discussion

The manager calls this method when it encounters an existing extension with the same team and bundle identifiers, but with different version identifiers. It uses the CFBundleVersion and CFBundleShortVersionString identifiers to determine if the existing and new versions differ. The delegate must make a decision on whether to replace the existing extension.

Implement this method to return an OSSystemExtensionRequest.ReplacementAction, which tells the manager what to do. If you return OSSystemExtensionReplacementActionCancel, the manager aborts the installation and calls [RequestDidFailWithError], with the OSSystemExtensionErrorRequestCanceled error code.

If the local system has System Extension developer mode enabled, the manager always calls this method when it finds an existing installation, even if the version identifiers match.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequestDelegate/request(_:actionForReplacingExtension:withExtension:)

func (OSSystemExtensionRequestDelegateObject) RequestDidFailWithError

func (o OSSystemExtensionRequestDelegateObject) RequestDidFailWithError(request IOSSystemExtensionRequest, error_ foundation.INSError)

Tells the delegate the manager failed to complete the request.

request: The request that failed.

error: The reason the request failed.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequestDelegate/request(_:didFailWithError:)

func (OSSystemExtensionRequestDelegateObject) RequestDidFinishWithResult

Tells the delegate that the manager completed the request.

request: The request that completed.

result: Additional information about the completion state.

Discussion

If the request completes with the OSSystemExtensionRequestWillCompleteAfterReboot result, then the extension isn’t active until after the next restart. After restarting, the most recently-processed request determines the extension’s state. Consider the following scenarios:

- Activate extension and restart: the extension is active upon restarting. - Activate extension, deactivate extension, and restart: the extension is inactive upon restarting.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequestDelegate/request(_:didFinishWithResult:)

func (OSSystemExtensionRequestDelegateObject) RequestNeedsUserApproval

func (o OSSystemExtensionRequestDelegateObject) RequestNeedsUserApproval(request IOSSystemExtensionRequest)

Tells the delegate that the user must grant approval before the manager can activate the extension.

Discussion

Activating an extension may require explicit user approval to proceed. For example, this occurs when the user hasn’t approved the extension. The manager calls this method to notify the delegate. Activation remains pending until the user grants or denies permission, or until the app quits.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequestDelegate/requestNeedsUserApproval(_:)

type OSSystemExtensionRequestResult

type OSSystemExtensionRequestResult int

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionRequest/Result

const (
	// OSSystemExtensionRequestCompleted: The request completed successfully.
	OSSystemExtensionRequestCompleted OSSystemExtensionRequestResult = 0
	// OSSystemExtensionRequestWillCompleteAfterReboot: The request requires a restart to complete successfully.
	OSSystemExtensionRequestWillCompleteAfterReboot OSSystemExtensionRequestResult = 1
)

func (OSSystemExtensionRequestResult) String

type OSSystemExtensionsWorkspace

type OSSystemExtensionsWorkspace struct {
	objectivec.Object
}

Overview

Instance Methods

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionsWorkspace

func NewOSSystemExtensionsWorkspace

func NewOSSystemExtensionsWorkspace() OSSystemExtensionsWorkspace

NewOSSystemExtensionsWorkspace creates a new OSSystemExtensionsWorkspace instance.

func OSSystemExtensionsWorkspaceFromID

func OSSystemExtensionsWorkspaceFromID(id objc.ID) OSSystemExtensionsWorkspace

OSSystemExtensionsWorkspaceFromID constructs a OSSystemExtensionsWorkspace from an objc.ID.

func (OSSystemExtensionsWorkspace) AddObserverError

Discussion

Start observing changes to System Extension(s) which are enabled or ready to be enabled.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionsWorkspace/addObserver(_:)

func (OSSystemExtensionsWorkspace) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (OSSystemExtensionsWorkspace) Init

Init initializes the instance.

func (OSSystemExtensionsWorkspace) RemoveObserver

Discussion

Stop observing changes to System Extension(s).

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionsWorkspace/removeObserver(_:)

type OSSystemExtensionsWorkspaceClass

type OSSystemExtensionsWorkspaceClass struct {
	// contains filtered or unexported fields
}

func GetOSSystemExtensionsWorkspaceClass

func GetOSSystemExtensionsWorkspaceClass() OSSystemExtensionsWorkspaceClass

GetOSSystemExtensionsWorkspaceClass returns the class object for OSSystemExtensionsWorkspace.

func (OSSystemExtensionsWorkspaceClass) Alloc

Alloc allocates memory for a new instance of the class.

func (OSSystemExtensionsWorkspaceClass) Class

Class returns the underlying Objective-C class pointer.

type OSSystemExtensionsWorkspaceObserver

type OSSystemExtensionsWorkspaceObserver interface {
	objectivec.IObject
}

OSSystemExtensionsWorkspaceObserver protocol.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionsWorkspaceObserver

type OSSystemExtensionsWorkspaceObserverObject

type OSSystemExtensionsWorkspaceObserverObject struct {
	objectivec.Object
}

OSSystemExtensionsWorkspaceObserverObject wraps an existing Objective-C object that conforms to the OSSystemExtensionsWorkspaceObserver protocol.

func OSSystemExtensionsWorkspaceObserverObjectFromID

func OSSystemExtensionsWorkspaceObserverObjectFromID(id objc.ID) OSSystemExtensionsWorkspaceObserverObject

OSSystemExtensionsWorkspaceObserverObjectFromID constructs a OSSystemExtensionsWorkspaceObserverObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (OSSystemExtensionsWorkspaceObserverObject) BaseObject

func (OSSystemExtensionsWorkspaceObserverObject) SystemExtensionWillBecomeDisabled

func (o OSSystemExtensionsWorkspaceObserverObject) SystemExtensionWillBecomeDisabled(systemExtensionInfo IOSSystemExtensionInfo)

Discussion

This delegate method will be called when the user disables an already enabled system extension, or when the system extension is first installed and is in the disabled state.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionsWorkspaceObserver/systemExtensionWillBecomeDisabled(_:)

func (OSSystemExtensionsWorkspaceObserverObject) SystemExtensionWillBecomeEnabled

func (o OSSystemExtensionsWorkspaceObserverObject) SystemExtensionWillBecomeEnabled(systemExtensionInfo IOSSystemExtensionInfo)

Discussion

This delegate method will be called when a system extension has been validated and allowed by the user to run.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionsWorkspaceObserver/systemExtensionWillBecomeEnabled(_:)

func (OSSystemExtensionsWorkspaceObserverObject) SystemExtensionWillBecomeInactive

func (o OSSystemExtensionsWorkspaceObserverObject) SystemExtensionWillBecomeInactive(systemExtensionInfo IOSSystemExtensionInfo)

Discussion

This delegate method will be called when a system extension is deactivated and is about to get uninstalled. The extension may still be running until the system is rebooted.

See: https://developer.apple.com/documentation/SystemExtensions/OSSystemExtensionsWorkspaceObserver/systemExtensionWillBecomeInactive(_:)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL