[
https://issues.apache.org/jira/browse/CB-11066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15248967#comment-15248967
]
ASF GitHub Bot commented on CB-11066:
-------------------------------------
Github user rakatyal commented on a diff in the pull request:
https://github.com/apache/cordova-windows/pull/168#discussion_r60332098
--- Diff: template/cordova/lib/ConfigChanges.js ---
@@ -0,0 +1,85 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+var util = require('util');
+var CommonMunger = require('cordova-common').ConfigChanges.PlatformMunger;
+
+function PlatformMunger(platform, project_dir, platformJson,
pluginInfoProvider) {
+ CommonMunger.apply(this, arguments);
+}
+
+util.inherits(PlatformMunger, CommonMunger);
+
+/**
+ * This is an override of apply_file_munge method from cordova-common's
PlatformMunger class.
+ * In addition to parent's method logic also removes capabilities with
'uap:' prefix that were
+ * added by AppxManifest class
+ *
+ * @param {String} file A file name to apply munge to
+ * @param {Object} munge Serialized changes that need to be applied to
the file
+ * @param {Boolean} [remove=false] Flag that specifies whether the changes
+ * 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') {
--- End diff --
Couldn't we have added this condition to the existing apply_file_munge
instead of writing an override?
> uap-prefixed capabilities are not being removed from
> package.windows10.appxmanifest on plugin rm
> ------------------------------------------------------------------------------------------------
>
> Key: CB-11066
> URL: https://issues.apache.org/jira/browse/CB-11066
> Project: Apache Cordova
> Issue Type: Bug
> Components: Windows
> Reporter: Sergey Shakhnazarov
> Assignee: Vladimir Kotikov
> Labels: triaged
>
> 1. Some cordova-plugin-capabities {{plugin.xml}} includes:
> {noformat}
> <config-file target="package.appxmanifest" parent="/Package/Capabilities"
> device-target="windows">
> <Capability Name="enterpriseAuthentication" />
> <Capability Name="privateNetworkClientServer" />
> <Capability Name="sharedUserCertificates" />
> </config-file>
> {noformat}
> 2. cordova plugin add ..\cordova-plugin-capabities
> 3. package.windows10.appxmanifest now includes:
> {noformat}
> <Capabilities>
> <Capability Name="internetClient" />
> <uap:Capability Name="enterpriseAuthentication" />
> <Capability Name="privateNetworkClientServer" />
> <uap:Capability Name="sharedUserCertificates" />
> </Capabilities>
> {noformat}
> 4. cordova plugin rm cordova-plugin-capabities
> 5. package.windows10.appxmanifest now actually includes:
> {noformat}
> <Capabilities>
> <Capability Name="internetClient" />
> <uap:Capability Name="enterpriseAuthentication" />
> <uap:Capability Name="sharedUserCertificates" />
> </Capabilities>
> {noformat}
> *Expected*:
> {noformat}
> <Capabilities>
> <Capability Name="internetClient" />
> </Capabilities>
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]