For the complete documentation index, see llms.txt. This page is also available as Markdown.

Configuration

The freeMalware Detection module is configured directly in code — no external files or API calls are required. Pass your detection parameters through SuspiciousAppDetectionConfig (V2 API) or via the legacy configuration fields (V1 API).


Modern (V2) API

val detectionConfig = SuspiciousAppDetectionConfig(
    packageNames = setOf("com.suspicious.app"),
    hashes = setOf("755ee39ff11bad65193c4806cadb9cedda41e20663c35494cb7d4e9646ddcf21"),
    requestedPermissions = setOf(
        setOf("android.permission.READ_SMS"),
        setOf("android.permission.BIND_ACCESSIBILITY_SERVICE"),
        setOf("android.permission.REQUEST_INSTALL_PACKAGES")
    ),
    grantedPermissions = setOf(
        setOf("android.permission.BIND_ACCESSIBILITY_SERVICE")
    ),
    malwareScanScope = MalwareScanScope(
        scanScope = ScopeType.SIDELOADED_ONLY,
        trustedInstallSources = listOf("com.android.vending")
    ),
    reasonMode = ReasonMode.HIGHEST_CONFIDENCE
)

val config = TalsecConfig.Builder(packageName, certificateHash)
    .suspiciousAppDetectionConfig(detectionConfig)
    .build()

Configuration Parameters

Parameter
Type
Default
Description

packageNames

Set/List<String>

null

Package identifiers to explicitly blocklist.

hashes

Set/List<String>

null

SHA-256 APK hashes to explicitly blocklist.

requestedPermissions

Set/List<List<String>>

null

Permission sets — flagged if all permissions in any set appear in the app's manifest.

grantedPermissions

Set/List<List<String>>

null

Permission sets — flagged if all permissions in any set are actively granted by the user.

malwareScanScope (Android) / scanScope (others)

MalwareScanScope / ScanScope

SIDELOADED_ONLY, no trusted sources

Controls which applications enter the scan. See Scan Scope below.

reasonMode

ReasonMode

HIGHEST_CONFIDENCE

Controls the detection decision logic. See Reason Mode below.

Scan Scope

The scan scope determines which installed applications are subject to heuristic evaluation.

scopeType
Behavior

SIDELOADED_ONLY (default)

Evaluates non-system, non-OEM applications not installed from a trusted source.

SIDELOADED_AND_OEM

Includes OEM pre-installed applications.

SIDELOADED_AND_SYSTEM_EXCLUDE_OEM

Includes system applications, excludes OEM.

SIDELOADED_AND_SYSTEM_AND_OEM

Includes all non-trusted applications regardless of origin.

ALL

Evaluates every installed application without exception.

Exclusions
Description

trustedInstallSources

Accepts a list of installer package names (e.g., com.android.vending for Google Play). Applications installed from these sources are excluded from scope-based evaluation.

Official stores are not excluded by default. To exclude Google Play apps from evaluation, explicitly add com.android.vending to trustedInstallSources.

Reason Mode

The reason mode determines the logic used to decide which applications are surfaced as threats based on the available signals.

Mode
Behavior

HIGHEST_CONFIDENCE (default)

Flags scope-based results only when a permission match is also present. Blocklist matches are always included.

ALL

Flags every application within the configured scan scope, regardless of permission results.


Legacy (V1) API

Configuration Parameters

Parameter
Type
Description

blacklistedPackageNames

Array/List<String>

Package identifiers to explicitly blocklist.

blacklistedHashes

Array/List<String>

SHA-256 APK hashes to explicitly blocklist.

suspiciousPermissions

Array/List<List<String>>

Permission sets — flagged if all permissions in any set are actively granted.

whitelistedInstallationSources

Array/List<String>

Trusted installer package names. Apps from unlisted sources are treated as sideloaded.

Last updated