@hollax/cordova-android-dup-perm-remover

1.2.0 • Public • Published

test

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

  1. Add the following definition to config.xml to tell Cordova to run afterPrepare.js script before each platform build.
    <hook type="after_prepare" src="scripts/afterPrepare.js" />
  1. Create scripts/afterPrepare.js file and add the following implementation
const {afterPrepareHook} = require('@hollax/cordova-android-dup-perm-remover')
module.exports = afterPrepareHook;
  1. 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


For more information, visit the GitHub repository.

Readme

Keywords

Package Sidebar

Install

npm i @hollax/cordova-android-dup-perm-remover

Weekly Downloads

7

Version

1.2.0

License

MIT

Unpacked Size

15.1 kB

Total Files

13

Last publish

Collaborators

  • hollax