-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(windows): capabilities #9437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mmaietta
merged 29 commits into
electron-userland:master
from
sitewaerts:feat/windows-capabilities
Jan 31, 2026
Merged
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
c616694
feat(windows): add support for windows uwp/appx capabilities
regnete 34a5131
Merge remote-tracking branch 'electron-userland/master' into feat/win…
regnete 53e4933
Merge branch 'electron-userland:master' into feat/windows-capabilities
regnete e0b77de
Merge branch 'master' into feat/windows-capabilities
regnete 61dde96
Merge branch 'master' into feat/windows-capabilities
regnete e47eae4
Merge branch 'feat/windows-capabilities' of https://github.com/sitewa…
regnete bb7762e
optimization suggested by mmaietta
regnete b6aaaec
optimization suggested by mmaietta
regnete a44f0ca
removed unused namespaces
regnete 377689c
updated
regnete 6e8f22b
Create serious-doors-retire.md
regnete 13caa27
code layout
regnete 2ec9711
avoid double space in generated xml fragment
regnete 8c1fa66
Merge branch 'electron-userland:master' into feat/windows-capabilities
regnete 3fbebf3
validate capability names (https://github.com/electron-userland/elect…
regnete 372e00b
tests for capability feature (https://github.com/electron-userland/el…
regnete 83c0a75
fixed typo
regnete 0ed5d58
fixed order of capabilities
regnete 84d9613
fixed capability related test
regnete f65eb81
fixed compile errors
regnete f0c27b1
Merge branch 'electron-userland:master' into feat/windows-capabilities
regnete 653db19
prettier
regnete 7a8217d
Merge remote-tracking branch 'origin/feat/windows-capabilities' into …
regnete 4849551
fixed appx capabilities order, removed uap11 namespace as not support…
regnete dca9e38
removed uap11 namespace as not supported by MakeAppx.exe
regnete 5654d24
removed uap11 namespace as not supported by MakeAppx.exe
regnete 2f9a5fb
fixed code style
regnete 92b748c
Merge branch 'master' into feat/windows-capabilities
regnete 2ca7e45
Merge branch 'master' into feat/windows-capabilities
regnete File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
286 changes: 286 additions & 0 deletions
286
packages/app-builder-lib/src/targets/AppxCapabilities.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,286 @@ | ||
| export interface Capability { | ||
|
|
||
| readonly nsAlias:string|null | ||
|
|
||
| /** | ||
| * see https://learn.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-capabilities | ||
| */ | ||
| readonly nsURI:string|null | ||
|
|
||
| readonly name:string | ||
|
|
||
| toXMLString():string | ||
| } | ||
|
|
||
| abstract class BaseCapability implements Capability{ | ||
|
|
||
|
Check warning on line 16 in packages/app-builder-lib/src/targets/AppxCapabilities.ts
|
||
| protected constructor(public readonly nsAlias:string | null, | ||
| public readonly nsURI:string | null, | ||
| protected readonly elementName:string, | ||
| public readonly name:string) { | ||
|
Check warning on line 20 in packages/app-builder-lib/src/targets/AppxCapabilities.ts
|
||
| } | ||
|
|
||
| toXMLString(){ | ||
| if(this.nsAlias) | ||
| return `<${this.nsAlias}:${this.elementName} Name="${this.name}"/>`; | ||
| return `<${this.elementName} Name="${this.name}"/>`; | ||
| } | ||
| } | ||
|
|
||
| abstract class NSBaseCapability extends BaseCapability{ | ||
|
|
||
| protected constructor(nsAlias:string|null, nsURI:string, elementName:string, name:string) { | ||
| super(nsAlias, nsURI, elementName, name); | ||
| } | ||
|
|
||
| } | ||
|
|
||
| abstract class FoundationCapability extends NSBaseCapability{ | ||
|
|
||
| protected constructor(elementName:string, name:string) { | ||
| // http://schemas.microsoft.com/appx/manifest/foundation/windows10 | ||
| super(null, "http://schemas.microsoft.com/appx/manifest/foundation/windows10", elementName, name); | ||
| } | ||
| } | ||
|
|
||
| class CommonCapability extends FoundationCapability{ | ||
|
|
||
| constructor(name:string) { | ||
| super("Capability", name); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * https://learn.microsoft.com/de-de/uwp/schemas/appxpackage/how-to-specify-device-capabilities-in-a-package-manifest | ||
| */ | ||
| class DeviceCapability extends FoundationCapability{ | ||
|
|
||
| constructor(name:string) { | ||
| super("DeviceCapability", name); | ||
| } | ||
| } | ||
|
|
||
|
|
||
|
|
||
| class UAPCapability extends NSBaseCapability{ | ||
|
|
||
| constructor(name:string) { | ||
| super("uap", "http://schemas.microsoft.com/appx/manifest/uap/windows10", "Capability", name); | ||
| } | ||
| } | ||
|
|
||
| class UAP6Capability extends NSBaseCapability{ | ||
|
|
||
| constructor(name:string) { | ||
| super("uap6", "http://schemas.microsoft.com/appx/manifest/uap/windows10/6", "Capability", name); | ||
| } | ||
| } | ||
|
|
||
| class UAP7Capability extends NSBaseCapability{ | ||
|
|
||
| constructor(name:string) { | ||
| super("uap7", "http://schemas.microsoft.com/appx/manifest/uap/windows10/7", "Capability", name); | ||
| } | ||
| } | ||
|
|
||
| class UAP11Capability extends NSBaseCapability{ | ||
|
|
||
| constructor(name:string) { | ||
| super("uap11", "http://schemas.microsoft.com/appx/manifest/uap/windows10/11", "Capability", name); | ||
| } | ||
| } | ||
|
|
||
| class MobileCapability extends NSBaseCapability{ | ||
|
|
||
| constructor(name:string) { | ||
| super("mobile", "http://schemas.microsoft.com/appx/manifest/mobile/windows10", "Capability", name); | ||
| } | ||
| } | ||
|
|
||
| // class IOTCapability extends NSBaseCapability{ | ||
| // | ||
| // constructor(name:string) { | ||
| // super('iot', '?????', 'Capability', name); | ||
| // } | ||
| // } | ||
|
|
||
| class ResCapCapability extends NSBaseCapability{ | ||
|
|
||
| constructor(name:string) { | ||
| super("rescap", "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities", "Capability", name); | ||
| } | ||
| } | ||
|
|
||
| // order matters | ||
| // see https://learn.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-capabilities | ||
|
|
||
| export const CAPABILITIES = [ | ||
mmaietta marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| new CommonCapability("internetClient"), | ||
| new CommonCapability("internetClientServer"), | ||
| new CommonCapability("privateNetworkClientServer"), | ||
| new CommonCapability("codeGeneration"), // ??? | ||
| new CommonCapability("allJoyn"), // ??? | ||
| new CommonCapability("backgroundMediaPlayback"), | ||
| new CommonCapability("remoteSystem"), | ||
| new CommonCapability("spatialPerception"), | ||
| new CommonCapability("userDataTasks"), | ||
| new CommonCapability("userNotificationListener"), | ||
|
|
||
|
|
||
| new UAPCapability("musicLibrary"), | ||
| new UAPCapability("picturesLibrary"), | ||
| new UAPCapability("videosLibrary"), | ||
| new UAPCapability("removableStorage"), | ||
| new UAPCapability("appointments"), | ||
| new UAPCapability("contacts"), | ||
| new UAPCapability("phoneCall"), | ||
| new UAPCapability("phoneCallHistoryPublic"), | ||
| new UAPCapability("userAccountInformation"), | ||
| new UAPCapability("voipCall"), | ||
| new UAPCapability("objects3D"), | ||
| new UAPCapability("chat"), | ||
| new UAPCapability("blockedChatMessages"), | ||
|
|
||
| new UAPCapability("enterpriseAuthentication"), | ||
| new UAPCapability("sharedUserCertificates"), | ||
|
|
||
| new UAPCapability("documentsLibrary"), | ||
|
|
||
|
|
||
|
|
||
| new DeviceCapability("location"), | ||
| new DeviceCapability("microphone"), | ||
| new DeviceCapability("webcam"), | ||
|
|
||
| new DeviceCapability("proximity"), | ||
|
|
||
| // new DeviceCapability("usb"), // not supported, needs nested elements | ||
| // new DeviceCapability("humaninterfacedevice"), // not supported, needs nested elements | ||
| new DeviceCapability("pointOfService"), | ||
| // new DeviceCapability("bluetooth"), // not supported, needs nested elements | ||
| new DeviceCapability("wiFiControl"), | ||
| new DeviceCapability("radios"), | ||
| new DeviceCapability("optical"), | ||
| new DeviceCapability("activity"), | ||
| new DeviceCapability("humanPresence"), | ||
| new DeviceCapability("serialcommunication"), | ||
| new DeviceCapability("gazeInput"), | ||
| new DeviceCapability("lowLevel"), | ||
|
|
||
| new DeviceCapability("packageQuery"), // correct namespace?? | ||
|
|
||
|
|
||
| new MobileCapability("recordedCallsFolder"), | ||
|
|
||
| new ResCapCapability("enterpriseDataPolicy"), | ||
| new ResCapCapability("appCaptureSettings"), | ||
| new ResCapCapability("cellularDeviceControl"), | ||
| new ResCapCapability("cellularDeviceIdentity"), | ||
| new ResCapCapability("cellularMessaging"), | ||
| new ResCapCapability("deviceUnlock"), | ||
| new ResCapCapability("dualSimTiles"), | ||
| new ResCapCapability("enterpriseDeviceLockdown"), | ||
| new ResCapCapability("inputInjectionBrokered"), | ||
| new ResCapCapability("inputObservation"), | ||
| new ResCapCapability("inputSuppression"), | ||
| new ResCapCapability("networkingVpnProvider"), | ||
| new ResCapCapability("packageManagement"), | ||
| new ResCapCapability("screenDuplication"), | ||
| new ResCapCapability("userPrincipalName"), | ||
| new ResCapCapability("walletSystem"), | ||
| new ResCapCapability("locationHistory"), | ||
| new ResCapCapability("confirmAppClose"), | ||
| new ResCapCapability("phoneCallHistory"), | ||
| new ResCapCapability("appointmentsSystem"), | ||
| new ResCapCapability("chatSystem"), | ||
| new ResCapCapability("contactsSystem"), | ||
| new ResCapCapability("email"), | ||
| new ResCapCapability("emailSystem"), | ||
| new ResCapCapability("phoneCallHistorySystem"), | ||
| new ResCapCapability("smsSend"), | ||
| new ResCapCapability("userDataSystem"), | ||
| new ResCapCapability("previewStore"), | ||
| new ResCapCapability("firstSignInSettings"), | ||
| new ResCapCapability("teamEditionExperience"), | ||
| new ResCapCapability("remotePassportAuthentication"), | ||
| new ResCapCapability("previewUiComposition"), | ||
| new ResCapCapability("secureAssessment"), | ||
| new ResCapCapability("networkConnectionManagerProvisioning"), | ||
| new ResCapCapability("networkDataPlanProvisioning"), | ||
| new ResCapCapability("slapiQueryLicenseValue"), | ||
| new ResCapCapability("extendedBackgroundTaskTime"), | ||
| new ResCapCapability("extendedExecutionBackgroundAudio"), | ||
| new ResCapCapability("extendedExecutionCritical"), | ||
| new ResCapCapability("extendedExecutionUnconstrained"), | ||
| new ResCapCapability("deviceManagementDmAccount"), | ||
| new ResCapCapability("deviceManagementFoundation"), | ||
| new ResCapCapability("deviceManagementWapSecurityPolicies"), | ||
| new ResCapCapability("deviceManagementEmailAccount"), | ||
| new ResCapCapability("packagePolicySystem"), | ||
| new ResCapCapability("gameList"), | ||
| new ResCapCapability("xboxAccessoryManagement"), | ||
| new ResCapCapability("cortanaSpeechAccessory"), | ||
| new ResCapCapability("accessoryManager"), | ||
| new ResCapCapability("interopServices"), | ||
| new ResCapCapability("inputForegroundObservation"), | ||
| new ResCapCapability("oemDeployment"), | ||
| new ResCapCapability("oemPublicDirectory"), | ||
| new ResCapCapability("appLicensing"), | ||
| new ResCapCapability("locationSystem"), | ||
| new ResCapCapability("userDataAccountsProvider"), | ||
| new ResCapCapability("previewPenWorkspace"), // correct namespace?? | ||
| new ResCapCapability("secondaryAuthenticationFactor"), // correct namespace?? | ||
| new ResCapCapability("storeLicenseManagement"), // correct namespace?? | ||
| new ResCapCapability("userSystemId"), // correct namespace?? | ||
| new ResCapCapability("targetedContent"), // correct namespace?? | ||
| new ResCapCapability("targetedContent"), // correct namespace?? | ||
| new ResCapCapability("uiAutomation"), // correct namespace?? | ||
| new ResCapCapability("gameBarServices"), // correct namespace?? | ||
| new ResCapCapability("appCaptureServices"), // correct namespace?? | ||
| new ResCapCapability("appBroadcastServices"), // correct namespace?? | ||
| new ResCapCapability("audioDeviceConfiguration"), // correct namespace?? | ||
| new ResCapCapability("backgroundMediaRecording"), // correct namespace?? | ||
| new ResCapCapability("previewInkWorkspace"), // correct namespace?? | ||
| new ResCapCapability("startScreenManagement"), // correct namespace?? | ||
| new ResCapCapability("cortanaPermissions"), // correct namespace?? | ||
| new ResCapCapability("allAppMods"), // correct namespace?? | ||
| new ResCapCapability("expandedResources"), // correct namespace?? | ||
| new ResCapCapability("protectedApp"), // correct namespace?? | ||
| new ResCapCapability("gameMonitor"), // correct namespace?? | ||
| new ResCapCapability("appDiagnostics"), // correct namespace?? | ||
| new ResCapCapability("devicePortalProvider"), // correct namespace?? | ||
| new ResCapCapability("enterpriseCloudSSO"), // correct namespace?? | ||
| new ResCapCapability("backgroundVoIP"), // correct namespace?? | ||
| new ResCapCapability("oneProcessVoIP"), // correct namespace?? | ||
| new ResCapCapability("developmentModeNetwork"), // correct namespace?? | ||
| new ResCapCapability("broadFileSystemAccess"), // correct namespace?? | ||
| new ResCapCapability("smbios"), // correct namespace?? | ||
| new ResCapCapability("runFullTrust"), | ||
| new ResCapCapability("allowElevation"), | ||
| new ResCapCapability("teamEditionDeviceCredential"), | ||
| new ResCapCapability("teamEditionView"), | ||
| new ResCapCapability("cameraProcessingExtension"), | ||
| new ResCapCapability("networkDataUsageManagement"), | ||
| new ResCapCapability("phoneLineTransportManagement"), | ||
| new ResCapCapability("unvirtualizedResources"), | ||
| new ResCapCapability("modifiableApp"), | ||
| new ResCapCapability("packageWriteRedirectionCompatibilityShim"), | ||
| new ResCapCapability("customInstallActions"), | ||
| new ResCapCapability("packagedServices"), | ||
| new ResCapCapability("localSystemServices"), | ||
| new ResCapCapability("backgroundSpatialPerception"), | ||
| new ResCapCapability("uiAccess"), | ||
|
|
||
| new UAP6Capability("graphicsCapture"), | ||
|
|
||
| new UAP7Capability("globalMediaControl"), | ||
|
|
||
| new UAP11Capability("graphicsCaptureWithoutBorder"), | ||
| new UAP11Capability("graphicsCaptureProgrammatic"), | ||
|
|
||
| ]; | ||
|
|
||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.