@hollax/cordova-android-dup-perm-remover
v1.2.0
Published
Remove duplicate permission from AndroidManifest.xml file
Readme
Cordova Android Duplicate Permissions Remover
This is a Node.js tool specifically designed for Cordova projects to prevent build failures caused by duplicate permissions in the generated AndroidManifest.xml file. This tool automatically removes duplicate permissions during the build process, ensuring a smooth and error-free build.
Features
- Automatically removes duplicate permissions from
AndroidManifest.xml. - Integrates seamlessly with the Cordova build process using the
after_preparehook. - Easy to install and use as a Node package.
Installation
Install the package via npm:
npm install @hollax/cordova-android-dup-perm-remover --save-devUsage
- Add the following definition to
config.xmlto tell Cordova to runafterPrepare.jsscript before each platform build.
<hook type="after_prepare" src="scripts/afterPrepare.js" />- Create
scripts/afterPrepare.jsfile and add the following implementation
const {afterPrepareHook} = require('@hollax/cordova-android-dup-perm-remover')
module.exports = afterPrepareHook;- Run the project
cordova run androidExclude Permission
Since v1.2, you can specify permissions to be ecluded from the generated AndroidManifest.xml
Edit scripts/afterPrepare.js
const {createAfterPrepareHook} = require('@hollax/cordova-android-dup-perm-remover')
module.exports = createAfterPrepareHook({
exclude:['android.permission.BLUETOOTH']
});Testing
Test uses chai and mocha.
Install the dependencies
npm iRun the tests
npm testLicense
This project is licensed under the MIT License (2024).
Author
Wakeel Ogunsanya
- Email: [email protected]
- LinkedIn: Wakeel Ogunsanya
For more information, visit the GitHub repository.
