You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Wojciech Trocki (JIRA)" <ji...@apache.org> on 2018/05/24 19:49:00 UTC

[jira] [Comment Edited] (CB-14108) in config.xml increases config_munge count in ios.json and android.json.

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

Wojciech Trocki edited comment on CB-14108 at 5/24/18 7:48 PM:
---------------------------------------------------------------

Issue happening in: https://github.com/apache/cordova-lib/blob/d19951b3e37239f699c4f304c0fee8407d89d9c2/src/cordova/prepare.js#L130

Function that is returning no conflicts when '*' is used:
https://github.com/apache/cordova-common/blob/acf133346579a96217d280a8c3186e07d7fc3ef7/src/ConfigChanges/ConfigChanges.js#L330




was (Author: wtrocki):
Issue happening in: https://github.com/apache/cordova-lib/blob/d19951b3e37239f699c4f304c0fee8407d89d9c2/src/cordova/prepare.js#L130

Function that is returning no conflicts when '*' is used:
https://github.com/apache/cordova-common/blob/acf133346579a96217d280a8c3186e07d7fc3ef7/src/ConfigChanges/ConfigChanges.js#L330

Issue happening because 

> <config-file> in config.xml increases config_munge count in ios.json and android.json.
> --------------------------------------------------------------------------------------
>
>                 Key: CB-14108
>                 URL: https://issues.apache.org/jira/browse/CB-14108
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-common, cordova-lib
>    Affects Versions: 8.0.0
>            Reporter: Ken Naito
>            Priority: Major
>             Fix For: Master
>
>
> On both iOS and Android platforms, using <config-file> causes duplication in the `ios.json` and `android.json` files, which could lead to extremely large file sizes (and possibly unexpected behaviour?).
> For a Cordova 7.1/8.0 application, add the following to config.xml:
>  
> {code:java}
>    <platform name="ios">
>         <allow-intent href="itms:*" />
>         <allow-intent href="itms-apps:*" />
>         <config-file parent="NSCameraUsageDescription" target="*-Info.plist">
>             <string>Please permit Camera!</string>
>         </config-file>
>     </platform>
> {code}
> Now run `cordova prepare`. The file `platforms/ios/ios.json` now contains the below. Note the count is 1.
>  
> {code:java}
>  "config_munge": {
>     "files": {
>       "*-Info.plist": {
>         "parents": {
>           "NSCameraUsageDescription": [
>             {
>               "xml": "<string>Please permit Camera!</string>",
>               "count": 1
>             }
>           ]
>         }
>       }
>     }
>   },
> {code}
> Run `cordova prepare` again. The platforms/ios/ios.json changes, increasing the count to 2.
>   
> {code:java}
> "config_munge": {
>     "files": {
>       "*-Info.plist": {
>         "parents": {
>           "NSCameraUsageDescription": [
>             {
>               "xml": "<string>Please permit Camera!</string>",
>               "count": 2
>             }
>           ]
>         }
>       }
>     }
>   },
> {code}
> Furthermore, if we change the text inside the `<string>` in the `config.xml`:
> {code:java}
>     <platform name="ios">
>         <allow-intent href="itms:*" />
>         <allow-intent href="itms-apps:*" />
>         <config-file parent="NSCameraUsageDescription" target="*-Info.plist">
>             <string>This app uses Camera!</string>
>         </config-file>
>     </platform>
> {code}
> Then after running `cordova prepare`, there is now a second entry in `platforms/ios/ios.json`, rather than replacing the existing entry.
>  
> {code:java}
>  "config_munge": {
>     "files": {
>       "*-Info.plist": {
>         "parents": {
>           "NSCameraUsageDescription": [
>             {
>               "xml": "<string>Please permit Camera!</string>",
>               "count": 2
>             },
>             {
>               "xml": "<string>This app uses Camera!</string>",
>               "count": 1
>             }
>           ]
>         }
>       }
>     }
>   },
> {code}
> This behaviour is the same for Android, and can be reproduced in the same way, by adding something like the below to `config.xml`:
> {code:java}
>     <platform name="android">
>         <allow-intent href="market:*" />
>         <config-file parent="/manifest" target="AndroidManifest.xml">
>             <uses-permission android:name="android.permission.VIBRATE" />
>         </config-file>
>     </platform>
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org