Back to Chromium

Identifiers in Web Apps (WebAPKs and TWAs)

components/webapps/docs/projects/al-site-settings/web_app_identifiers_android.md

151.0.7873.12.9 KB
Original Source

Identifiers in Web Apps (WebAPKs and TWAs)

This document clarifies the differences between various identifiers used in the context of Web Apps (WebAPKs and TWAs) on Android.

Identifiers Breakdown

IdentifierScopeSourceWebAPKStandard TWATWA Installer (Auto-Minted)
Manifest IDWeb AppWeb Developer (in manifest.json)Used to identify the PWA; influences package name.Optional in manifest; does not influence package name automatically.Used to identify the PWA; influences package name.
Package NameAndroid OSGenerated by Server/Installer or specified by Developerorg.chromium.webapk.<hash> (hash derived from Manifest ID/URL).Manually specified in Android project (e.g., com.example.app).com.android.webapp.<hash> (hash derived from Manifest ID/URL).
Android UIDAndroid OSAssigned by Android at install timeUnique per installation instance (varies by user profile).Unique per installation instance.Unique per installation instance.
Android AppIdAndroid OSAssigned by Android at install timeConstant across users for the same app package.Constant across users for the same app package.Constant across users for the same app package.
App Name / LabelUser VisibleWeb Manifest or Android ProjectDerived from name or short_name in manifest.Specified in Android project AndroidManifest.xml.Derived from name or short_name in manifest.
OriginWebWeb URLThe web origin (e.g., https://example.com) the app is locked to.The web origin the app is locked to.The web origin the app is locked to.
DomainWebDerived from OrigineTLD+1 (e.g., example.com) used for broader data clearing scopes.Used for broader data clearing scopes.Used for broader data clearing scopes.

Detailed Concepts

1. Android UID (User ID)

  • Scope: Android Operating System.
  • Type: Integer.
  • Definition: UID = UserId * 100000 + AppId.
  • Purpose: Used for process isolation, security sandboxing, and permission management.
  • Sharing: Can be shared between packages that request it (via sharedUserId in AndroidManifest.xml) and are signed by the same key.

2. Android AppId

  • Scope: Android Operating System.
  • Type: Integer.
  • Source: Part of the UID assigned by the Android system.
  • Purpose: Identifies the application within the user's space. It is NOT derived from the Web Manifest.

3. Web Manifest ID

  • Scope: Web Application (PWA).
  • Type: String (defined in manifest.json).
  • Source: Provided by the web developer.
  • Purpose: Uniquely identifies the PWA to the browser. It allows the browser to track the app even if the start URL or manifest URL changes.

Summary Flow

Web Manifest ID -> (influences) -> Android Package Name -> (installed by Android) -> assigns Android UID (containing AppId).