Blacklisting applications

Pre-requisites

You'll need to declare android permissions, for example, the suggested way of doing this is by specifying your packages

For full information see here:

https://developer.android.com/training/package-visibility/declaring

Example of allowing permission for a single app:

<queries>
    <package android:name="com.abc.def"/>
</queries>

Or allowing all applications:

<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>

The check

This check is intended to fail if the blacklisted applications are on the device - use this if there is a particular package that you know is dangerous to your application and is present on the phone - for example, some application is known to abuse features on the device to record your screen as you enter sensitive information.

safeToRun(
    { blacklistedAppCheck("com.blacklisted.package1", "com.blacklisted.package2") }
)

Last updated