Removing a system extension from a correctly-signed and setup "uninstaller" app fails

Hey folks,

I have an application that ships a CoreMedia I/O system extension to create a virtual camera.

We separately ship an "uninstaller" app, which is a notarised AppKit app. This uninstaller removes the app, containers, and the system extension via the following API:

let request = OSSystemExtensionRequest.deactivationRequest(forExtensionWithIdentifier: pluginIdentifier, queue: .main)
request.delegate = self
OSSystemExtensionManager.shared.submitRequest(request)

The OSSystemExtensionRequest API does correctly deliver metadata via propertiesRequest(forExtensionWithIdentifier: …), but when we attempt to remove the extension using the above snippet, we get a failure OSSystemExtensionError.extensionNotFound.

The uninstaller app is signed with the same entitlements and certificate as the host app. It also embeds a copy of the system extension as required by the API.

I think the crux of the issue is: Should this be expected to work? We're all code-signed correctly etc, and the only difference is that the removal request is coming from an app with a different bundle identifier to the one that installed it start with.

Thanks!

Accepted Reply

Should this be expected to work?

No. There are three things in play here:

  • The container app, that is, the app in which the sysex is embedded

  • The app that activates the sysex

  • The app that deactivates the sysex

The System Extensions framework requires that all three be the same.

My advice is that you put your uninstall functionality into your main app.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • If the container app is updated, can this cause problems with uninstalling a system extension installed with a previous version of the container app?

    On occasion I've run into an incident where the current version of the container app cannot uninstall the system extension. I have not been able to pinpoint the exact conditions where this occurs.

  • Yes, I encountered the same situation, if I upgraded the container, I could not uninstall the system extension with the new container,is there a solution?

Add a Comment

Replies

Should this be expected to work?

No. There are three things in play here:

  • The container app, that is, the app in which the sysex is embedded

  • The app that activates the sysex

  • The app that deactivates the sysex

The System Extensions framework requires that all three be the same.

My advice is that you put your uninstall functionality into your main app.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • If the container app is updated, can this cause problems with uninstalling a system extension installed with a previous version of the container app?

    On occasion I've run into an incident where the current version of the container app cannot uninstall the system extension. I have not been able to pinpoint the exact conditions where this occurs.

  • Yes, I encountered the same situation, if I upgraded the container, I could not uninstall the system extension with the new container,is there a solution?

Add a Comment

Alright, thank you for the confirmation! We'll do that.