> For the complete documentation index, see [llms.txt](https://docs.talsec.app/freerasp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talsec.app/freerasp/freemalwaredetection/blacklists.md). Agents can also search and read this documentation through its [MCP server](https://docs.talsec.app/freerasp/~gitbook/mcp).

# Blacklists

Each application, whose specification is defined in one of the blacklists and is found on the device, is returned in the scan results.&#x20;

There are three types of blacklists:

* **Package Name Based**
* **Hash Based**
* **Permission Based**

{% hint style="info" %}
You can omit a specific blacklist if you don't want to use it.
{% endhint %}

## Package Name Based Blacklist

A package name blacklist contains a **list of package names** which you consider as suspicious (or malware).&#x20;

Each application, whose package name is defined in the blacklist and is found on the device, is returned in the scan results.

If the application is flagged as suspicious, the scan result will show  `reason` value set as `blacklist`**.**

#### Setting up blacklist

{% tabs %}
{% tab title="Android" %}

<pre class="language-java"><code class="lang-java">TalsecConfig config = new TalsecConfig.Builder(context.getPackageName(), new String[] {CERTIFICATE_HASH})
<strong>        .blacklistedPackageNames(new String[]{"com.example.app"})
</strong>        .build();
</code></pre>

{% endtab %}

{% tab title="Flutter" %}

<pre class="language-dart"><code class="lang-dart">final config = TalsecConfig(
  androidConfig: AndroidConfig(
    malwareConfig: MalwareConfig(
<strong>      blacklistedPackageNames: ['com.example.app'],
</strong>    ),
    // Other config data
  ),
  // Other config data
);
</code></pre>

{% endtab %}

{% tab title="React Native" %}

<pre class="language-tsx"><code class="lang-tsx">const config = {
  androidConfig: {
    malwareConfig: {
<strong>      blacklistedPackageNames: ['com.example.app'],
</strong>    },
    // Other config data
  }
  // Other config data
}
</code></pre>

{% endtab %}

{% tab title="Cordova" %}

<pre class="language-javascript"><code class="lang-javascript">const config = {
  androidConfig: {
    malwareConfig: {
<strong>      blacklistedPackageNames: ['com.example.app'],
</strong>    },
    // Other config data
  }
  // Other config data
}
</code></pre>

{% endtab %}

{% tab title="Capacitor" %}

<pre class="language-typescript"><code class="lang-typescript">const config = {
  androidConfig: {
    malwareConfig: {
<strong>      blacklistedPackageNames: ['com.example.app'],
</strong>    },
    // Other config data
  }
  // Other config data
}
</code></pre>

{% endtab %}
{% endtabs %}

## Hash Based Blacklist

A hash-based blacklist contains a **list of SHA-256 hashes** of the application APK which you consider as suspicious (or malware).

Each application, whose APK hash is defined in the blacklist and is found on the device, is returned in the scan results.

{% hint style="warning" %}
Scanning may take longer when using a hash-based blacklist, as the APK hash must be computed for each app on the device, which can be an expensive operation.
{% endhint %}

If the application is flagged as suspicious, the scan result will show  `reason` value set as `blacklist`**.**

#### Setting up blacklist

{% tabs %}
{% tab title="Android" %}

<pre class="language-java"><code class="lang-java">TalsecConfig config = new TalsecConfig.Builder(context.getPackageName(), new String[] {CERTIFICATE_HASH})
<strong>        .blacklistedHashes(new String[]{"exampleHash"})
</strong>        .build();
</code></pre>

{% endtab %}

{% tab title="Flutter" %}

<pre class="language-dart"><code class="lang-dart">final config = TalsecConfig(
  androidConfig: AndroidConfig(
    malwareConfig: MalwareConfig(
<strong>      blacklistedHashes: ['exampleHash'],
</strong>    ),
    // Other config data
  ),
  // Other config data
);
</code></pre>

{% endtab %}

{% tab title="React Native" %}

<pre class="language-tsx"><code class="lang-tsx">const config = {
  androidConfig: {
    malwareConfig: {
<strong>      blacklistedHashes: ['exampleHash'],
</strong>    },
    // Other config data
  }
  // Other config data
}
</code></pre>

{% endtab %}

{% tab title="Cordova" %}

<pre class="language-javascript"><code class="lang-javascript">const config = {
  androidConfig: {
    malwareConfig: {
<strong>      blacklistedHashes: ['exampleHash'],
</strong>    },
    // Other config data
  }
  // Other config data
}
</code></pre>

{% endtab %}

{% tab title="Capacitor" %}

<pre class="language-typescript"><code class="lang-typescript">const config = {
  androidConfig: {
    malwareConfig: {
<strong>      blacklistedHashes: ['exampleHash'],
</strong>    },
    // Other config data
  }
  // Other config data
}
</code></pre>

{% endtab %}
{% endtabs %}

#### Calculating Hash of the APK

There are many ways how to compute the SHA-256 hash of the APK; for instance, on Unix, you can use:

```bash
shasum -a 256 yourfile.apk
```

## Suspicious Permissions list

A suspicious permissions list contains a **list of permission lists** which you consider suspicious when **granted** to an application.&#x20;

{% hint style="warning" %}
The suspicious permissions have to be <mark style="color:red;">**granted**</mark>, **not just requested** by the application, for it to be considered suspicious and returned in the scan results.
{% endhint %}

Each list contains a group of permissions. For an application to be marked as suspicious, **all permissions in given group must be granted**:

{% code overflow="wrap" %}

```
// Blacklist of permissions
[
    // List (group) of permissions
    // Application is suspicious if it has *GRANTED* all of permissions from 
    // given group
    ["android.provider.Telephony.SMS_RECEIVED", "android.permission.SEND_SMS"]
    ["android.permission.READ_CALL_LOG"]
]
```

{% endcode %}

If the application is flagged as suspicious, the scan result will show  `reason` value set as `suspiciousPermission`**.**

To reduce the amount of false positives, we also check whether the application with suspicious permissions is installed from an untrusted installation source.

{% hint style="info" %}
Untrusted installation source is a source that was not whitelisted using installation source whitelist. More about whitelists [here](https://docs.talsec.app/freerasp/freemalwaredetection/whitelists.md).
{% endhint %}

#### Setting up suspicious permissions list

{% tabs %}
{% tab title="Android" %}

<pre class="language-java"><code class="lang-java">TalsecConfig config = new TalsecConfig.Builder(context.getPackageName(), new String[][] {CERTIFICATE_HASH})
<strong>        .suspiciousPermissions(new String[][]{{"android.permission.ACCESS_COARSE_LOCATION"}})
</strong>        .build();
</code></pre>

{% endtab %}

{% tab title="Flutter" %}

<pre class="language-dart"><code class="lang-dart">final config = TalsecConfig(
  androidConfig: AndroidConfig(
    malwareConfig: MalwareConfig(
<strong>      suspiciousPermissions: [
</strong><strong>        ['android.permission.ACCESS_COARSE_LOCATION']
</strong><strong>      ],
</strong>    ),
    // Other config data
  ),
  // Other config data
);
</code></pre>

{% endtab %}

{% tab title="React Native" %}

<pre class="language-tsx"><code class="lang-tsx">const config = {
  androidConfig: {
    malwareConfig: {
<strong>      suspiciousPermissions: [
</strong>        ['android.permission.ACCESS_COARSE_LOCATION']
      ],
    },
    // Other config data
  }
  // Other config data
}
</code></pre>

{% endtab %}

{% tab title="Cordova" %}

<pre class="language-javascript"><code class="lang-javascript">const config = {
  androidConfig: {
    malwareConfig: {
<strong>      suspiciousPermissions: [
</strong>        ['android.permission.ACCESS_COARSE_LOCATION']
      ],
    },
    // Other config data
  }
  // Other config data
}
</code></pre>

{% endtab %}

{% tab title="Capacitor" %}

<pre class="language-typescript"><code class="lang-typescript">const config = {
  androidConfig: {
    malwareConfig: {
<strong>      suspiciousPermissions: [
</strong>        ['android.permission.ACCESS_COARSE_LOCATION']
      ],
    },
    // Other config data
  }
  // Other config data
}
</code></pre>

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.talsec.app/freerasp/freemalwaredetection/blacklists.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
