Status: Implemented and tested

Installed Applications Subsystem

Application diagnostics inspects the software package inventory of the device: package names, version codes, install/update timestamps, target SDK API levels, system vs user app classification, and cryptographic APK signing certificates.

Android 11+ Package Visibility Restrictions (API 30)

Prior to Android 11, any installed app could call PackageManager.getInstalledPackages(0) to inspect every other application on the phone. To protect user privacy from tracking and behavioral fingerprinting, Google introduced Package Visibility Filtering in Android 11 (API 30). By default, apps can only see themselves and critical system services. To enumerate third-party apps, an app must declare specific packages inside an <queries> manifest tag or hold the high-privilege QUERY_ALL_PACKAGES permission (strictly gated by Google Play policy).

System App vs. User App Classification

Voodoo evaluates ApplicationInfo.flags bitmasks: FLAG_SYSTEM indicates factory pre-installed apps located on the read-only /system or /vendor partition; FLAG_UPDATED_SYSTEM_APP identifies pre-installed apps that have received userland updates.

Target SDK & Security Sandbox

Every package declares a targetSdkVersion. If an app targets an older API level (e.g. targetSdk 28), Android runs it under legacy compatibility rules. Voodoo inspects target SDKs to help developers and users evaluate security postures.

How Voodoo Inspects Applications

1. Primary Call & API-Level Fallback Chain

Extracted from ApplicationCollector.kt. Uses PackageManager.getInstalledPackages(), with segregated helpers for API 28+ 64-bit version codes and API 24+ minimum SDKs:

// Excerpt from com.tool3.hardwareinfo.categories.application.ApplicationCollector.kt
val pm = context.packageManager
val packages = pm.getInstalledPackages(0)

for (pkg in packages) {
    val appName = pkg.applicationInfo.loadLabel(pm).toString()
    val packageName = pkg.packageName
    val isSystem = (pkg.applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM) != 0
    val targetSdk = pkg.applicationInfo.targetSdkVersion

    // 64-bit version code (API 28+) with legacy 32-bit fallback
    val versionCode = if (Build.VERSION.SDK_INT >= 28) {
        ModernApplicationHelper.getLongVersionCode(pkg)
    } else {
        pkg.versionCode.toLong()
    }
}

2. Permission & Privilege Gate

On Android versions up to 10 (API 29), package querying requires zero permissions. On Android 11+ (API 30+), enumerating all packages requires the android.permission.QUERY_ALL_PACKAGES manifest declaration, which Google Play strictly limits to device search, antivirus, and diagnostic utilities.

3. Interpretation & Normalization Logic

  • Timestamps: Converts raw millisecond timestamps (firstInstallTime, lastUpdateTime) into human-readable ISO-8601 UTC strings.
  • System / User Breakdown: Aggregates total installed packages into discrete counts: User Apps, Pre-Installed System Apps, and Updated System Apps.

4. Availability-State Triggers

  • On API 30+ devices without QUERY_ALL_PACKAGES, third-party package counts reflect only visible apps and are labeled AvailabilityState.RESTRICTED_BY_ANDROID.
  • minSdkVersion query on Android < 7.0 triggers AvailabilityState.UNSUPPORTED.

Subsystem Field Inventory

Field ID Display Name Type Primary Source / API Min API
app.total_installed_count Total Installed Packages INTEGER PackageManager.getInstalledPackages(0).size API 1
app.user_apps_count User Installed Applications INTEGER Filtered non-FLAG_SYSTEM packages API 1
app.system_apps_count System Applications INTEGER Filtered FLAG_SYSTEM packages API 1
app.visibility_restricted API 30 Package Visibility Gated BOOLEAN Evaluated on Android 11+ framework state API 30