[ 
https://issues.apache.org/jira/browse/CB-11582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15378660#comment-15378660
 ] 

ASF GitHub Bot commented on CB-11582:
-------------------------------------

GitHub user rs22 opened a pull request:

    https://github.com/apache/cordova-windows/pull/186

    Fix duplicate capability declarations in Win10 AppxManifest

    I have created an issue for this in Jira: 
https://issues.apache.org/jira/browse/CB-11582
    
    Let me describe the issue in more detail - I have this 
.\testplugin\plugin.xml:
    ```
    <?xml version='1.0' encoding='utf-8'?>
    <plugin id="testplugin" version="1" 
xmlns="http://apache.org/cordova/ns/plugins/1.0";>
        <name>testplugin</name>
        
        <platform name="windows">
            <config-file parent="/Package/Capabilities" 
target="package.windows10.appxmanifest">
                <Capability Name="enterpriseAuthentication" />
                <Capability Name="sharedUserCertificates" />
            </config-file>
        </platform>
    </plugin>
    ```
    
    When I run `cordova create app && pushd app && cordova plugin add 
..\testplugin && cordova platform add windows` the 
package.windows10.appxmanifest will have the capabilities set correctly. Now, 
everytime I run `cordova prepare`, this will duplicate all the uap-prefixed 
capabilities:
    
    ```
        <Capabilities>
            <Capability Name="internetClient" />
            <uap:Capability Name="enterpriseAuthentication" />
            <uap:Capability Name="sharedUserCertificates" />
            <uap:Capability Name="enterpriseAuthentication" />
            <uap:Capability Name="sharedUserCertificates" />
        </Capabilities>
    ```
    
    I had a look at how the capability declarations are handled in 
ConfigChanges.js and AppxManifest.js. The easiest fix seems to be to just check 
for duplicated capabilities when writing the AppxManifest (which is what I've 
implemented). Another way could be to inject the uap prefixes before applying 
the ConfigChanges, so that the capabilities are not being duplicated in the 
first place.
    
    Let me know what you think and I'll update the code accordingly.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rs22/cordova-windows master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-windows/pull/186.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #186
    
----
commit 1e7d3fcf6b6c85dad8b4e1ecd7b9a2739f5e0522
Author: Robert Schmid <[email protected]>
Date:   2016-07-14T21:50:56Z

    Remove duplicate capabilities when writing the AppxManifest

----


> UAP App capabilities are being duplicated when running cordova prepare
> ----------------------------------------------------------------------
>
>                 Key: CB-11582
>                 URL: https://issues.apache.org/jira/browse/CB-11582
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Windows
>    Affects Versions: 4.4.1
>            Reporter: Robert Schmid
>
> I'm using a plugin that defines App Capabilities that should be included in 
> the package.windows10.appxmanifest and need to be prefixed with 'uap:'.
> Every time I run cordova prepare, this will duplicate the Capability 
> declarations in the appxmanifest file.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to