Home > Mobile >  Limiting permissions for 3rd party software modules in Android Development
Limiting permissions for 3rd party software modules in Android Development

Time:01-03

How can we restrict permissions for 3rd party adware and other libraries?

I don't want 3rd party adware to access camera and especially database data.

Is there a possibility to completely isolate 3rd party modules (such as unity or advertisement modules) from the application we are developing?

Can we configure an activity-based or module-based permission?

CodePudding user response:

If you're including libraries in your app, there is implicit trust. They usually have access to pretty much everything your app does.

However, if you look at your merged manifest and see a library has added a permission / service / receiver etc you don't want your app to have, you can remove them very easily.

A common use case is similar to yours, some libraries may request things like microphone for functionality that you do not need that library to have.

Here is an example of how to remove a permission from a library from the manifest documentation:

<permission android:name="permissionOne"
    tools:node="remove"
    tools:selector="com.example.lib1">

If you'd like to remove the permission from your app entirely, just remove the selector:

<permission android:name="permissionOne"
    tools:node="remove">

Of course, if you're removing bits of the manifest that a library expects to have, it may stop working (although I haven't personally experienced this).

  • Related