Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

android:authorities="$PACKAGE_NAME.DocumentViewerPlugin.fileprovider" collides when building with other white label apps #148

Closed
jpike88 opened this issue Jan 31, 2020 · 3 comments

Comments

@jpike88
Copy link

jpike88 commented Jan 31, 2020

Is there another way around this that doesn't depend on the package name of my product?

<provider
            android:name="de.sitewaerts.cordova.documentviewer.FileProvider"
            android:authorities="com.my.whitelabel.DocumentViewerPlugin.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true" >
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/documentviewer_file_paths" />
        </provider>

This appears in my android manifest, and even when modifying my config.xml in Cordova base path and running another prepare android, it doesn't change that value.

This means there's a collision when I'm testing multiple white label version on the simulator.

Is there a way to do this where it doesn't depend on the package name?

@regnete
Copy link
Member

regnete commented Jan 31, 2020

The propertry MUST be unquie and is therefore buld with your apps id as base value.
The fact that the property is not updated when you make changes in config.xml is caused by cordova. Have you tried to remove and add the plugin. May be that helps.
AIf the issue persists, you culd try to implement a hook to your cordova application which updates the value in the android manifest everytime you excute cordova prepare.

@jpike88
Copy link
Author

jpike88 commented Jan 31, 2020

Could it be made as a hash like sha256 without disrupting things?

@jpike88
Copy link
Author

jpike88 commented Jan 31, 2020

Actually yeah a hook is best, I’ll do that. Thanks

@jpike88 jpike88 closed this as completed Jan 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants