"config-file" on main activity, requires workaround

Needed to use this plugin… <plugin name="cc.fovea.cordova.openwith" version="2.0.0">
And it needs to add an <intent-filter> to the main activity in AndroidManifest.xml, which it does with this block in its plugin.xml (trimmed down a bit):

<config-file target="AndroidManifest.xml" parent="/manifest/application/activity">
		<data android:mimeType="image/*" />
		<action android:name="android.intent.action.SEND" />
		<category android:name="android.intent.category.DEFAULT" />

But this doesn’t seem to work in VoltBuilder. I can work around it by adding an identical block to my own config.xml, but replacing parent="/manifest/application/activity" with parent="/manifest/application/activity[@android:name='MainActivity']

Is there a less code-duplicatey way to accomplish this, or is there a way VoltBuilder can support the above (standard-er?:man_shrugging:) syntax?

(Misc aside: The same applies to local changes to the main activity with <edit-config>. I’m not sure why.)


This isn’t really a VoltBuilder issue - we just pass whatever you have in your config.xml to Cordova and it processes it.

I did find this in my notes - it might give you a hint as to the solution:

<plugin name="com.agorapulse.cordova.openwith" source="npm">
 <variable name="IOS_URL_SCHEME" value="cordovaopenwith" />
  <variable name="DISPLAY_NAME" value="gluconet" />
  <variable name="ANDROID_MIME_TYPE" value="*/*" />
  <variable name="ANDROID_EXTRA_ACTIONS" 
    value="<action android:name='android.intent.action.SENDTO'/><action