2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
Android の権限
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Android の権限を活用すると、ユーザーの意識を高めるコントロールを提供し、またアプリによるセンシティブ データへアクセスを制限できます。Android 8.0 以前での権限の設定には、許可リスト登録が含まれています。許可リスト登録を行わないと、特権アプリは priv-app
パスに含まれていても無効になります。Android 9 以降では、正しく許可リストに登録されていないアプリの使用を試みるデバイスは起動しません。
Android 10 では、ロールという概念が導入されました。ロールは、特定の要件と権限に関連付けられたシステム内の一意の名前です。アプリにロールを割り当て、特定の目的に合わせて権限を付与したり、プラットフォーム構成リソースを使用してデフォルト ロールを設定したりできます。
有害な可能性があるアプリ(PHA)に対する保護の強化により、以下が改善されました。
- 有害な可能性があるアプリの動作に対する透明性。
- ユーザーによるアプリ動作の制御。
- 権限で保護されているプライベート データを使用する場合のアプリ デベロッパーの裁量。
パッケージ インストールと権限
Android 9 以前は、パッケージ インストールと権限コントロールの機能が PackageInstaller
パッケージ(//packages/apps/PackageInstaller
)に含まれていました。Android 10 以降では、権限コントロール機能が別のパッケージ PermissionController
(//packages/apps/PermissionController
)に含まれています。図 1 に Android 10 における 2 つのパッケージの格納場所を示します。
図 1. Android 10 のパッケージ インストールおよび権限コントロール機能
許可リストとアクセス
Android 6.0 以降では、アプリが実行時に危険な権限へのアクセスをリクエストします。Android 10 では、危険な権限の変更または許可をユーザーに求める、操作の認識(AR)ランタイム権限が追加されています。
Android 8.0 では、/etc/permissions
ディレクトリのシステム構成 XML ファイルで特権アプリを明示的に許可リスト登録する必要がありました。Android 9 以降では、特権を許可リスト登録しないとデバイスを起動できません。
内部 API の公開を制限し、アプリが誤ってプラットフォーム ライブラリにアクセスするのを防ぐために、Android 7.0 でネイティブ ライブラリの名前空間が導入されました。これにより、システム ライブラリがアプリ ライブラリから分離され、デバイス メーカーが独自のネイティブ ライブラリを追加できるようになりました。
Android 10 以降、アプリがデバイスの画面コンテンツにアクセスするには、署名権限とユーザーの同意の両方が必要です。スクリーンショットの撮影などでサイレント キャプチャ機能を使用する特権アプリは、代わりに MediaProjection クラスを使用する必要があります。
Android 15 では、/etc/permissions
ディレクトリ内のシステム構成 XML ファイルで、システム以外のアプリによってリクエストされた、またはシステムアプリのアップデートによって新たにリクエストされたプラットフォーム署名権限を明示的に許可リストに登録する必要があります。
透明性とプライバシー
Android 6.0 以降では、Wi-Fi サービス プロバイダとパケット アナライザがアクセスできないように、デバイスの出荷時 MAC アドレスが保護されています。Android 10 で追加された制限により、アプリは特権の許可リストに登録されていない限り、不変のデバイス ID にアクセスできません。携帯通信会社にも影響するため、デバイス ID に関連する情報については、接続セクションで説明します。
Android 9 以前では、ユーザーはアプリに位置情報へのアクセス権を付与する際に永続的な選択を行います。Android 10 以降では、位置情報の 3 段階の利用許可機能により、アプリにデバイスの位置情報へのアクセスを許可する方法が 3 つ用意されています。これらの権限要件は、ターゲット SDK に関係なく Android 10 のアプリに適用されます。
Android 10 以降での他の透明性およびプライバシー機能に対する権限の構成
簡素化された構成
Android 6.0 以降では、権限の構成が簡素化されています。
init
によって起動されるサービスのアンビエント機能は、サービス構成のすべての要素を 1 つの .rc
ファイルに保持します。init
によって起動されないサービスの機能を設定する場合は、代わりに fs_config.c
を使用してファイル システム機能を構成します。
- Android 7.x 以前では、デバイス固有の
android_filesystem_config.h
ファイルを使用してファイルシステム機能およびカスタムのデバイスメーカー AID(またはいずれか一方)を指定し、Android ID(AID)メカニズムを拡張します。Android 8.0 以降では、ファイルシステム機能を拡張する新しいメソッドがサポートされています。
- Android 8.0 では、USB コマンドの処理がデバイス固有の
init
スクリプト(HAL レイヤの代用)からネイティブ USB デーモンに移行されました。Android 8.0 以降を搭載するすべてのデバイスに、USB HAL インターフェースを実装する必要があります。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-05 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-05 UTC。"],[],[],null,["# Android permissions provide controls that increase user awareness and limit\nan app's access to sensitive data. Configuring permissions on Android 8.0 and\nlower includes allowlisting, without which privileged apps are disabled, even\nif they're in the `priv-app` path. On Android 9 and higher, a device\nthat tries to use apps that aren't properly allowlisted won't boot.\n\nAndroid 10 introduced the concept of a\n[role](https://developer.android.com/reference/android/app/role/RoleManager), a unique\nname within the system associated with\ncertain requirements and privileges. Assign roles to apps to grant them permissions for\na specific purpose, and configure default roles using platform config resources.\n\nThe increased protections against\n[Potentially\nHarmful Apps](https://developers.google.com/android/play-protect/potentially-harmful-applications) (PHAs) improve:\n\n- Transparency into potentially harmful app behavior.\n- User control over app behavior.\n- App developers' discretion when using private data, protected by permissions.\n\n### Package install and permission\n\nIn Android 9 and lower, the package install and permission control\nfunctionalities were contained in the `PackageInstaller` package\n(`//packages/apps/PackageInstaller`). In Android 10 and higher, the permission control functionality\nresides in a separate package, `PermissionController`\n(`//packages/apps/PermissionController`). [Figure 1](#package-install)\nillustrates where the two packages reside in Android 10.\n\n**Figure 1.** Package install and\npermission-control functionalities in Android 10\n\n### Allowlists and access\n\nIn Android 6.0 and higher, apps request access to dangerous permissions at\n[runtime](/docs/core/permissions/runtime_perms).\nAndroid 10 adds activity recognition (AR) runtime\npermissions, which prompt the user to modify or allow dangerous\npermissions.\n\nAndroid 8.0 required you to explicitly allowlist privileged apps in the\nsystem configuration XML files in the `/etc/permissions` directory.\nIn Android 9 and higher, privileged permissions must be\n[allowlisted](/docs/core/permissions/perms-allowlist)\nor the device can't boot.\n\nTo limit internal API visibility and prevent apps from accidentally\naccessing platform libraries, Android 7.0 introduced\n[Namespaces\nfor Native Libraries](/docs/core/permissions/namespaces_libraries). This separates system libraries from app\nlibraries, and device manufacturers can add their own native libraries.\n\nStarting in Android 10 apps must have both\nsignature permissions and user consent to [access a device's screen content](/docs/core/permissions/restricted-screen-reading). Privileged apps that rely on the silent\ncapture functionality, such as taking a screenshot, should use the\n[MediaProjection](https://developer.android.com/reference/android/media/projection/MediaProjection)\nclass instead.\n\nAndroid 15 requires you to explicitly\n[allowlist](/docs/core/permissions/signature-permission-allowlist)\nplatform signature permissions that are requested by nonsystem apps or newly requested by updates\nto system apps, in the system configuration XML files in the `/etc/permissions`\ndirectory.\n\n### Transparency and privacy\n\nIn Android 6.0 and higher, a device factory MAC address is protected from\naccess by Wi-Fi service providers and packet analyzers. Additional restrictions as\nof Android 10 limit apps from accessing the\n[immutable\ndevice identifiers (IDs)](/docs/core/permissions/immutable-device-ids) unless they're [allowlisted for privileged permissions](/docs/core/permissions/perms-allowlist). (The [**Connectivity**](/docs/core/connect) section provides a related discussion about\n[Device\nIdentifiers](/docs/core/connect/device-identifiers), as this impacts carriers.)\n\nOn Android 9 and lower, users make persistent choices when granting location\naccess to apps. Starting in Android 10, a\n[tristate\nlocation permissions](/docs/core/permissions/tristate-perms) feature gives users three options to allow app access\nto a device's location. These permission requirements are applied to apps in\nAndroid 10 regardless of target SDK.\n\nConfigure permissions for other transparency and privacy features starting\nin Android 10\n\n- The [background access location](/docs/core/permissions/background-location-access) reminder shows users when an app accesses their device location using [ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION) permission in the background.\n- Contacts-affinity related data, managed by the Contacts Provider component, is accessed differently: Apps can't write to or read from the [contact\n affinities](/docs/core/permissions/contacts-affinities) data in the database. This impacts [caller-related APIs](/docs/core/permissions/contacts-affinities#APIchanges).\n\n### Streamlined configurations\n\nPermissions configurations have been streamlined for Android 6.0 and\nhigher.\n\n- [Ambient\n capabilities](/docs/core/permissions/ambient) for services launched by `init` keeps all aspects of the service configuration in a single `.rc` file. When setting capabilities for services not launched by `init`, configure file system capabilities using `fs_config.c` instead.\n- Android 7.x and lower extend the Android IDs (AIDs) mechanism, using a device-specific `android_filesystem_config.h` file to specify filesystem capabilities and/or custom device-manufacturer AIDs. Android 8.0 and higher supports a [new method\n to extend filesystem capabilities](/docs/core/permissions/filesystem).\n- In Android 8.0, handling USB commands moved out of device-specific `init` scripts (a substitution for HAL layers) and into a native USB daemon. The [USB HAL](/docs/core/permissions/usb-hal) interface must be implemented on every device launching on Android 8.0 and higher."]]