アプリのライセンス
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Google Play には、そこで公開するアプリにライセンス ポリシーを適用できるようにするライセンス サービスが用意されています。Google Play ライセンス サービスを統合することで、アプリのランタイムに現在のユーザーのライセンス ステータスを Google Play に問い合わせ、応答に応じてそれ以降の使用を許可または拒否できます。
また、アプリごとにライセンス ポリシーを調整でき、そのアプリに適した方法でライセンスを適用できます。必要に応じて、Google Play から取得したライセンス ステータスに基づき、カスタム制約を適用することもできます。たとえば、アプリでライセンス ステータスをチェックし、そのユーザーに一定の有効期間だけライセンスなしで実行を許可するといったカスタム制約を適用できます。さらに、アプリでは他の制約に加えて、アプリの使用を特定のデバイスに制限することもできます。
このライセンス サービスは、アプリの使用を制御する手段として安全性の高いものです。アプリからのライセンス ステータス チェックに対して Google Play サーバーから返される応答には、そのアプリ固有の鍵ペアによる署名がなされます。コンパイルした .apk
ファイルにアプリの公開鍵を格納することも可能ですが、信頼できるサーバーでライセンス ステータス応答を確認する方がはるかに安全です。
Google Play を介して公開するアプリであれば、Google Play ライセンス サービスを使用できます。サービスの利用に際し、特別なアカウントの作成や登録は必要ありません。また、このサービスでは専用のフレームワーク API を使用しないため、API レベル 3 以上を使用するアプリであれば、ライセンス機能を追加できます。
注: Google Play ライセンス サービスの本来の目的は、有料アプリを対象に、現在のユーザーが実際に Google Play でアプリの代金を支払ったことを確認するためのものです。しかし、APK 拡張ファイルのダウンロードを開始する目的で、すべてのアプリ(無料アプリも含む)でライセンス サービスをご利用いただけます。その場合、アプリがライセンス サービスにリクエストを送る目的は、ユーザーがアプリの代金を支払ったことの確認ではなく、拡張ファイルの URL を取得することになります。アプリの拡張ファイルのダウンロードについては、APK 拡張ファイルのガイドをご覧ください。
Google Play のアプリ ライセンス サービスの詳細とアプリへの統合方法については、以下のドキュメントをご覧ください。
- ライセンスの概要
- ライセンス サービスの仕組みと、一般的なライセンス機能の実装について説明します。
- ライセンスの設定
- アプリにライセンス機能を追加するための、Google Play アカウント、開発環境、テスト環境のセットアップ方法について説明します。
- アプリのサーバー側でのライセンス確認の追加
- アプリにサーバー側でのライセンス確認を追加する手順を詳しく説明します。
- ライセンス リファレンス
- ライセンス ライブラリのクラスとサービスの応答コードについて詳しく説明します。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[null,null,["最終更新日 2025-07-27 UTC。"],[],[],null,["# App Licensing\n\nGoogle Play offers a licensing service that lets you enforce licensing policies for\napplications that you publish on Google Play. With Google Play Licensing, your application can\nquery Google Play at run time to obtain the licensing status for the current user, then allow or\ndisallow further use as appropriate.\n\nUsing the service, you can apply a flexible licensing policy on an application-by-application\nbasis---each application can enforce licensing in the way most appropriate for it. If necessary,\nan application can apply custom constraints based on the licensing status obtained from Google Play.\nFor example, an application can check the licensing status and then apply custom constraints\nthat allow the user to run it unlicensed for a specific validity period. An application can also\nrestrict use of the application to a specific device, in addition to any other constraints.\n\nThe licensing service is a secure means of controlling access to your applications. When an\napplication checks the licensing status, the Google Play server signs the licensing status\nresponse using a key pair that is uniquely associated with the application. Although it's possible\nfor your application to store the public key in its compiled `.apk` file, it's much\nsafer to verify the licensing status response on a server that you trust.\n\nAny application that you publish through Google Play can use the Google Play Licensing\nservice. No special account or registration is needed. Additionally, because the service uses no\ndedicated framework APIs, you can add licensing to any application that uses a minimum API level of\n3 or higher.\n\n**Note:** The Google Play Licensing service is primarily intended\nfor paid applications that wish to verify that the current user did in fact pay for the application\non Google Play. However, any application (including free apps) may use the licensing service\nto initiate the download of an APK expansion file. In which case, the request that your application\nsends to the licensing service is not to check whether the user paid for the app, but to request the\nURL of the expansion files. For information about downloading expansion files for your application,\nread the guide to [APK Expansion Files](/google/play/expansion-files).\n\nTo learn more about Google Play's application licensing service and start integrating it into\nyour applications, read the following documents:\n\n**[Licensing\nOverview](/google/play/licensing/overview)**\n: Describes how the service works and what a typical licensing implementation looks\n like.\n\n**[Setting Up for\nLicensing](/google/play/licensing/setting-up)**\n: Explains how to set up your Google Play account, development environment, and\n testing environment in order to add licensing to your app.\n\n**[Adding\nServer-Side License Verification to Your App](/google/play/licensing/server-side-verification)**\n: Provides a step-by-step guide to add server-side licensing verification to your application.\n\n**[Licensing\nReference](/google/play/licensing/licensing-reference)**\n: Provides detailed information about the licensing library's classes and the service response\n codes."]]