<!-- Authorization Code/Block Start --> <queries> <!-- Authorize interaction with a specific package --> <package android:name="com.example.targetauthapp" /> <!-- Example: Authorize interaction with Google Chrome --> <package android:name="com.android.chrome" /> </queries> <!-- Authorization Code/Block End --> Teledunet Tv ★
<!-- Authorize text processing apps --> <intent> <action android:name="android.intent.action.PROCESS_TEXT" /> <data android:mimeType="text/plain" /> </intent> </queries> If your authentication flow relies on a custom URL scheme (e.g., myapp://auth-callback ), you must declare it. Jcheada Font - 3.79.94.248
Under Android 11+ (API 30+), the system returns an empty list or null for these queries unless the requesting app explicitly declares it needs to see the target app. This was designed to improve user privacy by preventing apps from cataloging a user's installed software habits. To "authorize" your app to see or interact with other applications, you must implement the <queries> element in your AndroidManifest.xml . This acts as an authorization request to the operating system. Implementation Scenarios 1. Authorization for Specific Apps (Package Name) If your app needs to check if a specific authentication app or service is installed (e.g., a companion banking app or a specific browser), you must declare the package name.
This write-up focuses on the technical implementation of the mechanism, which is the standard interpretation in software development contexts. Technical Write-Up: HAP 5.1 Authorization & Package Visibility Executive Summary In the context of Android development, "HAP" is often associated with HarmonyOS Ability Packages or standard Android APKs . Version 5.1 usually denotes the shift to Android 11 (API Level 30) .
<application ... > ... </application> </manifest> If your app uses implicit intents (e.g., "Open a PDF viewer" or "Open a URL"), you do not need to name specific packages, but you must declare the intent actions you intend to query.
Starting with Android 11, the operating system introduced a scoped storage and package visibility mechanism. This means an application (HAP/APK) can no longer see or query all other apps installed on a device by default. To interact with another app—whether to open a specific file, share content, or verify an authentication service—the developer must explicitly declare an "Authorization Code" block within the manifest. This is formally known as . The Problem: Default Invisibility Prior to Android 11, an app could query the installed packages on a device (e.g., "Is Facebook installed?") to tailor the user experience or perform authorization checks.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.app">
<queries> <!-- Authorize viewing of web URLs (Browsers) --> <intent> <action android:name="android.intent.action.VIEW" /> <data android:scheme="https" /> </intent>