feat(packaging): embed & sign macOS app extensions (.appex) - #396
Draft
kdroidFilter wants to merge 1 commit into
Draft
feat(packaging): embed & sign macOS app extensions (.appex)#396kdroidFilter wants to merge 1 commit into
kdroidFilter wants to merge 1 commit into
Conversation
…tensions DSL
Add a macOS { appExtensions { } } DSL to embed prebuilt .appex bundles into
Contents/PlugIns, each signed with its own entitlements and (optional) provisioning
profile, then seal the outer app without --deep so the extension keeps its distinct
signature. Covers the JVM/jpackage path, the DMG/PKG re-seal (electron-builder), and
GraalVM native images. Adds the macos-appex-demo example.
No behavior change when appExtensions is unused (all new paths are guarded).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds first-class support for embedding & signing macOS app extensions (
.appex) — e.g. a Network Extension — inside a packaged app, addressing #394.New DSL:
macOS { entitlementsFile.set(file("packaging/app.entitlements")) // host-app entitlements appExtensions { extension("NetworkFilter") { appex(file("build/appex/NetworkFilter.appex")) // prebuilt .appex entitlements(file("packaging/extension/NetworkExtension.entitlements")) // its OWN // provisioningProfile(file("packaging/NetworkFilter.provisionprofile")) } } }The plugin copies each
.appexintoContents/PlugIns/, embeds its ownembedded.provisionprofile, signs it inside-out with its own entitlements, then seals the outer app without--deepso the nested signature is preserved.What changed
MacAppExtensionSettings/MacAppExtension+macOS { appExtensions { } }.AbstractJPackageTask): embed + sign extensions before the final seal.AbstractElectronBuilderPackageTask): re-sign extensions inresignAppand in the ad-hoc--deepfallback (arm64) so installers preserve their entitlements.configureGraalvmApplication): embed + ad-hoc sign extensions into the native.app, plus wire them into the GraalVM electron-builder task.examples/macos-appex-demo(minimalNEFilterDataProvidercompiled to a universal.appex, Compose UI that inspects its ownContents/PlugIns).Nucleus does not build the
.appex(that stays Xcode / Kotlin/Native); it copies + signs + seals a prebuilt one.No regressions by design
All new paths are guarded by
isEmpty()/isNotEmpty()— behavior is byte-identical whenappExtensionsis unused.Test plan
detekt+ktlintpasscreateDistributable→.appexinContents/PlugIns,codesign --verify --deep --strictOK, distinct entitlements (appallow-jit=1 / appexallow-jit=0, appexnetworkextension=1)Authority(not adhoc)packageGraalvmNative(real native arm64 binary) →.appexembedded,--deep --strictOKextra-launcher-demo) still packages, noPlugIns, codesign OKpublishDevToMavenLocalLimitations
signing {}for a notarized GraalVM DMG.NEFilterManager/NETunnelProviderManager) via a native bridge — out of scope here; this is about signing/bundling/shipping the.appex.