2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
署名済み構成の実装
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
署名済み構成機能を使用すると、非 SDK インターフェース制限の構成を APK に埋め込むことができます。これにより、特定の非 SDK インターフェースをブラックリストから削除することで、AndroidX が安全に使用できるようになります。その結果、AndroidX チームは、リリース済みの Android バージョンの新機能に対するサポートを追加できます。署名済み構成は Android 10 以降でサポートされます。
署名済み構成を適切にサポートすることで、今後 AndroidX ライブラリがデバイスで正しく機能するようになります。
この機能はカスタマイズできません。この機能は AOSP で完全にサポートされており、OEM がサポートする必要はありません。
例とソース
機能の実装は、システム サーバーの frameworks/base/services/core/java/com/android/server/signedconfig
にあります。CTS テスト CtsSignedConfigHostTestCases
には使用例が含まれており、cts/hostsidetests/signedconfig/app/version1_AndroidManifest.xml
にはサンプル構成があります。
実装
この機能をサポートするための作業は不要であり、特定のハードウェア要件はありません。
この機能では、2 つのアプリ メタデータキーにより APK 内に構成と署名が埋め込まれます。それらのキーは、android.settings.global
と android.settings.global.signature
です。AndroidX ライブラリで非 SDK インターフェースを今後ブラックリストから削除する必要がある場合は、これらのキーが Android チームによって(なおかつ / または)AndroidX の一部として公開されます。
APK メタデータキー android.settings.global
および android.settings.global.signature
は、どちらも base-64 でエンコードされたデータを格納しています。キー android.settings.global
の値は、SettingsProvider
のグローバル設定に適用される、JSON でエンコードされた構成値です。android.settings.global.signature
の値は、JSON データの ECDSA-p256 署名です。署名は構成データの発行元を検証するために使用されます。
この機能はユーザーからは参照できません。
カスタマイズ
この機能はカスタマイズを意図していません。OEM においては、キーの置換など、機能の変更を行わないことをおすすめします。変更すると、影響を受けるデバイスで今後 AndroidX が正常に機能しなくなる可能性があります。
検証
CTS テスト CtsSignedConfigHostTestCases
で機能の実装を検証できます。
適切な APK をインストールして adb logcat
の出力を調べることにより、手動で機能をテストすることもできます。
$ adb install CtsSignedConfigTestAppV1.apk
...
$ adb logcat
...
I SignedConfig: Verified config using production key
...
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-26 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-26 UTC。"],[],[],null,["# Implement Signed Config\n\nThe Signed Config feature allows embedding configuration of non-SDK interface restrictions\nin APKs. This allows removing specific non-SDK interfaces from the blacklist, to\nallow AndroidX to safely use them. This allows the AndroidX team to add support\nfor new features on Android versions that have already been released. It is\nsupported in Android 10 and later.\n\nProperly supporting Signed Config ensures that the AndroidX libraries will\nfunction correctly on devices in the future.\n\nNo customization of this feature is possible. It is fully supported in AOSP and\nrequires no OEM effort to support it.\n\nExamples and source\n-------------------\n\nThe feature implementation is in the system server at\n`frameworks/base/services/core/java/com/android/server/signedconfig`. The CTS\ntest `CtsSignedConfigHostTestCases` includes example usage, and an example\nconfiguration in\n`cts/hostsidetests/signedconfig/app/version1_AndroidManifest.xml`.\n\nImplementation\n--------------\n\nNo effort is required to support the feature, and there are no specific hardware\nrequirements.\n\nThe feature uses two application metadata keys to embed configuration and a\nsignature inside APKs. Those keys are `android.settings.global` and\n`android.settings.global.signature`. If or when the AndroidX libraries require\nnon-SDK interfaces to be removed from the blacklist in the future, values for\nthese keys will be published by the Android team and/or as part of AndroidX.\n\nThe APK metadata keys `android.settings.global` and\n`android.settings.global.signature` both contain base-64 encoded data. The value\nfor key `android.settings.global` is JSON-encoded config values to be applied to\nthe global settings in `SettingsProvider`. The value for\n`android.settings.global.signature` is an ECDSA-p256 signature of the JSON data.\nThe signature is used to verify the origin of the configuration data.\n\nThe feature isn't user visible.\n\nCustomization\n-------------\n\nThe feature isn't intended for customization. OEMs are discouraged from\nmodifying the feature, including replacing the keys. Any changes to it are\nlikely to cause AndroidX to not function properly on affected devices in the\nfuture.\n\nValidation\n----------\n\nThe CTS test `CtsSignedConfigHostTestCases` verifies the feature implementation.\n\nYou can also test the feature manually by installing an appropriate APK and\ninspecting the `adb logcat` output: \n\n $ adb install CtsSignedConfigTestAppV1.apk\n ...\n $ adb logcat\n ...\n I SignedConfig: Verified config using production key\n ..."]]