You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Andrew Grieve (JIRA)" <ji...@apache.org> on 2014/04/17 15:31:16 UTC

[jira] [Resolved] (CB-6414) Cordova plugman will ignore config_munge features for config.xml if two are listed in plugin.xml

     [ https://issues.apache.org/jira/browse/CB-6414?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Grieve resolved CB-6414.
-------------------------------

    Resolution: Fixed

> Cordova plugman will ignore config_munge features for config.xml if two are listed in plugin.xml
> ------------------------------------------------------------------------------------------------
>
>                 Key: CB-6414
>                 URL: https://issues.apache.org/jira/browse/CB-6414
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugman
>    Affects Versions: 3.4.0
>         Environment: Android
>            Reporter: Josh Bavari
>            Assignee: Josh Bavari
>            Priority: Minor
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> When using a phonegap plugin like the Facebook Connect plugin, there are two series of listed config transforms, as such:
> The <config-file> element,
>   <config-file target="config.xml" parent="/*">
> 	    <access origin="https://m.facebook.com" />
> 	    <access origin="https://graph.facebook.com" />
> 	    <access origin="https://api.facebook.com" />
> 	    <access origin="https://*.fbcdn.net" />
> 	    <access origin="https://*.akamaihd.net" />
>     </config-file>
> As well as the transform for Android:
>  <config-file target="config.xml" parent="/*">
>             <feature name="FacebookConnectPlugin">
>                 <param name="android-package" value="org.apache.cordova.facebook.ConnectPlugin" />
>             </feature>
>         </config-file>
> Which after running 'cordova prepare android':
> "config_munge": {
>         "res/xml/config.xml": {
>             "/*": {
>                 "<feature name=\"Camera\"><param name=\"android-package\" value=\"org.apache.cordova.camera.CameraLauncher\" /></feature>": 1,
>                 "<feature name=\"Contacts\"><param name=\"android-package\" value=\"org.apache.cordova.contacts.ContactManager\" /></feature>": 1,
>                 "<feature name=\"Device\"><param name=\"android-package\" value=\"org.apache.cordova.device.Device\" /></feature>": 1,
>                 "<feature name=\"Notification\"><param name=\"android-package\" value=\"org.apache.cordova.dialogs.Notification\" /></feature>": 1,
>                 "<feature name=\"File\"><param name=\"android-package\" value=\"org.apache.cordova.file.FileUtils\" /><param name=\"onload\" value=\"true\" /></feature>": 1,
>                 "<feature name=\"FileTransfer\"><param name=\"android-package\" value=\"org.apache.cordova.filetransfer.FileTransfer\" /></feature>": 1,
>                 "<feature name=\"Geolocation\"><param name=\"android-package\" value=\"org.apache.cordova.geolocation.GeoBroker\" /></feature>": 1,
>                 "<feature name=\"InAppBrowser\"><param name=\"android-package\" value=\"org.apache.cordova.inappbrowser.InAppBrowser\" /></feature>": 1,
>                 "<feature name=\"Media\"><param name=\"android-package\" value=\"org.apache.cordova.media.AudioHandler\" /></feature>": 1,
>                 "<feature name=\"Capture\"><param name=\"android-package\" value=\"org.apache.cordova.mediacapture.Capture\" /></feature>": 1,
>                 "<feature name=\"NetworkStatus\"><param name=\"android-package\" value=\"org.apache.cordova.networkinformation.NetworkManager\" /></feature>": 1,
>                 "<feature name=\"SplashScreen\"><param name=\"android-package\" value=\"org.apache.cordova.splashscreen.SplashScreen\" /></feature>": 1
>             }
>         },
>         "AndroidManifest.xml": {
>             "/*": {
>                 "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />": 5,
>                 "<uses-permission android:name=\"android.permission.READ_CONTACTS\" />": 1,
>                 "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\" />": 1,
>                 "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\" />": 1,
>                 "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />": 1,
>                 "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />": 1,
>                 "<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />": 2,
>                 "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\" />": 1,
>                 "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />": 1,
>                 "<uses-permission android:name=\"android.permission.RECORD_VIDEO\" />": 1,
>                 "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />": 1
>             },
>             "application": {
>                 "<meta-data android:name=\"com.facebook.sdk.ApplicationId\" android:value=\"@string/fb_app_id\" />": 1,
>                 "<activity android:label=\"@string/fb_app_name\" android:name=\"com.facebook.LoginActivity\" />": 1
>             }
>         },
>         "res/values/facebookconnect.xml": {
>             "/*": {
>                 "<string name=\"fb_app_id\">448</string>": 1,
>                 "<string name=\"fb_app_name\">RaiseMore</string>": 1
>             }
>         },
>         "config.xml": {
>             "/*": {
>                 "<access origin=\"https://m.facebook.com\" />": 1,
>                 "<access origin=\"https://graph.facebook.com\" />": 1,
>                 "<access origin=\"https://api.facebook.com\" />": 1,
>                 "<access origin=\"https://*.fbcdn.net\" />": 1,
>                 "<access origin=\"https://*.akamaihd.net\" />": 1,
>                 "<feature name=\"FacebookConnectPlugin\"><param name=\"android-package\" value=\"org.apache.cordova.facebook.ConnectPlugin\" /></feature>": 1
>             }
>         }
>     },
> Which then leads to the final config.xml that only has the config munge from the facebook plugin:
> <?xml version='1.0' encoding='utf-8'?>
> <widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
>     <preference name="loglevel" value="DEBUG" />
>     <feature name="App">
>         <param name="android-package" value="org.apache.cordova.App" />
>     </feature>
>     <access origin="https://m.facebook.com" />
>     <access origin="https://graph.facebook.com" />
>     <access origin="https://api.facebook.com" />
>     <access origin="https://*.fbcdn.net" />
>     <access origin="https://*.akamaihd.net" />
>     <feature name="FacebookConnectPlugin">
>         <param name="android-package" value="org.apache.cordova.facebook.ConnectPlugin" />
>     </feature>
>     <name>HelloCordova</name>
>     <description>
>         A sample Apache Cordova application that responds to the deviceready event.
>     </description>
>     <author email="dev@cordova.apache.org" href="http://cordova.io">
>         Apache Cordova Team
>     </author>
>     <content src="index.html" />
>     <access origin="*" />
>     <preference name="Orientation" value="landscape" />
> </widget>



--
This message was sent by Atlassian JIRA
(v6.2#6252)