@hollax/cordova-android-dup-perm-remover
v1.2.0
Published
Remove duplicate permission from AndroidManifest.xml file
Downloads
6
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_prepare
hook. - Easy to install and use as a Node package.
Installation
Install the package via npm:
npm install @hollax/cordova-android-dup-perm-remover --save-dev
Usage
- Add the following definition to
config.xml
to tell Cordova to runafterPrepare.js
script before each platform build.
<hook type="after_prepare" src="scripts/afterPrepare.js" />
- Create
scripts/afterPrepare.js
file and add the following implementation
const {afterPrepareHook} = require('@hollax/cordova-android-dup-perm-remover')
module.exports = afterPrepareHook;
- Run the project
cordova run android
Exclude 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 i
Run the tests
npm test
License
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.