[ https://issues.apache.org/jira/browse/CB-11933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15588858#comment-15588858 ]
ASF GitHub Bot commented on CB-11933: ------------------------------------- Github user daserge commented on a diff in the pull request: https://github.com/apache/cordova-windows/pull/203#discussion_r84070095 --- Diff: template/cordova/lib/ConfigChanges.js --- @@ -34,54 +39,121 @@ util.inherits(PlatformMunger, CommonMunger); * need to be removed or added to the file */ PlatformMunger.prototype.apply_file_munge = function (file, munge, remove) { - // Call parent class' method - PlatformMunger.super_.prototype.apply_file_munge.call(this, file, munge, remove); - - // CB-11066 If this is a windows10 manifest and we're removing the changes - // then we also need to check if there are <Capability> elements were previously - // added and schedule removal of corresponding <uap:Capability> elements - if (remove && file === 'package.windows10.appxmanifest') { - var uapCapabilitiesMunge = generateUapCapabilities(munge); - // We do not check whether generated munge is empty or not before calling - // 'apply_file_munge' since applying empty one is just a no-op - PlatformMunger.super_.prototype.apply_file_munge.call(this, file, uapCapabilitiesMunge, remove); - } + + // Create a copy to avoid modification of original munge + var mungeCopy = cloneObject(munge); + var capabilities = mungeCopy.parents[CAPS_SELECTOR]; + + // Add 'uap' prefixes for windows 10 manifest + if (file === WINDOWS10_MANIFEST) --- End diff -- Please add `{}` here. > [windows] uap: not added on plugin add > -------------------------------------- > > Key: CB-11933 > URL: https://issues.apache.org/jira/browse/CB-11933 > Project: Apache Cordova > Issue Type: Bug > Components: Windows > Reporter: Sergey Shakhnazarov > Assignee: Nikita Matrosov > > {noformat} > cordova create test > cd test > cordova platform add https://github.com/apache/cordova-windows > cordova plugin add > https://github.com/AzureAD/azure-activedirectory-library-for-cordova > cordova plugin add plugins\cordova-plugin-ms-adal\src\windows\sso\ > type platforms\windows\package.windows10.appxmanifest > {noformat} > -> > {noformat} > <Capabilities> > <Capability Name="internetClient" /> > <Capability Name="enterpriseAuthentication" /> > <Capability Name="privateNetworkClientServer" /> > <Capability Name="sharedUserCertificates" /> > </Capabilities> > {noformat} > {{cordova prepare}} > {noformat} > type platforms\windows\package.windows10.appxmanifest > {noformat} > {noformat} > <Capabilities> > <Capability Name="internetClient" /> > <uap:Capability Name="enterpriseAuthentication" /> > <Capability Name="privateNetworkClientServer" /> > <uap:Capability Name="sharedUserCertificates" /> > </Capabilities> > {noformat} > {{cordova plugin rm cordova-plugin-ms-adal-sso}} > {noformat} > type platforms\windows\package.windows10.appxmanifest > {noformat} > {noformat} > <Capabilities> > <Capability Name="internetClient" /> > <uap:Capability Name="enterpriseAuthentication" /> > <uap:Capability Name="sharedUserCertificates" /> > </Capabilities> > {noformat} > 1. uap: prefixes not being added on plugin add > 2. cordova prepare fixes this > 3. plugin rm does not remove added capabilities as they have been changed > cordova-plugin-ms-adal-sso plugin.xml: > {noformat} > <platform name="windows"> > <js-module name="overrides" src="www/overrides.js"> > <runs /> > </js-module> > <config-file target="package.appxmanifest" > parent="/Package/Capabilities" device-target="windows"> > <Capability Name="enterpriseAuthentication" /> > <Capability Name="privateNetworkClientServer" /> > <Capability Name="sharedUserCertificates" /> > </config-file> > </platform> > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org