Android アプリに Apache License, Version 2.0 のライブラリを組み込むときにしなければならないこと
Android アプリを開発していると Apache License, Version 2.0 のライブラリを使うことが多いと思います。
上のページを見るとわかるように、Android Open Source Project は基本的に Apache License, Version 2.0 ですし、Android Open Source Project 以外のライブラリを見ても、Android 関係では Apache License, Version 2.0 が多数派のようです。 そういうわけで、使用する機会の多い Apache License, Version 2.0 のライブラリですが、Android アプリに組み込むときに (ライセンス的に) 何をする必要があるのか調べたのでまとめておきます。 法律とかライセンスについてはさほど詳しくないので間違ってるかもしれません。
Apache License, Version 2.0 と Android アプリ
用語的なところ
Apache 2.0 ライセンスのライブラリ自体は、「Work」 (成果物) ですね。
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
で、Apache 2.0 ライセンスのライブラリを組み込んだ Android アプリのパッケージは、「Derivative Work」 (派生成果物) になると思われます。
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
『Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.』 と書かれているので、『Apache 2.0 ライセンスのライブラリを使用する Android アプリのソースコード一式 (ビルド時に Apache 2.0 ライセンスのライブラリを組み込むが、ソースコード一式には含まれていない)』 なんてものは Apache License, Version 2.0 でいうところの 「Derivative Work」 にはあたらないと思います (多分)。
形態としては 「Source」 形式と 「Object」 形式がありますが、Android アプリのパッケージは 「Object」 形式です。
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
再頒布の条件
再頒布については 「4. Redistribution」 に書かれています。
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
- a. You must give any other recipients of the Work or Derivative Works a copy of this License; and
- b. You must cause any modified files to carry prominent notices stating that You changed the files; and
- c. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
- d. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
a. は 『Apache License, Version 2.0』 のコピーをアプリのユーザーに渡す必要があるということ。 『give any other recipients a copy of this License』 って具体的に何をすればいいのか明確ではないですが、次のようなことをすれば良さそうです。
それと、なぜ Apache License, Version 2.0 を表示しているのかを説明するために 「このアプリは Apache License, Version 2.0 のライセンスで配布されている成果物を含んでいます。」 といったことを記述しておけば良さそうですね。
b. と c. については、Apache 2.0 ライセンスのライブラリに変更を加えずに Android アプリに組み込む場合には関係ないはずです。
で、最後に d. ですが、使用するライブラリに “NOTICE” テキストファイル (「NOTICE」 とか 「NOTICE.txt」 といったファイル名であることが多いようです) が含まれている場合、その中に書かれている帰属通知のコピーを、アプリのユーザーが読める形 (readable copy) でアプリに含める必要があります。
NOTICE に含まれている帰属通知のコピーを含める場所の候補としては、次の 3 つが挙げられています。
- 派生成果物の一部として頒布される NOTICE テキストファイルの中
- ソース形式のファイルやドキュメントの中 (派生成果物と一緒に頒布されるのであれば)
- 派生成果物により生成される表示の中 (そのようなサードパーティの通知が通常表示される場合で、そのような場所ならどこへでも (?))
とはいえ Android アプリの場合は一緒に NOTICE テキストファイルをユーザーに渡すことはできませんし、ソース形式やドキュメントも渡すことはできないですし、となると、自然と Android アプリによって生成される表示の中に含めるということになります。
世の中の Android アプリを見ると、設定画面の中に 「オープンソースライセンス」 という項目があり、それを開くと使用しているライブラリの NOTICE 内の帰属通知や Apache License, Version 2.0 の文面が書かれている、というものを多く見かけます。
NOTICE がないライブラリの名前を挙げる必要があるのかどうか
NOTICE があるライブラリについては当然そのライブラリの名前を挙げることになりますが、そうでない場合にライブラリの名前を挙げる必要があるのかどうか、というのはよくわかりません。
Web 上の Q&A サイトなどを見てもそれについて言及しているものは見当たらなかったのですが、個人的には NOTICE がなくとも使用しているライブラリの名前を挙げておいた方が健全だと思っています。 (表示する必要があるかどうかはわかんないですが、一般的に言ってあえて表示しない理由もないと思いますし、表示しておいたらいいんじゃないの、という気分です。)
しなければならないことのまとめ
Apache 2.0 ライセンスのライブラリを使用する (ライブラリに改変を加えずに Android アプリに組み込む) 場合は、次のことをする必要があります。
- Apache License, Version 2.0 のコピーをアプリのユーザーに渡す
- アプリの説明文に http://www.apache.org/licenses/LICENSE-2.0 へのリンクを張る、とか、アプリの中にライセンス文面全体を表示するようにする、とかすれば良さそう
- あわせて 「このアプリは Apache License, Version 2.0 のライセンスで配布されている成果物を含んでいます。」 といったことを記述しておくと良さそう
- NOTICE があるライブラリについては、NOTICE に含まれる帰属通知をアプリの中に表示するようにする
そのような表示は、アプリの設定画面から開くことができるようになっているのが一般的なようです。
他のアプリの例
Android アプリがどのようにライセンスの表示を行っているのか、いくつか調べましたので例として挙げておきます。
Google Play ストアアプリ
設定画面に 「オープンソースライセンス」 という項目があり、それをタップすると使用しているライブラリの jar ファイルの名前と、その中に含まれている NOTICE テキストの内容が並んでいるビューが開く。 ライセンス自体の文面は表示されていない。
調べてる時に見かけたページたち
以下は Apache License, Version 2.0 について、あるいはもっと限定して Android アプリに Apache 2.0 ライセンスのライブラリを使う場合の話。
- licensing - Apache Licensed component in android app - Stack Overflow
- Apache Licenseの表記について (Google Groups)
- ライセンスの表示 (?) をアプリの概要から開けるようにしている、という話。
- Apache 2.0ライセンスの著作物を含むアプリの配布方法 - akJとackeyシリーズ 開発日記
- こちらも、Apache 2.0 ライセンスをアプリ内に表示する、という話。
- Apache2.0ライセンスのライブラリの組み込んだAndroidアプリ: Y05_net's blog
- apk に含めていればユーザーが見えなくてもいいのか、とか、Apache 2.0 ライセンスの文面が見えるようなリンクがあればいいのか、とか、『You must give any other recipients of the Work or Derivative Works a copy of this License』 の解釈が難しい。
- 【保存版】GLPにApache Licence2.0,知らなかったでは済まされないライセンスのお話 | INKA-ITソリューション
- Apache Licence 2.0ってどう書けばいいのさ | Androidアプリつくったった
- 上と同じ。 参考にすべきではない。
Androidプログラミングレシピ増補改訂版 メディア/データ/システム/ライブラリ/NDK編
- 作者: Dave Smith,Jeff Friesen,吉川邦夫
- 出版社/メーカー: インプレスジャパン
- 発売日: 2013/09/24
- メディア: 単行本(ソフトカバー)
- この商品を含むブログを見る
*1:たまに NOTICE ファイルにライセンス全文を含んでいるようなライブラリもありますが、そう言った場合でも帰属通知の部分だけコピーすればよいです