├── .gitignore ├── .idea ├── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml └── inspectionProfiles │ └── Project_Default.xml ├── CHANGELOG.md ├── Jenkinsfile ├── LICENSE.txt ├── README.md ├── build.gradle ├── gradle.properties ├── gradle ├── jacoco.gradle ├── publishMavenLocal.gradle ├── versioning.gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── licensesdialog ├── .gitignore ├── build.gradle └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── de │ │ │ └── psdev │ │ │ └── licensesdialog │ │ │ ├── LicenseResolver.java │ │ │ ├── LicensesDialog.java │ │ │ ├── LicensesDialogFragment.java │ │ │ ├── NoticesHtmlBuilder.java │ │ │ ├── NoticesXmlParser.java │ │ │ ├── licenses │ │ │ ├── ApacheSoftwareLicense20.java │ │ │ ├── BSD2ClauseLicense.java │ │ │ ├── BSD3ClauseLicense.java │ │ │ ├── CreativeCommonsAttribution30Unported.java │ │ │ ├── CreativeCommonsAttributionNoDerivs30Unported.java │ │ │ ├── CreativeCommonsAttributionShareAlike30Unported.java │ │ │ ├── EclipsePublicLicense10.java │ │ │ ├── GnuGeneralPublicLicense20.java │ │ │ ├── GnuGeneralPublicLicense30.java │ │ │ ├── GnuLesserGeneralPublicLicense21.java │ │ │ ├── GnuLesserGeneralPublicLicense3.java │ │ │ ├── ISCLicense.java │ │ │ ├── License.java │ │ │ ├── MITLicense.java │ │ │ ├── MozillaPublicLicense11.java │ │ │ ├── MozillaPublicLicense20.java │ │ │ └── SILOpenFontLicense11.java │ │ │ └── model │ │ │ ├── Notice.java │ │ │ └── Notices.java │ └── res │ │ ├── raw │ │ ├── asl_20_full.txt │ │ ├── asl_20_summary.txt │ │ ├── bsd2_full.txt │ │ ├── bsd2_summary.txt │ │ ├── bsd3_full.txt │ │ ├── bsd3_summary.txt │ │ ├── ccand_30_full.txt │ │ ├── ccand_30_summary.txt │ │ ├── ccby_30_full.txt │ │ ├── ccby_30_summary.txt │ │ ├── ccbysa_30_full.txt │ │ ├── ccbysa_30_summary.txt │ │ ├── epl_v10_full.txt │ │ ├── epl_v10_summary.txt │ │ ├── gpl_20_full.txt │ │ ├── gpl_20_summary.txt │ │ ├── gpl_30_full.txt │ │ ├── gpl_30_summary.txt │ │ ├── isc_full.txt │ │ ├── isc_summary.txt │ │ ├── lgpl_21_full.txt │ │ ├── lgpl_21_summary.txt │ │ ├── lgpl_3_full.txt │ │ ├── lgpl_3_summary.txt │ │ ├── mit_full.txt │ │ ├── mit_summary.txt │ │ ├── mpl_11_full.txt │ │ ├── mpl_11_summary.txt │ │ ├── mpl_20_full.txt │ │ ├── mpl_20_summary.txt │ │ ├── notices.xml │ │ ├── sil_ofl_11_full.txt │ │ └── sil_ofl_11_summary.txt │ │ ├── values-bg │ │ └── strings.xml │ │ ├── values-cs │ │ └── strings.xml │ │ ├── values-de │ │ └── strings.xml │ │ ├── values-el │ │ └── strings.xml │ │ ├── values-es │ │ └── strings.xml │ │ ├── values-fr │ │ └── strings.xml │ │ ├── values-hu │ │ └── strings.xml │ │ ├── values-it │ │ └── strings.xml │ │ ├── values-ja │ │ └── strings.xml │ │ ├── values-ko │ │ └── strings.xml │ │ ├── values-pl │ │ └── strings.xml │ │ ├── values-pt │ │ └── strings.xml │ │ ├── values-ro │ │ └── strings.xml │ │ ├── values-ru │ │ └── strings.xml │ │ ├── values-tr │ │ └── strings.xml │ │ ├── values-uk │ │ └── strings.xml │ │ ├── values-zh-rCN │ │ └── strings.xml │ │ ├── values-zh-rTW │ │ └── strings.xml │ │ └── values │ │ ├── base_html.xml │ │ └── strings.xml │ └── test │ ├── java │ └── de │ │ └── psdev │ │ └── licensesdialog │ │ ├── LicenseResolverTest.java │ │ └── NoticesXmlParserTest.java │ └── res │ └── raw │ └── notices.xml ├── lint.xml ├── renovate.json ├── sample ├── .gitignore ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ ├── ic_launcher-web.png │ ├── java │ └── de │ │ └── psdev │ │ └── licensesdialog │ │ └── sample │ │ └── MainActivity.java │ └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── drawable-xxxhdpi │ └── ic_launcher.png │ ├── layout │ └── activity_main.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── raw │ └── notices.xml │ └── values │ ├── base_html.xml │ ├── colors.xml │ ├── ic_launcher_background.xml │ ├── strings.xml │ └── styles.xml ├── screenshot.png └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | ### Android template 3 | # Built application files 4 | *.apk 5 | *.ap_ 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | out/ 17 | 18 | # Gradle files 19 | .gradle/ 20 | build/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | # Log Files 29 | *.log 30 | 31 | # Android Studio Navigation editor temp files 32 | .navigation/ 33 | 34 | # Android Studio captures folder 35 | captures/ 36 | 37 | # IntelliJ 38 | *.iml 39 | .idea/* 40 | !.idea/codeStyles 41 | !.idea/inspectionProfiles 42 | 43 | # Keystore files 44 | # Uncomment the following line if you do not want to check your keystore files in. 45 | #*.jks 46 | 47 | # External native build folder generated in Android Studio 2.2 and later 48 | .externalNativeBuild 49 | 50 | # Google Services (e.g. APIs or Firebase) 51 | google-services.json 52 | 53 | # Freeline 54 | freeline.py 55 | freeline/ 56 | freeline_project_description.json 57 | 58 | # fastlane 59 | fastlane/report.xml 60 | fastlane/Preview.html 61 | fastlane/screenshots 62 | fastlane/test_output 63 | fastlane/readme.md 64 | 65 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 116 | 117 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Change Log 2 | ========== 3 | 4 | Version 2.2.0 *(2021-05-15)* 5 | -------------------------------- 6 | 7 | * **ADDED**: Support for Dark Mode (#105) 8 | 9 | Version 2.1.0 *(2019-06-21)* 10 | ---------------------------- 11 | 12 | * **ADDED**: Add Bulgarian translation (#93) 13 | * **ADDED**: Add Czech translation (#93) 14 | * **ADDED**: Add French translation (#93) 15 | * **ADDED**: Add Greek translation (#93) 16 | * **ADDED**: Add Hungarian translation (#93) 17 | * **ADDED**: Add Italian translation (#93) 18 | * **ADDED**: Add Polish translation (#93) 19 | * **ADDED**: Add Romanian translation (#93) 20 | * **ADDED**: Add Spanish translation (#93) 21 | * **ADDED**: Add Turkish translation (#93) 22 | 23 | Version 2.0.0 *(2019-01-20)* 24 | -------------------------------- 25 | 26 | * **BREAKING**: Update to AndroidX 27 | 28 | Version 1.9.0 *(2018-10-07)* 29 | ---------------------------- 30 | 31 | * **CHANGED**: minSdkVersion is now 14 32 | * **CHANGED**: Converted project to Gradle 33 | * **REMOVED**: Removed support for non-AppCompat Dialogs 34 | * **CHANGED**: Compile with Java 8 syntax 35 | 36 | Version 1.8.3 *(2017-07-23)* 37 | ---------------------------- 38 | 39 | * **CHANGED**: Switch license URLs to https (#82) 40 | * **ADDED**: Add Traditional Chinese translation (#81) 41 | * **ADDED**: Add Portuguese translation (#79) 42 | * **ADDED**: Add Ukrainian translation (#77) 43 | 44 | Version 1.8.2 *(2017-03-17)* 45 | ---------------------------- 46 | 47 | * **ADDED**: Mozilla Public License 2.0 (#65) 48 | * **ADDED**: Creative Commons Attribution 3.0 Unported (#68) 49 | * **ADDED**: Make the LicensesDialogFragment's licenses text styleable (#75) 50 | * **FIXED**: NullPointerException on Android 4.4 (#65) 51 | 52 | Version 1.8.1 *(2016-04-23)* 53 | ---------------------------- 54 | 55 | * **FIXED**: Removed unused throws declaration (#62) 56 | * **ADDED**: Creative Commons Attribution-Share Alike 3.0 Unported (#56) 57 | * **ADDED**: SIL Open Font License v1.1 (#54) 58 | * **ADDED**: Russian translation (#53) 59 | * **ADDED**: Mozilla Public License 1.1 (#52) 60 | * **FIXED**: Opening license url in browser instead of webview on Android 5.x (#45) 61 | 62 | Version 1.8.0 *(2015-07-26)* 63 | ---------------------------- 64 | 65 | * added BSD 2-Clause License (#47) 66 | * added GNU LGPL 3 (#43) 67 | * Support Appcompat and alert dialogs in the support library (#42) 68 | 69 | Version 1.7.0 *(2015-02-21)* 70 | ---------------------------- 71 | 72 | * Add Japanese translation (#38) 73 | * Adding pre-cached loading of licenses text from resources (#35) 74 | * **WARNING: The API for licenses has changed. Please review your code!** 75 | 76 | Version 1.6.0 *(2014-09-08)* 77 | ---------------------------- 78 | 79 | * Added GNU GPLv2 / GPLv3 License (#28) 80 | * Improve NoticesHtmlBuilder speed (#29) 81 | * Added methods for customization (#30) 82 | * Replaced LicensesDialog constructors with builder, removed SingleLicenseDialog as it is now handled by the builder 83 | * **WARNING: The constructor arguments have changed. Please review your code!** 84 | 85 | Version 1.5.0 *(2014-06-01)* 86 | ---------------------------- 87 | 88 | * Load notices into a List to allow programmatic modifications (#21) 89 | 90 | Version 1.4.0 *(2014-02-02)* 91 | ---------------------------- 92 | 93 | * Switch to aar packaging (#10) 94 | 95 | Version 1.3.0 *(2013-11-24)* 96 | ---------------------------- 97 | 98 | * Removed dependency to simple-xml and commons-io 99 | 100 | Version 1.2.1 *(2013-10-15)* 101 | ---------------------------- 102 | 103 | * Fixed Typo in LicensesDialogFragment (#11) 104 | * Improve readability of license texts (#12) 105 | 106 | Version 1.2.0 *(2013-09-11)* 107 | ---------------------------- 108 | 109 | * Support for MIT License (#7) 110 | 111 | Version 1.1.0 *(2013-05-09)* 112 | ---------------------------- 113 | 114 | * Option to include license information of this library in shown Dialog 115 | 116 | 117 | Version 1.0.0 *(2013-04-01)* 118 | ---------------------------- 119 | 120 | * Initial release. 121 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | options { 3 | buildDiscarder(logRotator(artifactNumToKeepStr: '5', numToKeepStr: '15')) 4 | } 5 | agent any 6 | stages { 7 | stage('Prepare environment') { 8 | steps { 9 | sh "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" 10 | } 11 | } 12 | stage('Build') { 13 | steps { 14 | sh './gradlew clean build' 15 | junit allowEmptyResults: true, testResults: '**/build/test-results/testDebugUnitTest/TEST-*.xml' 16 | jacoco classPattern: '**/build/intermediates/javac/debug,**/build/intermediates/javac/debugUnitTest', exclusionPattern: '**/R.class,**/R$*.class,**/BuildConfig.*,**/*$ViewInjector*.*,**/*$ViewBinder*.*', execPattern: '**/testDebugUnitTest.exec' 17 | } 18 | } 19 | stage("Analyze") { 20 | steps { 21 | withSonarQubeEnv('PSDev') { 22 | sh './gradlew sonarqube' 23 | } 24 | timeout(time: 1, unit: 'HOURS') { 25 | waitForQualityGate abortPipeline: false 26 | } 27 | } 28 | } 29 | stage("Deploy") { 30 | steps { 31 | sh './gradlew publish' 32 | zip dir: 'build/m2repository', glob: '', zipFile: 'build/m2repository.zip', archive: true 33 | } 34 | } 35 | } 36 | post { 37 | always { 38 | archiveArtifacts allowEmptyArchive: true, artifacts: '**/build/reports/,sample/build/outputs/apk/debug/sample-debug.apk', fingerprint: true 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | LicensesDialog [![Build Status](https://ci.psdev.de/job/PSDevLicensesDialog/badge/icon)](https://ci.psdev.de/job/PSDevLicensesDialog/) [![Coverage](https://sonar.psdev.de/api/project_badges/measure?project=de.psdev.licensesdialog&metric=coverage)](https://sonar.psdev.de/dashboard?id=de.psdev.licensesdialog) [![Lines of Code](https://sonar.psdev.de/api/project_badges/measure?project=de.psdev.licensesdialog&metric=ncloc)](https://sonar.psdev.de/dashboard?id=de.psdev.licensesdialog) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.psdev.licensesdialog/licensesdialog/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.psdev.licensesdialog/licensesdialog) 2 | ============== 3 | 4 | LicensesDialog is an open source library to display licenses of third-party libraries in an Android app. 5 | 6 | 7 | Download 8 | -------- 9 | 10 | Download [the latest Release][1] or grab via Maven: 11 | 12 | ```xml 13 | 14 | de.psdev.licensesdialog 15 | licensesdialog 16 | 2.1.0 17 | aar 18 | 19 | ``` 20 | or Gradle: 21 | ```groovy 22 | implementation 'de.psdev.licensesdialog:licensesdialog:2.1.0' 23 | ``` 24 | 25 | Usage 26 | ----- 27 | 28 | You can take a look at the [MainActivity.java](sample/src/main/java/de/psdev/licensesdialog/sample/MainActivity.java) 29 | from the sample module for examples on how to create the dialogs. 30 | 31 | Sample 32 | ------ 33 | 34 | You can get the latest sample from [Jenkins][3] 35 | 36 | Screenshot 37 | ---------- 38 | 39 | ![Screenshot](screenshot.png) 40 | 41 | Credits 42 | ------- 43 | 44 | This library is inspired by [Inscription][2]. 45 | 46 | Contributors 47 | ------------ 48 | 49 | Thank you to all the contributors of this project, namely: 50 | 51 | - [Peter Heisig](https://github.com/PSDev/LicensesDialog/commits?author=phdd) 52 | - [Jesus Otero](https://github.com/PSDev/LicensesDialog/commits?author=TheWizKid95) 53 | - [Scott Alexander-Bown](https://github.com/PSDev/LicensesDialog/commits?author=scottyab) 54 | - [barondem](https://github.com/PSDev/LicensesDialog/commits?author=barondem) 55 | - [Shaleen Jain](https://github.com/PSDev/LicensesDialog/commits?author=Shalzz) 56 | - [Zhang Hai](https://github.com/PSDev/LicensesDialog/commits?author=DreaminginCodeZH) 57 | - [Heinrich Reimer](https://github.com/PSDev/LicensesDialog/commits?author=HeinrichReimer) 58 | - [Juan Ramón González](https://github.com/PSDev/LicensesDialog/commits?author=jrgonzalezg) 59 | - [Taeho Kim](https://github.com/PSDev/LicensesDialog/commits?author=kunny) 60 | - [Nacho G. del Amo](https://github.com/PSDev/LicensesDialog/commits?author=ngdelamo) 61 | - [Tatsuya Arai](https://github.com/PSDev/LicensesDialog/commits?author=cutmail) 62 | - [Jakob Schrettenbrunner](https://github.com/PSDev/LicensesDialog/commits?author=schr3j) 63 | - [Sam Duke](https://github.com/PSDev/LicensesDialog/commits?author=samskiter) 64 | - [Kai Winter](https://github.com/PSDev/LicensesDialog/commits?author=kaiwinter) 65 | - [Oleg Kan](https://github.com/PSDev/LicensesDialog/commits?author=simplaapliko) 66 | - [Rafa Vázquez](https://github.com/PSDev/LicensesDialog/commits?author=Sloy) 67 | - [David Pintarič](https://github.com/PSDev/LicensesDialog/commits?author=dpint) 68 | - [Martin Herrmann](https://github.com/PSDev/LicensesDialog/commits?author=st0rmi) 69 | - [Chaos Leong](https://github.com/PSDev/LicensesDialog/commits?author=ChaosLeong) 70 | - [Vladyslav Pohrebniakov](https://github.com/PSDev/LicensesDialog/commits?author=personaljesusua) 71 | - [Chris Pick](https://github.com/PSDev/LicensesDialog/commits?author=chrispix99) 72 | - [Yuya Tanaka](https://github.com/PSDev/LicensesDialog/commits?author=ypresto) 73 | - [Minjae Seon](https://github.com/PSDev/LicensesDialog/commits?author=Aftermoon-dev) 74 | 75 | License 76 | ------- 77 | 78 | Copyright 2013 Philip Schiffer 79 | 80 | Licensed under the Apache License, Version 2.0 (the "License"); 81 | you may not use this file except in compliance with the License. 82 | You may obtain a copy of the License at 83 | 84 | http://www.apache.org/licenses/LICENSE-2.0 85 | 86 | Unless required by applicable law or agreed to in writing, software 87 | distributed under the License is distributed on an "AS IS" BASIS, 88 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 89 | See the License for the specific language governing permissions and 90 | limitations under the License. 91 | 92 | [1]: https://github.com/PSDev/LicensesDialog/releases 93 | [2]: https://github.com/MartinvanZ/Inscription 94 | [3]: https://ci.psdev.de/job/PSDevLicensesDialog/lastSuccessfulBuild/artifact/sample/build/outputs/apk/debug/ 95 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | // Plugin versions 4 | androidGradlePluginVersion = "4.2.1" 5 | gradleVersionsPluginVersion = "0.36.0" 6 | sonarqubeGradlePluginVersion = "3.2.0" 7 | // Dependency versions 8 | androidXAppCompatVersion = "1.2.0" 9 | androidXWebKitVersion = "1.4.0" 10 | androidXTestVersion = "1.3.0" 11 | junitVersion = "4.13.2" 12 | robolectricVersion = '4.5.1' 13 | } 14 | repositories { 15 | google() 16 | mavenCentral() 17 | jcenter() 18 | } 19 | dependencies { 20 | classpath "com.android.tools.build:gradle:$androidGradlePluginVersion" 21 | classpath "com.github.ben-manes:gradle-versions-plugin:$gradleVersionsPluginVersion" 22 | classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:$sonarqubeGradlePluginVersion" 23 | } 24 | } 25 | 26 | apply plugin: 'com.github.ben-manes.versions' 27 | 28 | allprojects { 29 | group "de.psdev.licensesdialog" 30 | version "2.3.0-SNAPSHOT" 31 | 32 | repositories { 33 | google() 34 | mavenCentral() 35 | jcenter() 36 | } 37 | 38 | apply from: rootProject.file('gradle/versioning.gradle') 39 | 40 | dependencyUpdates.resolutionStrategy { 41 | componentSelection { rules -> 42 | rules.all { ComponentSelection selection -> 43 | boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'preview', 'b', 'ea'].any { qualifier -> 44 | selection.candidate.version ==~ /(?i).*[.-]$qualifier[.\d-+]*/ 45 | } 46 | if (rejected) { 47 | selection.reject('Release candidate') 48 | } 49 | } 50 | } 51 | } 52 | } 53 | 54 | task clean(type: Delete) { 55 | delete rootProject.buildDir 56 | } 57 | 58 | wrapper { 59 | gradleVersion = '7.0.2' 60 | distributionType = "all" 61 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx2048m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | 19 | # Project info 20 | projectName=LicensesDialog 21 | projectDescription=LicensesDialog is an open source library to display licenses used by third-party libraries in an Android app. 22 | projectUrl=https://psdev.de/LicensesDialog 23 | projectInceptionYear=2013 24 | projectScmUrl=https://github.com/PSDev/LicensesDialog 25 | projectScmConnection=scm:git:git://github.com/PSDev/LicensesDialog.git 26 | projectScmDeveloperConnection=scm:git:git@github.com:PSDev/LicensesDialog.git 27 | projectDeveloperName=Philip Schiffer 28 | projectDeveloperEmail=philip.schiffer@gmail.com 29 | projectOrganizationName=PSDev 30 | projectOrganizationUrl=https://psdev.de 31 | projectLicesenseName=Apache License Version 2.0 32 | projectLicesenseUrl=http://www.apache.org/licenses/LICENSE-2.0.txt 33 | projectIssueManagementSystem=GitHub Issues 34 | projectIssueManagementUrl=https://github.com/PSDev/LicensesDialog/issues 35 | projectCiManagementSystem=Jenkins 36 | projectCiManagementUrl=https://ci.psdev.de/job/PSDevLicensesDialog 37 | 38 | 39 | # Android 40 | android.useAndroidX=true 41 | -------------------------------------------------------------------------------- /gradle/jacoco.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'jacoco' 2 | 3 | jacoco { 4 | toolVersion = "0.8.7" 5 | } 6 | 7 | android { 8 | testOptions { 9 | unitTests.all { 10 | jacoco { 11 | includeNoLocationClasses = true 12 | excludes = ['jdk.internal.*', 13 | '**/R.class', 14 | '**/R$*.class', 15 | '**/BuildConfig.*', 16 | '**/Manifest*.*', 17 | '**/*$Lambda$*.*', // Jacoco can not handle several "$" in class name. 18 | 'android/**/*.*' 19 | ] 20 | } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /gradle/publishMavenLocal.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'maven-publish' 2 | apply plugin: 'signing' 3 | 4 | project.afterEvaluate { 5 | task androidSourcesJar(type: Jar) { 6 | archiveClassifier.set('sources') 7 | from android.sourceSets.main.java.srcDirs 8 | } 9 | 10 | publishing { 11 | publications { 12 | release(MavenPublication) { final MavenPublication mavenPublication -> 13 | groupId project.group 14 | artifactId project.name 15 | version project.version 16 | 17 | from components.release 18 | artifact androidSourcesJar 19 | 20 | mavenPublication.pom { pom -> 21 | pom.name = projectName 22 | pom.description = projectDescription 23 | pom.url = projectUrl 24 | pom.inceptionYear = projectInceptionYear 25 | pom.scm { scm -> 26 | scm.url = projectScmUrl 27 | scm.connection = projectScmConnection 28 | scm.developerConnection = projectScmDeveloperConnection 29 | } 30 | pom.developers { 31 | developer { 32 | name = projectDeveloperName 33 | email = projectDeveloperEmail 34 | } 35 | } 36 | pom.organization { 37 | name = projectOrganizationName 38 | url = projectOrganizationUrl 39 | } 40 | pom.licenses { 41 | license { 42 | name = projectLicesenseName 43 | url = projectLicesenseUrl 44 | distribution = "repo" 45 | } 46 | } 47 | pom.issueManagement { 48 | system = projectIssueManagementSystem 49 | url = projectIssueManagementUrl 50 | } 51 | pom.ciManagement { 52 | system = projectCiManagementSystem 53 | url = projectCiManagementUrl 54 | } 55 | } 56 | } 57 | } 58 | repositories { 59 | maven { 60 | url "$rootProject.buildDir/m2repository" 61 | } 62 | maven { 63 | credentials { 64 | username rootProject.properties['sonatypeUsername'] 65 | password rootProject.properties['sonatypePassword'] 66 | } 67 | if (project.version.endsWith('-SNAPSHOT')) { 68 | url "https://oss.sonatype.org/content/repositories/snapshots/" 69 | } else { 70 | url "https://oss.sonatype.org/service/local/staging/deploy/maven2/" 71 | } 72 | } 73 | } 74 | } 75 | signing { 76 | useGpgCmd() 77 | sign publishing.publications 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /gradle/versioning.gradle: -------------------------------------------------------------------------------- 1 | import java.text.SimpleDateFormat 2 | 3 | ext { 4 | gitScmVersion = { 5 | final cmd = "git rev-parse --verify --short=7 HEAD" 6 | final proc = cmd.execute([], project.projectDir) 7 | proc.text.trim() 8 | } 9 | buildVersionCode = { 10 | def (major, minor, patch) = version.toString().toLowerCase().tokenize('.') 11 | patch = patch.replaceAll("[^0-9]", "") 12 | 13 | (major, minor, patch) = [major, minor, patch].collect { it.toInteger() } 14 | 15 | (major * 1000000) + (minor * 1000) + (patch); 16 | } 17 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSDev/LicensesDialog/24e1f9f7b8194b8435e16dc61e1e157026f7c2cc/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | 86 | # Determine the Java command to use to start the JVM. 87 | if [ -n "$JAVA_HOME" ] ; then 88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 89 | # IBM's JDK on AIX uses strange locations for the executables 90 | JAVACMD="$JAVA_HOME/jre/sh/java" 91 | else 92 | JAVACMD="$JAVA_HOME/bin/java" 93 | fi 94 | if [ ! -x "$JAVACMD" ] ; then 95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 96 | 97 | Please set the JAVA_HOME variable in your environment to match the 98 | location of your Java installation." 99 | fi 100 | else 101 | JAVACMD="java" 102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 103 | 104 | Please set the JAVA_HOME variable in your environment to match the 105 | location of your Java installation." 106 | fi 107 | 108 | # Increase the maximum file descriptors if we can. 109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 110 | MAX_FD_LIMIT=`ulimit -H -n` 111 | if [ $? -eq 0 ] ; then 112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 113 | MAX_FD="$MAX_FD_LIMIT" 114 | fi 115 | ulimit -n $MAX_FD 116 | if [ $? -ne 0 ] ; then 117 | warn "Could not set maximum file descriptor limit: $MAX_FD" 118 | fi 119 | else 120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 121 | fi 122 | fi 123 | 124 | # For Darwin, add options to specify how the application appears in the dock 125 | if $darwin; then 126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 127 | fi 128 | 129 | # For Cygwin or MSYS, switch paths to Windows format before running java 130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 | 134 | JAVACMD=`cygpath --unix "$JAVACMD"` 135 | 136 | # We build the pattern for arguments to be converted via cygpath 137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 138 | SEP="" 139 | for dir in $ROOTDIRSRAW ; do 140 | ROOTDIRS="$ROOTDIRS$SEP$dir" 141 | SEP="|" 142 | done 143 | OURCYGPATTERN="(^($ROOTDIRS))" 144 | # Add a user-defined pattern to the cygpath arguments 145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 147 | fi 148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 149 | i=0 150 | for arg in "$@" ; do 151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 153 | 154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 156 | else 157 | eval `echo args$i`="\"$arg\"" 158 | fi 159 | i=`expr $i + 1` 160 | done 161 | case $i in 162 | 0) set -- ;; 163 | 1) set -- "$args0" ;; 164 | 2) set -- "$args0" "$args1" ;; 165 | 3) set -- "$args0" "$args1" "$args2" ;; 166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 172 | esac 173 | fi 174 | 175 | # Escape application args 176 | save () { 177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 178 | echo " " 179 | } 180 | APP_ARGS=`save "$@"` 181 | 182 | # Collect all arguments for the java command, following the shell quoting and substitution rules 183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 184 | 185 | exec "$JAVACMD" "$@" 186 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /licensesdialog/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /licensesdialog/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: "org.sonarqube" 3 | apply from: rootProject.file('gradle/jacoco.gradle') 4 | 5 | project.description = "LicensesDialog (Library)" 6 | 7 | android { 8 | compileSdkVersion 30 9 | buildToolsVersion "30.0.3" 10 | 11 | defaultConfig { 12 | minSdkVersion 14 13 | targetSdkVersion 30 14 | 15 | versionName project.version 16 | versionCode buildVersionCode() 17 | 18 | buildConfigField 'String', 'GIT_SHA', "\"${gitScmVersion()}\"" 19 | } 20 | 21 | compileOptions { 22 | sourceCompatibility JavaVersion.VERSION_1_8 23 | targetCompatibility JavaVersion.VERSION_1_8 24 | } 25 | 26 | lintOptions { 27 | lintConfig rootProject.file('lint.xml') 28 | } 29 | 30 | testOptions { 31 | unitTests { 32 | includeAndroidResources = true 33 | } 34 | } 35 | 36 | buildTypes { 37 | release { 38 | minifyEnabled false 39 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 40 | } 41 | } 42 | } 43 | 44 | dependencies { 45 | // Testing 46 | testImplementation "junit:junit:$junitVersion" 47 | testImplementation "androidx.test:core:$androidXTestVersion" 48 | testImplementation "org.robolectric:robolectric:$robolectricVersion" 49 | 50 | // Android 51 | implementation "androidx.appcompat:appcompat:$androidXAppCompatVersion" 52 | implementation "androidx.webkit:webkit:$androidXWebKitVersion" 53 | } 54 | 55 | sonarqube { 56 | properties { 57 | property "sonar.projectKey", "$project.group" 58 | property "sonar.projectName", "LicensesDialog" 59 | property "sonar.exclusions", [].join(',') 60 | property "sonar.scm.provider", "git" 61 | property "sonar.android.lint.report", "build/reports/lint-results.xml" 62 | property "sonar.junit.reportPaths", "build/test-results/testDebugUnitTest" 63 | property "sonar.jacoco.reportPaths", "build/jacoco/testDebugUnitTest.exec" 64 | } 65 | } 66 | 67 | apply from: rootProject.file('gradle/publishMavenLocal.gradle') -------------------------------------------------------------------------------- /licensesdialog/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/LicenseResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog; 18 | 19 | import java.util.HashMap; 20 | import java.util.Map; 21 | 22 | import de.psdev.licensesdialog.licenses.ApacheSoftwareLicense20; 23 | import de.psdev.licensesdialog.licenses.BSD2ClauseLicense; 24 | import de.psdev.licensesdialog.licenses.BSD3ClauseLicense; 25 | import de.psdev.licensesdialog.licenses.CreativeCommonsAttribution30Unported; 26 | import de.psdev.licensesdialog.licenses.CreativeCommonsAttributionNoDerivs30Unported; 27 | import de.psdev.licensesdialog.licenses.EclipsePublicLicense10; 28 | import de.psdev.licensesdialog.licenses.GnuGeneralPublicLicense20; 29 | import de.psdev.licensesdialog.licenses.GnuGeneralPublicLicense30; 30 | import de.psdev.licensesdialog.licenses.GnuLesserGeneralPublicLicense21; 31 | import de.psdev.licensesdialog.licenses.GnuLesserGeneralPublicLicense3; 32 | import de.psdev.licensesdialog.licenses.ISCLicense; 33 | import de.psdev.licensesdialog.licenses.License; 34 | import de.psdev.licensesdialog.licenses.MITLicense; 35 | import de.psdev.licensesdialog.licenses.MozillaPublicLicense11; 36 | import de.psdev.licensesdialog.licenses.MozillaPublicLicense20; 37 | import de.psdev.licensesdialog.licenses.SILOpenFontLicense11; 38 | 39 | public final class LicenseResolver { 40 | 41 | private static final int INITIAL_LICENSES_COUNT = 4; 42 | private static final Map sLicenses = new HashMap<>(INITIAL_LICENSES_COUNT); 43 | 44 | static { 45 | registerDefaultLicenses(); 46 | } 47 | 48 | static void registerDefaultLicenses() { 49 | sLicenses.clear(); 50 | registerLicense(new ApacheSoftwareLicense20()); 51 | registerLicense(new BSD2ClauseLicense()); 52 | registerLicense(new BSD3ClauseLicense()); 53 | registerLicense(new ISCLicense()); 54 | registerLicense(new MITLicense()); 55 | registerLicense(new GnuLesserGeneralPublicLicense21()); 56 | registerLicense(new GnuLesserGeneralPublicLicense3()); 57 | registerLicense(new CreativeCommonsAttributionNoDerivs30Unported()); 58 | registerLicense(new GnuGeneralPublicLicense30()); 59 | registerLicense(new GnuGeneralPublicLicense20()); 60 | registerLicense(new MozillaPublicLicense11()); 61 | registerLicense(new SILOpenFontLicense11()); 62 | registerLicense(new MozillaPublicLicense20()); 63 | registerLicense(new CreativeCommonsAttribution30Unported()); 64 | registerLicense(new EclipsePublicLicense10()); 65 | } 66 | 67 | /** 68 | * Register an additional license. 69 | * 70 | * @param license the license to register 71 | */ 72 | public static void registerLicense(final License license) { 73 | sLicenses.put(license.getName(), license); 74 | } 75 | 76 | /** 77 | * Get a license by name 78 | * 79 | * @param license license name 80 | * @return License 81 | * @throws java.lang.IllegalStateException when unknown license is requested 82 | */ 83 | public static License read(final String license) { 84 | final String trimmedLicense = license.trim(); 85 | if (sLicenses.containsKey(trimmedLicense)) { 86 | return sLicenses.get(trimmedLicense); 87 | } else { 88 | throw new IllegalStateException(String.format("no such license available: %s, did you forget to register it?", trimmedLicense)); 89 | } 90 | } 91 | 92 | private LicenseResolver() { 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/NoticesHtmlBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog; 18 | 19 | import android.content.Context; 20 | 21 | import java.util.HashMap; 22 | import java.util.Map; 23 | 24 | import de.psdev.licensesdialog.licenses.License; 25 | import de.psdev.licensesdialog.model.Notice; 26 | import de.psdev.licensesdialog.model.Notices; 27 | 28 | public final class NoticesHtmlBuilder { 29 | 30 | private final Context mContext; 31 | private final Map mLicenseTextCache = new HashMap<>(); 32 | private Notices mNotices; 33 | private Notice mNotice; 34 | private String mStyle; 35 | private boolean mShowFullLicenseText; 36 | 37 | public static NoticesHtmlBuilder create(final Context context) { 38 | return new NoticesHtmlBuilder(context); 39 | } 40 | 41 | private NoticesHtmlBuilder(final Context context) { 42 | mContext = context; 43 | mStyle = context.getResources().getString(R.string.notices_default_style); 44 | mShowFullLicenseText = false; 45 | } 46 | 47 | public NoticesHtmlBuilder setNotices(final Notices notices) { 48 | mNotices = notices; 49 | mNotice = null; 50 | return this; 51 | } 52 | 53 | public NoticesHtmlBuilder setNotice(final Notice notice) { 54 | mNotice = notice; 55 | mNotices = null; 56 | return this; 57 | } 58 | 59 | public NoticesHtmlBuilder setStyle(final String style) { 60 | mStyle = style; 61 | return this; 62 | } 63 | 64 | public NoticesHtmlBuilder setShowFullLicenseText(final boolean showFullLicenseText) { 65 | mShowFullLicenseText = showFullLicenseText; 66 | return this; 67 | } 68 | 69 | public String build() { 70 | final StringBuilder noticesHtmlBuilder = new StringBuilder(500); 71 | appendNoticesContainerStart(noticesHtmlBuilder); 72 | if (mNotice != null) { 73 | appendNoticeBlock(noticesHtmlBuilder, mNotice); 74 | } else if (mNotices != null) { 75 | for (final Notice notice : mNotices.getNotices()) { 76 | appendNoticeBlock(noticesHtmlBuilder, notice); 77 | } 78 | } else { 79 | throw new IllegalStateException("no notice(s) set"); 80 | } 81 | appendNoticesContainerEnd(noticesHtmlBuilder); 82 | return noticesHtmlBuilder.toString(); 83 | } 84 | 85 | // 86 | 87 | private void appendNoticesContainerStart(final StringBuilder noticesHtmlBuilder) { 88 | noticesHtmlBuilder.append("") 89 | .append("") 90 | .append(""); 91 | } 92 | 93 | private void appendNoticeBlock(final StringBuilder noticesHtmlBuilder, final Notice notice) { 94 | noticesHtmlBuilder.append(""); 104 | noticesHtmlBuilder.append("
");
105 |         final String copyright = notice.getCopyright();
106 |         if (copyright != null) {
107 |             noticesHtmlBuilder.append(copyright).append("

"); 108 | } 109 | noticesHtmlBuilder.append(getLicenseText(notice.getLicense())).append("
"); 110 | } 111 | 112 | private void appendNoticesContainerEnd(final StringBuilder noticesHtmlBuilder) { 113 | noticesHtmlBuilder.append(""); 114 | } 115 | 116 | private String getLicenseText(final License license) { 117 | if (license != null) { 118 | if (!mLicenseTextCache.containsKey(license)) { 119 | mLicenseTextCache.put(license, mShowFullLicenseText ? license.getFullText(mContext) : license.getSummaryText(mContext)); 120 | } 121 | return mLicenseTextCache.get(license); 122 | } 123 | return ""; 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/NoticesXmlParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog; 18 | 19 | import android.util.Xml; 20 | 21 | import org.xmlpull.v1.XmlPullParser; 22 | import org.xmlpull.v1.XmlPullParserException; 23 | 24 | import java.io.IOException; 25 | import java.io.InputStream; 26 | 27 | import de.psdev.licensesdialog.licenses.License; 28 | import de.psdev.licensesdialog.model.Notice; 29 | import de.psdev.licensesdialog.model.Notices; 30 | 31 | public final class NoticesXmlParser { 32 | 33 | private NoticesXmlParser() { 34 | } 35 | 36 | public static Notices parse(final InputStream inputStream) throws Exception { 37 | try { 38 | final XmlPullParser parser = Xml.newPullParser(); 39 | parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false); 40 | parser.setInput(inputStream, null); 41 | parser.nextTag(); 42 | return parse(parser); 43 | } finally { 44 | inputStream.close(); 45 | } 46 | } 47 | 48 | private static Notices parse(final XmlPullParser parser) throws IOException, XmlPullParserException { 49 | final Notices notices = new Notices(); 50 | parser.require(XmlPullParser.START_TAG, null, "notices"); 51 | while (parser.next() != XmlPullParser.END_TAG) { 52 | if (parser.getEventType() != XmlPullParser.START_TAG) { 53 | continue; 54 | } 55 | final String name = parser.getName(); 56 | // Starts by looking for the entry tag 57 | if ("notice".equals(name)) { 58 | notices.addNotice(readNotice(parser)); 59 | } else { 60 | skip(parser); 61 | } 62 | } 63 | return notices; 64 | } 65 | 66 | private static Notice readNotice(final XmlPullParser parser) throws IOException, 67 | XmlPullParserException { 68 | parser.require(XmlPullParser.START_TAG, null, "notice"); 69 | String name = null; 70 | String url = null; 71 | String copyright = null; 72 | License license = null; 73 | while (parser.next() != XmlPullParser.END_TAG) { 74 | if (parser.getEventType() != XmlPullParser.START_TAG) { 75 | continue; 76 | } 77 | final String element = parser.getName(); 78 | if ("name".equals(element)) { 79 | name = readName(parser); 80 | } else if ("url".equals(element)) { 81 | url = readUrl(parser); 82 | } else if ("copyright".equals(element)) { 83 | copyright = readCopyright(parser); 84 | } else if ("license".equals(element)) { 85 | license = readLicense(parser); 86 | } else { 87 | skip(parser); 88 | } 89 | } 90 | return new Notice(name, url, copyright, license); 91 | } 92 | 93 | private static String readName(final XmlPullParser parser) throws IOException, XmlPullParserException { 94 | return readTag(parser, "name"); 95 | } 96 | 97 | private static String readUrl(final XmlPullParser parser) throws IOException, XmlPullParserException { 98 | return readTag(parser, "url"); 99 | } 100 | 101 | private static String readCopyright(final XmlPullParser parser) throws IOException, XmlPullParserException { 102 | return readTag(parser, "copyright"); 103 | } 104 | 105 | private static License readLicense(final XmlPullParser parser) throws IOException, XmlPullParserException { 106 | final String license = readTag(parser, "license"); 107 | return LicenseResolver.read(license); 108 | } 109 | 110 | private static String readTag(final XmlPullParser parser, final String tag) throws IOException, XmlPullParserException { 111 | parser.require(XmlPullParser.START_TAG, null, tag); 112 | final String title = readText(parser); 113 | parser.require(XmlPullParser.END_TAG, null, tag); 114 | return title; 115 | } 116 | 117 | private static String readText(final XmlPullParser parser) throws IOException, XmlPullParserException { 118 | String result = ""; 119 | if (parser.next() == XmlPullParser.TEXT) { 120 | result = parser.getText(); 121 | parser.nextTag(); 122 | } 123 | return result; 124 | } 125 | 126 | private static void skip(final XmlPullParser parser) throws XmlPullParserException, IOException { 127 | if (parser.getEventType() != XmlPullParser.START_TAG) { 128 | throw new IllegalStateException(); 129 | } 130 | int depth = 1; 131 | while (depth != 0) { 132 | switch (parser.next()) { 133 | case XmlPullParser.END_TAG: 134 | depth--; 135 | break; 136 | case XmlPullParser.START_TAG: 137 | depth++; 138 | break; 139 | } 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/ApacheSoftwareLicense20.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | 21 | import de.psdev.licensesdialog.R; 22 | 23 | public class ApacheSoftwareLicense20 extends License { 24 | 25 | private static final long serialVersionUID = 4854000061990891449L; 26 | 27 | @Override 28 | public String getName() { 29 | return "Apache Software License 2.0"; 30 | } 31 | 32 | @Override 33 | public String readSummaryTextFromResources(final Context context) { 34 | return getContent(context, R.raw.asl_20_summary); 35 | } 36 | 37 | @Override 38 | public String readFullTextFromResources(final Context context) { 39 | return getContent(context, R.raw.asl_20_full); 40 | } 41 | 42 | @Override 43 | public String getVersion() { 44 | return "2.0"; 45 | } 46 | 47 | @Override 48 | public String getUrl() { 49 | return "https://www.apache.org/licenses/LICENSE-2.0.txt"; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/BSD2ClauseLicense.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | import de.psdev.licensesdialog.R; 21 | 22 | public class BSD2ClauseLicense extends License { 23 | 24 | private static final long serialVersionUID = -5205394619884027401L; 25 | 26 | @Override 27 | public String getName() { 28 | return "BSD 2-Clause License"; 29 | } 30 | 31 | @Override 32 | public String readSummaryTextFromResources(final Context context) { 33 | return getContent(context, R.raw.bsd2_summary); 34 | } 35 | 36 | @Override 37 | public String readFullTextFromResources(final Context context) { 38 | return getContent(context, R.raw.bsd2_full); 39 | } 40 | 41 | @Override 42 | public String getVersion() { 43 | return ""; 44 | } 45 | 46 | @Override 47 | public String getUrl() { 48 | return "https://opensource.org/licenses/BSD-2-Clause"; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/BSD3ClauseLicense.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | import de.psdev.licensesdialog.R; 21 | 22 | public class BSD3ClauseLicense extends License { 23 | 24 | private static final long serialVersionUID = -5205394619884057474L; 25 | 26 | @Override 27 | public String getName() { 28 | return "BSD 3-Clause License"; 29 | } 30 | 31 | @Override 32 | public String readSummaryTextFromResources(final Context context) { 33 | return getContent(context, R.raw.bsd3_summary); 34 | } 35 | 36 | @Override 37 | public String readFullTextFromResources(final Context context) { 38 | return getContent(context, R.raw.bsd3_full); 39 | } 40 | 41 | @Override 42 | public String getVersion() { 43 | return ""; 44 | } 45 | 46 | @Override 47 | public String getUrl() { 48 | return "https://opensource.org/licenses/BSD-3-Clause"; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/CreativeCommonsAttribution30Unported.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Peter Heisig 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | import de.psdev.licensesdialog.R; 21 | 22 | public class CreativeCommonsAttribution30Unported extends License { 23 | 24 | private static final long serialVersionUID = -8244155573094118433L; 25 | 26 | @Override 27 | public String getName() { 28 | return "Creative Commons Attribution 3.0 Unported"; 29 | } 30 | 31 | @Override 32 | public String readSummaryTextFromResources(final Context context) { 33 | return getContent(context, R.raw.ccby_30_summary); 34 | } 35 | 36 | @Override 37 | public String readFullTextFromResources(final Context context) { 38 | return getContent(context, R.raw.ccby_30_full); 39 | } 40 | 41 | @Override 42 | public String getVersion() { 43 | return "3.0"; 44 | } 45 | 46 | @Override 47 | public String getUrl() { 48 | return "https://creativecommons.org/licenses/by/3.0/"; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/CreativeCommonsAttributionNoDerivs30Unported.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Peter Heisig 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | import de.psdev.licensesdialog.R; 21 | 22 | public class CreativeCommonsAttributionNoDerivs30Unported extends License { 23 | 24 | @Override 25 | public String getName() { 26 | return "Creative Commons Attribution-NoDerivs 3.0 Unported"; 27 | } 28 | 29 | @Override 30 | public String readSummaryTextFromResources(final Context context) { 31 | return getContent(context, R.raw.ccand_30_summary); 32 | } 33 | 34 | @Override 35 | public String readFullTextFromResources(final Context context) { 36 | return getContent(context, R.raw.ccand_30_full); 37 | } 38 | 39 | @Override 40 | public String getVersion() { 41 | return "3.0"; 42 | } 43 | 44 | @Override 45 | public String getUrl() { 46 | return "https://creativecommons.org/licenses/by-nd/3.0/"; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/CreativeCommonsAttributionShareAlike30Unported.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Peter Heisig 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | 21 | import de.psdev.licensesdialog.R; 22 | 23 | public class CreativeCommonsAttributionShareAlike30Unported extends License { 24 | 25 | private static final long serialVersionUID = -1221518691431383957L; 26 | 27 | @Override 28 | public String getName() { 29 | return "Creative Commons Attribution-Share Alike 3.0 Unported"; 30 | } 31 | 32 | @Override 33 | public String readSummaryTextFromResources(final Context context) { 34 | return getContent(context, R.raw.ccbysa_30_summary); 35 | } 36 | 37 | @Override 38 | public String readFullTextFromResources(final Context context) { 39 | return getContent(context, R.raw.ccbysa_30_full); 40 | } 41 | 42 | @Override 43 | public String getVersion() { 44 | return "3.0"; 45 | } 46 | 47 | @Override 48 | public String getUrl() { 49 | return "https://creativecommons.org/licenses/by-sa/3.0/"; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/EclipsePublicLicense10.java: -------------------------------------------------------------------------------- 1 | package de.psdev.licensesdialog.licenses; 2 | 3 | import android.content.Context; 4 | 5 | import de.psdev.licensesdialog.R; 6 | 7 | public class EclipsePublicLicense10 extends License { 8 | 9 | @Override 10 | public String getName() { 11 | return "Eclipse Public License 1.0"; 12 | } 13 | 14 | @Override 15 | public String readSummaryTextFromResources(Context context) { 16 | return getContent(context, R.raw.epl_v10_summary); 17 | } 18 | 19 | @Override 20 | public String readFullTextFromResources(Context context) { 21 | return getContent(context, R.raw.epl_v10_full); 22 | } 23 | 24 | @Override 25 | public String getVersion() { 26 | return "1.0"; 27 | } 28 | 29 | @Override 30 | public String getUrl() { 31 | return "https://www.eclipse.org/legal/epl-v10.html"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/GnuGeneralPublicLicense20.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Shaleen Jain 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | import de.psdev.licensesdialog.R; 21 | 22 | public class GnuGeneralPublicLicense20 extends License { 23 | 24 | @Override 25 | public String getName() { 26 | return "GNU General Public License 2.0"; 27 | } 28 | 29 | @Override 30 | public String readSummaryTextFromResources(final Context context) { 31 | return getContent(context, R.raw.gpl_20_summary); 32 | } 33 | 34 | @Override 35 | public String readFullTextFromResources(final Context context) { 36 | return getContent(context, R.raw.gpl_20_full); 37 | } 38 | 39 | @Override 40 | public String getVersion() { 41 | return "2.0"; 42 | } 43 | 44 | @Override 45 | public String getUrl() { 46 | return "https://www.gnu.org/licenses/"; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/GnuGeneralPublicLicense30.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Shaleen Jain 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | import de.psdev.licensesdialog.R; 21 | 22 | public class GnuGeneralPublicLicense30 extends License { 23 | 24 | @Override 25 | public String getName() { 26 | return "GNU General Public License 3.0"; 27 | } 28 | 29 | @Override 30 | public String readSummaryTextFromResources(final Context context) { 31 | return getContent(context, R.raw.gpl_30_summary); 32 | } 33 | 34 | @Override 35 | public String readFullTextFromResources(final Context context) { 36 | return getContent(context, R.raw.gpl_30_full); 37 | } 38 | 39 | @Override 40 | public String getVersion() { 41 | return "3.0"; 42 | } 43 | 44 | @Override 45 | public String getUrl() { 46 | return "https://www.gnu.org/licenses/"; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/GnuLesserGeneralPublicLicense21.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Peter Heisig 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | import de.psdev.licensesdialog.R; 21 | 22 | 23 | public class GnuLesserGeneralPublicLicense21 extends License { 24 | 25 | @Override 26 | public String getName() { 27 | return "GNU Lesser General Public License 2.1"; 28 | } 29 | 30 | @Override 31 | public String readSummaryTextFromResources(final Context context) { 32 | return getContent(context, R.raw.lgpl_21_summary); 33 | } 34 | 35 | @Override 36 | public String readFullTextFromResources(final Context context) { 37 | return getContent(context, R.raw.lgpl_21_full); 38 | } 39 | 40 | @Override 41 | public String getVersion() { 42 | return "2.1"; 43 | } 44 | 45 | @Override 46 | public String getUrl() { 47 | return "https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html"; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/GnuLesserGeneralPublicLicense3.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Jakob Schrettenbrunner 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | 21 | import de.psdev.licensesdialog.R; 22 | 23 | 24 | public class GnuLesserGeneralPublicLicense3 extends License { 25 | 26 | @Override 27 | public String getName() { 28 | return "GNU Lesser General Public License 3"; 29 | } 30 | 31 | @Override 32 | public String readSummaryTextFromResources(final Context context) { 33 | return getContent(context, R.raw.lgpl_3_summary); 34 | } 35 | 36 | @Override 37 | public String readFullTextFromResources(final Context context) { 38 | return getContent(context, R.raw.lgpl_3_full); 39 | } 40 | 41 | @Override 42 | public String getVersion() { 43 | return "3"; 44 | } 45 | 46 | @Override 47 | public String getUrl() { 48 | return "https://www.gnu.org/licenses/lgpl.html"; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/ISCLicense.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | import de.psdev.licensesdialog.R; 21 | 22 | public class ISCLicense extends License { 23 | private static final long serialVersionUID = -4636435634132169860L; 24 | 25 | @Override 26 | public String getName() { 27 | return "ISC License"; 28 | } 29 | 30 | @Override 31 | public String readSummaryTextFromResources(final Context context) { 32 | return getContent(context, R.raw.isc_summary); 33 | } 34 | 35 | @Override 36 | public String readFullTextFromResources(final Context context) { 37 | return getContent(context, R.raw.isc_full); 38 | } 39 | 40 | @Override 41 | public String getVersion() { 42 | return ""; 43 | } 44 | 45 | @Override 46 | public String getUrl() { 47 | return "https://opensource.org/licenses/isc-license.txt"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/License.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | 21 | import java.io.BufferedReader; 22 | import java.io.IOException; 23 | import java.io.InputStreamReader; 24 | import java.io.Serializable; 25 | 26 | public abstract class License implements Serializable { 27 | 28 | private static final long serialVersionUID = 3100331505738956523L; 29 | private static final String LINE_SEPARATOR = System.getProperty("line.separator"); 30 | 31 | private String mCachedSummaryText = null; 32 | private String mCachedFullText = null; 33 | 34 | public abstract String getName(); 35 | 36 | public abstract String readSummaryTextFromResources(final Context context); 37 | 38 | public abstract String readFullTextFromResources(final Context context); 39 | 40 | public abstract String getVersion(); 41 | 42 | public abstract String getUrl(); 43 | 44 | // 45 | 46 | public final String getSummaryText(final Context context) { 47 | if (mCachedSummaryText == null) { 48 | mCachedSummaryText = readSummaryTextFromResources(context); 49 | } 50 | 51 | return mCachedSummaryText; 52 | } 53 | 54 | public final String getFullText(final Context context) { 55 | if (mCachedFullText == null) { 56 | mCachedFullText = readFullTextFromResources(context); 57 | } 58 | 59 | return mCachedFullText; 60 | } 61 | 62 | protected String getContent(final Context context, final int contentResourceId) { 63 | try (final BufferedReader reader = new BufferedReader(new InputStreamReader(context.getResources().openRawResource(contentResourceId), "UTF-8"))) { 64 | return toString(reader); 65 | } catch (final IOException e) { 66 | throw new IllegalStateException(e); 67 | } 68 | } 69 | 70 | private String toString(final BufferedReader reader) throws IOException { 71 | final StringBuilder builder = new StringBuilder(); 72 | String line; 73 | while ((line = reader.readLine()) != null) { 74 | builder.append(line).append(LINE_SEPARATOR); 75 | } 76 | return builder.toString(); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/MITLicense.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | import de.psdev.licensesdialog.R; 21 | 22 | public class MITLicense extends License { 23 | 24 | private static final long serialVersionUID = 5673599951781482594L; 25 | 26 | @Override 27 | public String getName() { 28 | return "MIT License"; 29 | } 30 | 31 | @Override 32 | public String readSummaryTextFromResources(final Context context) { 33 | return getContent(context, R.raw.mit_summary); 34 | } 35 | 36 | @Override 37 | public String readFullTextFromResources(final Context context) { 38 | return getContent(context, R.raw.mit_full); 39 | } 40 | 41 | @Override 42 | public String getVersion() { 43 | return ""; 44 | } 45 | 46 | @Override 47 | public String getUrl() { 48 | return "https://opensource.org/licenses/MIT"; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/MozillaPublicLicense11.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | 21 | import de.psdev.licensesdialog.R; 22 | 23 | public class MozillaPublicLicense11 extends License { 24 | 25 | private static final long serialVersionUID = -5912500033007492703L; 26 | 27 | @Override 28 | public String getName() { 29 | return "Mozilla Public License 1.1"; 30 | } 31 | 32 | @Override 33 | public String readSummaryTextFromResources(final Context context) { 34 | return getContent(context, R.raw.mpl_11_summary); 35 | } 36 | 37 | @Override 38 | public String readFullTextFromResources(final Context context) { 39 | return getContent(context, R.raw.mpl_11_full); 40 | } 41 | 42 | @Override 43 | public String getVersion() { 44 | return "1.1"; 45 | } 46 | 47 | @Override 48 | public String getUrl() { 49 | return "https://mozilla.org/MPL/1.1/"; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/MozillaPublicLicense20.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | 21 | import de.psdev.licensesdialog.R; 22 | 23 | public class MozillaPublicLicense20 extends License { 24 | 25 | @Override 26 | public String getName() { 27 | return "Mozilla Public License 2.0"; 28 | } 29 | 30 | @Override 31 | public String readSummaryTextFromResources(final Context context) { 32 | return getContent(context, R.raw.mpl_20_summary); 33 | } 34 | 35 | @Override 36 | public String readFullTextFromResources(final Context context) { 37 | return getContent(context, R.raw.mpl_20_full); 38 | } 39 | 40 | @Override 41 | public String getVersion() { 42 | return "2.0"; 43 | } 44 | 45 | @Override 46 | public String getUrl() { 47 | return "https://mozilla.org/MPL/2.0/"; 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/licenses/SILOpenFontLicense11.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.licenses; 18 | 19 | import android.content.Context; 20 | 21 | import de.psdev.licensesdialog.R; 22 | 23 | public class SILOpenFontLicense11 extends License { 24 | 25 | @Override 26 | public String getName() { 27 | return "SIL Open Font License v1.1"; 28 | } 29 | 30 | @Override 31 | public String readSummaryTextFromResources(final Context context) { 32 | return getContent(context, R.raw.sil_ofl_11_summary); 33 | } 34 | 35 | @Override 36 | public String readFullTextFromResources(final Context context) { 37 | return getContent(context, R.raw.sil_ofl_11_full); 38 | } 39 | 40 | @Override 41 | public String getVersion() { 42 | return "1.1"; 43 | } 44 | 45 | @Override 46 | public String getUrl() { 47 | return "https://opensource.org/licenses/OFL-1.1"; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/model/Notice.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.model; 18 | 19 | import android.os.Parcel; 20 | import android.os.Parcelable; 21 | import de.psdev.licensesdialog.licenses.License; 22 | 23 | public class Notice implements Parcelable { 24 | 25 | private String mName; 26 | private String mUrl; 27 | private String mCopyright; 28 | private License mLicense; 29 | 30 | // 31 | 32 | public Notice() { 33 | } 34 | 35 | public Notice(final String name, final String url, final String copyright, final License license) { 36 | mName = name; 37 | mUrl = url; 38 | mCopyright = copyright; 39 | mLicense = license; 40 | } 41 | 42 | // Setter / Getter 43 | 44 | public void setName(final String name) { 45 | mName = name; 46 | } 47 | 48 | public void setUrl(final String url) { 49 | mUrl = url; 50 | } 51 | 52 | public void setCopyright(final String copyright) { 53 | mCopyright = copyright; 54 | } 55 | 56 | public void setLicense(final License license) { 57 | mLicense = license; 58 | } 59 | 60 | public String getName() { 61 | return mName; 62 | } 63 | 64 | public String getUrl() { 65 | return mUrl; 66 | } 67 | 68 | public String getCopyright() { 69 | return mCopyright; 70 | } 71 | 72 | public License getLicense() { 73 | return mLicense; 74 | } 75 | 76 | // Parcelable 77 | 78 | protected Notice(final Parcel in) { 79 | mName = in.readString(); 80 | mUrl = in.readString(); 81 | mCopyright = in.readString(); 82 | } 83 | 84 | @Override 85 | public void writeToParcel(final Parcel dest, final int flags) { 86 | dest.writeString(mName); 87 | dest.writeString(mUrl); 88 | dest.writeString(mCopyright); 89 | } 90 | 91 | @Override 92 | public int describeContents() { 93 | return 0; 94 | } 95 | 96 | public static final Creator CREATOR = new Creator() { 97 | @Override 98 | public Notice createFromParcel(final Parcel in) { 99 | return new Notice(in); 100 | } 101 | 102 | @Override 103 | public Notice[] newArray(final int size) { 104 | return new Notice[size]; 105 | } 106 | }; 107 | 108 | } 109 | -------------------------------------------------------------------------------- /licensesdialog/src/main/java/de/psdev/licensesdialog/model/Notices.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.model; 18 | 19 | import android.os.Parcel; 20 | import android.os.Parcelable; 21 | 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | public class Notices implements Parcelable { 26 | 27 | private final List mNotices; 28 | 29 | public Notices() { 30 | mNotices = new ArrayList<>(); 31 | } 32 | 33 | // Setter / Getter 34 | 35 | public void addNotice(final Notice notice) { 36 | mNotices.add(notice); 37 | } 38 | 39 | public List getNotices() { 40 | return mNotices; 41 | } 42 | 43 | // Parcelable 44 | 45 | protected Notices(final Parcel in) { 46 | mNotices = in.createTypedArrayList(Notice.CREATOR); 47 | } 48 | 49 | @Override 50 | public void writeToParcel(final Parcel dest, final int flags) { 51 | dest.writeTypedList(mNotices); 52 | } 53 | 54 | @Override 55 | public int describeContents() { 56 | return 0; 57 | } 58 | 59 | public static final Creator CREATOR = new Creator() { 60 | @Override 61 | public Notices createFromParcel(final Parcel in) { 62 | return new Notices(in); 63 | } 64 | 65 | @Override 66 | public Notices[] newArray(final int size) { 67 | return new Notices[size]; 68 | } 69 | }; 70 | 71 | } 72 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/asl_20_full.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/asl_20_summary.txt: -------------------------------------------------------------------------------- 1 | Licensed under the Apache License, Version 2.0 (the "License"); 2 | you may not use this file except in compliance with the License. 3 | You may obtain a copy of the License at 4 | 5 | http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/bsd2_full.txt: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 2 | 3 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 4 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 5 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/bsd2_summary.txt: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 2 | 3 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 4 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/bsd3_full.txt: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 2 | 3 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 4 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 5 | Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/bsd3_summary.txt: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 2 | 3 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 4 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 5 | Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/ccand_30_summary.txt: -------------------------------------------------------------------------------- 1 | You are free to: 2 | 3 | Share - copy and redistribute the material in any medium or format for any purpose, even commercially. 4 | The licensor cannot revoke these freedoms as long as you follow the license terms. 5 | 6 | Under the following terms: 7 | 8 | Attribution - You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. 9 | NoDerivatives - If you remix, transform, or build upon the material, you may not distribute the modified material. 10 | 11 | No additional restrictions - You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. 12 | 13 | Notices: 14 | 15 | You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation. 16 | No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/ccby_30_summary.txt: -------------------------------------------------------------------------------- 1 | You are free to: 2 | 3 | Share — copy and redistribute the material in any medium or format 4 | Adapt — remix, transform, and build upon the material for any purpose, even commercially. 5 | The licensor cannot revoke these freedoms as long as you follow the license terms. 6 | 7 | Under the following terms: 8 | 9 | Attribution - You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. 10 | 11 | No additional restrictions - You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. 12 | 13 | Notices: 14 | 15 | You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation. 16 | No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material. 17 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/ccbysa_30_summary.txt: -------------------------------------------------------------------------------- 1 | You are free to: 2 | 3 | Share — copy and redistribute the material in any medium or format 4 | Adapt — remix, transform, and build upon the material for any purpose, even commercially. 5 | The licensor cannot revoke these freedoms as long as you follow the license terms. 6 | 7 | Under the following terms: 8 | 9 | Attribution - You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. 10 | ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. 11 | 12 | No additional restrictions - You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. 13 | 14 | Notices: 15 | 16 | You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation. 17 | No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/epl_v10_full.txt: -------------------------------------------------------------------------------- 1 | Eclipse Public License - v 1.0 2 | 3 | THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 4 | 5 | 1. DEFINITIONS 6 | 7 | "Contribution" means: 8 | 9 | a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and 10 | b) in the case of each subsequent Contributor: 11 | i) changes to the Program, and 12 | ii) additions to the Program; 13 | where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. 14 | "Contributor" means any person or entity that distributes the Program. 15 | 16 | "Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. 17 | 18 | "Program" means the Contributions distributed in accordance with this Agreement. 19 | 20 | "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. 21 | 22 | 2. GRANT OF RIGHTS 23 | 24 | a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. 25 | b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. 26 | c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. 27 | d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. 28 | 3. REQUIREMENTS 29 | 30 | A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: 31 | 32 | a) it complies with the terms and conditions of this Agreement; and 33 | b) its license agreement: 34 | i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; 35 | ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; 36 | iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and 37 | iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. 38 | When the Program is made available in source code form: 39 | 40 | a) it must be made available under this Agreement; and 41 | b) a copy of this Agreement must be included with each copy of the Program. 42 | Contributors may not remove or alter any copyright notices contained within the Program. 43 | 44 | Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. 45 | 46 | 4. COMMERCIAL DISTRIBUTION 47 | 48 | Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. 49 | 50 | For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. 51 | 52 | 5. NO WARRANTY 53 | 54 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. 55 | 56 | 6. DISCLAIMER OF LIABILITY 57 | 58 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 59 | 60 | 7. GENERAL 61 | 62 | If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. 63 | 64 | If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. 65 | 66 | All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. 67 | 68 | Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. 69 | 70 | This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/epl_v10_summary.txt: -------------------------------------------------------------------------------- 1 | This license, made and used by the Eclipse Foundation, is similar to GPL but allows you to link code under the license to proprietary applications. You may also license binaries under a proprietary license, as long as the source code is available under EPL. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/gpl_20_summary.txt: -------------------------------------------------------------------------------- 1 | This program is free software; you can redistribute it and/or 2 | modify it under the terms of the GNU General Public License 3 | as published by the Free Software Foundation; either version 2 4 | of the License, or (at your option) any later version. 5 | 6 | This program is distributed in the hope that it will be useful, 7 | but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | GNU General Public License for more details. 10 | 11 | You should have received a copy of the GNU General Public License 12 | along with this program; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 14 | 15 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/gpl_30_summary.txt: -------------------------------------------------------------------------------- 1 | This program is free software: you can redistribute it and/or modify 2 | it under the terms of the GNU General Public License as published by 3 | the Free Software Foundation, either version 3 of the License, or 4 | (at your option) any later version. 5 | 6 | This program is distributed in the hope that it will be useful, 7 | but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | GNU General Public License for more details. 10 | 11 | You should have received a copy of the GNU General Public License 12 | along with this program. If not, see . 13 | 14 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/isc_full.txt: -------------------------------------------------------------------------------- 1 | Permission to use, copy, modify, and/or distribute this software for 2 | any purpose with or without fee is hereby granted, provided that this 3 | permission notice appear in all copies. 4 | 5 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 6 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 7 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 8 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 9 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 10 | OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 11 | PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/isc_summary.txt: -------------------------------------------------------------------------------- 1 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that this permission notice appear in all copies. 2 | 3 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 4 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/lgpl_21_summary.txt: -------------------------------------------------------------------------------- 1 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. 2 | 3 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 4 | 5 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/lgpl_3_full.txt: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/lgpl_3_summary.txt: -------------------------------------------------------------------------------- 1 | This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. 2 | 3 | This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 4 | 5 | You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/mit_full.txt: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 2 | 3 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 4 | 5 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/mit_summary.txt: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 2 | 3 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 4 | 5 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/mpl_11_summary.txt: -------------------------------------------------------------------------------- 1 | This Source Code Form is subject to the terms of the Mozilla Public 2 | License, v. 1.1. If a copy of the MPL was not distributed with this 3 | file, You can obtain one at http://mozilla.org/MPL/1.1/. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/mpl_20_summary.txt: -------------------------------------------------------------------------------- 1 | This Source Code Form is subject to the terms of the Mozilla Public 2 | License, v. 2.0. If a copy of the MPL was not distributed with this 3 | file, You can obtain one at http://mozilla.org/MPL/2.0/. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/notices.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | Apache Commons IO 21 | http://commons.apache.org/io/ 22 | Copyright 2002-2012 The Apache Software Foundation 23 | Apache Software License 2.0 24 | 25 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/sil_ofl_11_full.txt: -------------------------------------------------------------------------------- 1 | SIL OPEN FONT LICENSE 2 | 3 | Version 1.1 - 26 February 2007 4 | 5 | PREAMBLE The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. 6 | 7 | The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. 8 | 9 | DEFINITIONS "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. 10 | 11 | "Reserved Font Name" refers to any names specified as such after the copyright statement(s). 12 | 13 | "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). 14 | 15 | "Modified Version" refers to any derivative made by adding to, deleting, or substituting — in part or in whole — any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. 16 | 17 | "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. 18 | 19 | PERMISSION & CONDITIONS Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 20 | 21 | 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. 22 | 23 | 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 24 | 25 | 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. 26 | 27 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. 28 | 29 | 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. 30 | 31 | TERMINATION This license becomes null and void if any of the above conditions are not met. 32 | 33 | DISCLAIMER THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/raw/sil_ofl_11_summary.txt: -------------------------------------------------------------------------------- 1 | OFL is used by almost all libre fonts. Selling fonts by themselves is not allowed, but bundling with software or selling font design services is allowed. Font names must usually be changed before making any modifications. Document embedding is allowed. -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-bg/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Уведомления 20 | Затваряне 21 | 22 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-cs/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Dokumenty 20 | Zavřít 21 | 22 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-de/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Anmerkungen 20 | Schließen 21 | 22 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-el/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Νομικές σημειώσεις 20 | Κλείσιμο 21 | 22 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-es/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Avisos 20 | Cerrar 21 | 22 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-fr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Avis 20 | Fermer 21 | 22 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-hu/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Figyelmeztetések 20 | Bezárás 21 | 22 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-it/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Avvisi 20 | Chiudi 21 | 22 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-ja/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | オープンソースライセンス 20 | 閉じる 21 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-ko/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 오픈소스 라이선스 20 | 닫기 21 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-pl/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Powiadomienia 20 | Zamknij 21 | 22 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-pt/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Avisos 20 | Fechar 21 | 22 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-ro/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Anunțuri 20 | Închide 21 | 22 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-ru/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Лицензии открытого ПО 20 | Закрыть 21 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-tr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Bildirimler 20 | Kapat 21 | 22 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-uk/strings.xml: -------------------------------------------------------------------------------- 1 |  2 | 17 | 18 | 19 | Ліцензії відкритого коду 20 | Закрити 21 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-zh-rCN/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 开放源代码许可 20 | 关闭 21 | 22 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values-zh-rTW/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 開放原始碼授權 20 | 關閉 21 | 22 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values/base_html.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | p.license { 21 | background:grey; 22 | } 23 | body { 24 | font-family: sans-serif; 25 | overflow-wrap: break-word; 26 | } 27 | pre { 28 | background-color: #eeeeee; 29 | padding: 1em; 30 | white-space: pre-wrap; 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /licensesdialog/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Notices 20 | Close 21 | -------------------------------------------------------------------------------- /licensesdialog/src/test/java/de/psdev/licensesdialog/LicenseResolverTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog; 18 | 19 | import android.content.Context; 20 | 21 | import org.junit.Before; 22 | import org.junit.Test; 23 | 24 | import de.psdev.licensesdialog.licenses.License; 25 | 26 | import static org.junit.Assert.assertEquals; 27 | import static org.junit.Assert.assertNotNull; 28 | 29 | public class LicenseResolverTest { 30 | 31 | private static final String TEST_LICENSE_NAME = "TestLicense"; 32 | 33 | @Before 34 | public void setUp() throws Exception { 35 | LicenseResolver.registerDefaultLicenses(); 36 | } 37 | 38 | @Test 39 | public void testRegisterLicense() throws Exception { 40 | LicenseResolver.registerLicense(new TestLicense()); 41 | final License license = LicenseResolver.read(TEST_LICENSE_NAME); 42 | assertNotNull(license); 43 | assertEquals(TEST_LICENSE_NAME, license.getName()); 44 | } 45 | 46 | @Test(expected = IllegalStateException.class) 47 | public void testReadUnknownLicense() throws Exception { 48 | LicenseResolver.read(TEST_LICENSE_NAME); 49 | } 50 | 51 | @Test 52 | public void testReadKnownLicense() throws Exception { 53 | final License license = LicenseResolver.read("MIT License"); 54 | assertNotNull(license); 55 | assertEquals("MIT License", license.getName()); 56 | } 57 | 58 | // Inner classes 59 | 60 | private static class TestLicense extends License { 61 | 62 | @Override 63 | public String getName() { 64 | return TEST_LICENSE_NAME; 65 | } 66 | 67 | @Override 68 | public String readSummaryTextFromResources(final Context context) { 69 | return "Testing license"; 70 | } 71 | 72 | @Override 73 | public String readFullTextFromResources(final Context context) { 74 | return "Full testing license"; 75 | } 76 | 77 | @Override 78 | public String getVersion() { 79 | return "1.0"; 80 | } 81 | 82 | @Override 83 | public String getUrl() { 84 | return "http://example.org"; 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /licensesdialog/src/test/java/de/psdev/licensesdialog/NoticesXmlParserTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog; 18 | 19 | import org.junit.Test; 20 | import org.junit.runner.RunWith; 21 | import org.robolectric.RobolectricTestRunner; 22 | import org.robolectric.RuntimeEnvironment; 23 | import org.robolectric.annotation.Config; 24 | 25 | import static org.junit.Assert.assertNotNull; 26 | 27 | @RunWith(RobolectricTestRunner.class) 28 | @Config(sdk = Config.ALL_SDKS) 29 | public class NoticesXmlParserTest { 30 | 31 | @Test 32 | public void testParse() throws Exception { 33 | assertNotNull(NoticesXmlParser.parse(RuntimeEnvironment.application.getResources().openRawResource(R.raw.notices))); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /licensesdialog/src/test/res/raw/notices.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | ActionBarSherlock 20 | http://actionbarsherlock.com/ 21 | Copyright 2012 Jake Wharton 22 | Apache Software License 2.0 23 | 24 | 25 | RoboGuice 2.0 26 | http://roboguice.org 27 | 28 | Apache Software License 2.0 29 | 30 | 31 | Application Crash Reporting for Android (ACRA) 32 | http://acra.ch/ 33 | Copyright 2010 Emmanuel Astier & Kevin Gaudin 34 | Apache Software License 2.0 35 | 36 | 37 | Android ViewPagerIndicator 38 | http://viewpagerindicator.com/ 39 | Copyright (C) 2011 The Android Open Source Project<br/>Copyright (C) 2012 Jake Wharton 40 | Apache Software License 2.0 41 | 42 | 43 | Nine Old Androids 44 | http://nineoldandroids.com/ 45 | Copyright (C) 2010 The Android Open Source Project 46 | Apache Software License 2.0 47 | 48 | 49 | Crouton 50 | https://github.com/keyboardsurfer/Crouton 51 | Copyright 2012 Benjamin Weiss<br/>Copyright 2012 Neofonie Mobile GmbH 52 | Apache Software License 2.0 53 | 54 | 55 | Jackson JSON-processor 56 | http://jackson.codehaus.org/ 57 | 58 | Apache Software License 2.0 59 | 60 | 61 | OrmLite 62 | http://ormlite.com/ 63 | Copyright Gray Watson 64 | ISC License 65 | 66 | 67 | Apache Commons IO 68 | http://commons.apache.org/io/ 69 | Copyright 2002-2012 The Apache Software Foundation 70 | Apache Software License 2.0 71 | 72 | 73 | Apache Commons Lang 74 | http://commons.apache.org/lang/ 75 | Copyright 2002-2011 The Apache Software Foundation 76 | Apache Software License 2.0 77 | 78 | 79 | Joda Time 80 | http://joda-time.sourceforge.net/ 81 | Copyright 2001-2005 Stephen Colebourne 82 | Apache Software License 2.0 83 | 84 | 85 | StickyListHeaders 86 | https://github.com/emilsjolander/StickyListHeaders 87 | Copyright 2012 Emil Sjölander 88 | Apache Software License 2.0 89 | 90 | 91 | DiskLruCache 92 | https://github.com/JakeWharton/DiskLruCache 93 | Copyright (C) 2011 The Android Open Source Project<br/>Copyright 2012 Jake Wharton 94 | Apache Software License 2.0 95 | 96 | 97 | Google Guava 98 | http://code.google.com/p/guava-libraries/ 99 | Copyright (C) 2007 The Guava Authors 100 | Apache Software License 2.0 101 | 102 | 103 | PhotoView 104 | https://github.com/chrisbanes/PhotoView 105 | Copyright 2011, 2012 Chris Banes. 106 | Apache Software License 2.0 107 | 108 | 109 | Inscription 110 | https://github.com/MartinvanZ/Inscription 111 | (c) 2012 Martin van Zuilekom (http://martin.cubeactive.com) 112 | Apache Software License 2.0 113 | 114 | 115 | Cool Project with BSD 3-Clause License 116 | http://example3.com 117 | Author of Cool Project with BSD 3-Clause License 118 | BSD 3-Clause License 119 | 120 | 121 | Cool Project with BSD 2-Clause License 122 | http://example2.com 123 | Author of Cool Project with BSD 2-Clause License 124 | BSD 2-Clause License 125 | 126 | -------------------------------------------------------------------------------- /lint.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /sample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /sample/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 30 5 | buildToolsVersion "30.0.3" 6 | 7 | defaultConfig { 8 | applicationId 'de.psdev.licensesdialog.sample' 9 | minSdkVersion 14 10 | targetSdkVersion 30 11 | 12 | versionName project.version 13 | versionCode buildVersionCode() 14 | 15 | buildConfigField 'String', 'GIT_SHA', "\"${gitScmVersion()}\"" 16 | } 17 | 18 | compileOptions { 19 | sourceCompatibility JavaVersion.VERSION_1_8 20 | targetCompatibility JavaVersion.VERSION_1_8 21 | } 22 | 23 | lintOptions { 24 | lintConfig rootProject.file('lint.xml') 25 | } 26 | 27 | buildTypes { 28 | release { 29 | minifyEnabled false 30 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 31 | } 32 | } 33 | } 34 | 35 | dependencies { 36 | implementation project(':licensesdialog') 37 | 38 | implementation "androidx.appcompat:appcompat:$androidXAppCompatVersion" 39 | } 40 | -------------------------------------------------------------------------------- /sample/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 20 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /sample/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSDev/LicensesDialog/24e1f9f7b8194b8435e16dc61e1e157026f7c2cc/sample/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /sample/src/main/java/de/psdev/licensesdialog/sample/MainActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Philip Schiffer 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package de.psdev.licensesdialog.sample; 18 | 19 | import android.graphics.Color; 20 | import android.os.Bundle; 21 | import android.view.View; 22 | import androidx.annotation.ColorInt; 23 | import androidx.appcompat.app.AppCompatActivity; 24 | 25 | import de.psdev.licensesdialog.LicensesDialog; 26 | import de.psdev.licensesdialog.LicensesDialogFragment; 27 | import de.psdev.licensesdialog.licenses.ApacheSoftwareLicense20; 28 | import de.psdev.licensesdialog.licenses.GnuLesserGeneralPublicLicense21; 29 | import de.psdev.licensesdialog.licenses.License; 30 | import de.psdev.licensesdialog.model.Notice; 31 | import de.psdev.licensesdialog.model.Notices; 32 | 33 | public class MainActivity extends AppCompatActivity { 34 | 35 | // ========================================================================================================================== 36 | // Android Lifecycle 37 | // ========================================================================================================================== 38 | 39 | public void onCreate(final Bundle savedInstanceState) { 40 | super.onCreate(savedInstanceState); 41 | setContentView(R.layout.activity_main); 42 | } 43 | 44 | // ========================================================================================================================== 45 | // Public API 46 | // ========================================================================================================================== 47 | 48 | public void onSingleClick(final View view) { 49 | final String name = "LicensesDialog"; 50 | final String url = "http://psdev.de"; 51 | final String copyright = "Copyright 2013 Philip Schiffer "; 52 | final License license = new ApacheSoftwareLicense20(); 53 | final Notice notice = new Notice(name, url, copyright, license); 54 | new LicensesDialog.Builder(this) 55 | .setNotices(notice) 56 | .build() 57 | .show(); 58 | } 59 | 60 | public void onMultipleClick(final View view) { 61 | new LicensesDialog.Builder(this) 62 | .setNotices(R.raw.notices) 63 | .build() 64 | .show(); 65 | } 66 | 67 | public void onMultipleIncludeOwnClick(final View view) { 68 | new LicensesDialog.Builder(this) 69 | .setNotices(R.raw.notices) 70 | .setIncludeOwnLicense(true) 71 | .build() 72 | .show(); 73 | } 74 | 75 | public void onMultipleProgrammaticClick(final View view) { 76 | final Notices notices = new Notices(); 77 | notices.addNotice(new Notice("Test 1", "http://example.org", "Example Person", new ApacheSoftwareLicense20())); 78 | notices.addNotice(new Notice("Test 2", "http://example.org", "Example Person 2", new GnuLesserGeneralPublicLicense21())); 79 | 80 | new LicensesDialog.Builder(this) 81 | .setNotices(notices) 82 | .setIncludeOwnLicense(true) 83 | .build() 84 | .show(); 85 | } 86 | 87 | public void onSingleFragmentClick(final View view) { 88 | final String name = "LicensesDialog"; 89 | final String url = "http://psdev.de"; 90 | final String copyright = "Copyright 2013 Philip Schiffer "; 91 | final License license = new ApacheSoftwareLicense20(); 92 | final Notice notice = new Notice(name, url, copyright, license); 93 | 94 | final LicensesDialogFragment fragment = new LicensesDialogFragment.Builder(this) 95 | .setNotice(notice) 96 | .setIncludeOwnLicense(false) 97 | .build(); 98 | 99 | fragment.show(getSupportFragmentManager(), null); 100 | } 101 | 102 | public void onMultipleFragmentClick(final View view) throws Exception { 103 | final LicensesDialogFragment fragment = new LicensesDialogFragment.Builder(this) 104 | .setNotices(R.raw.notices) 105 | .build(); 106 | 107 | fragment.show(getSupportFragmentManager(), null); 108 | } 109 | 110 | public void onMultipleIncludeOwnFragmentClick(final View view) throws Exception { 111 | final LicensesDialogFragment fragment = new LicensesDialogFragment.Builder(this) 112 | .setNotices(R.raw.notices) 113 | .setShowFullLicenseText(false) 114 | .setIncludeOwnLicense(true) 115 | .build(); 116 | 117 | fragment.show(getSupportFragmentManager(), null); 118 | } 119 | 120 | public void onMultipleProgrammaticFragmentClick(final View view) { 121 | final Notices notices = new Notices(); 122 | notices.addNotice(new Notice("Test 1", "http://example.org", "Example Person", new ApacheSoftwareLicense20())); 123 | notices.addNotice(new Notice("Test 2", "http://example.org", "Example Person 2", new GnuLesserGeneralPublicLicense21())); 124 | 125 | final LicensesDialogFragment fragment = new LicensesDialogFragment.Builder(this) 126 | .setNotices(notices) 127 | .setShowFullLicenseText(false) 128 | .setIncludeOwnLicense(true) 129 | .build(); 130 | 131 | fragment.show(getSupportFragmentManager(), null); 132 | } 133 | 134 | public void onCustomThemeClick(final View view) { 135 | new LicensesDialog.Builder(this) 136 | .setNotices(R.raw.notices) 137 | .setIncludeOwnLicense(true) 138 | .setThemeResourceId(R.style.custom_theme) 139 | .setDividerColorId(R.color.custom_divider_color) 140 | .build() 141 | .show(); 142 | } 143 | 144 | public void onCustomThemeFragmentClick(final View view) throws Exception { 145 | final LicensesDialogFragment fragment = new LicensesDialogFragment.Builder(this) 146 | .setNotices(R.raw.notices) 147 | .setShowFullLicenseText(false) 148 | .setIncludeOwnLicense(true) 149 | .setThemeResourceId(R.style.custom_theme) 150 | .setDividerColorRes(R.color.custom_divider_color) 151 | .build(); 152 | 153 | fragment.show(getSupportFragmentManager(), null); 154 | } 155 | 156 | public void onCustomCssStyleClick(final View view) { 157 | new LicensesDialog.Builder(this) 158 | .setNotices(R.raw.notices) 159 | .setNoticesCssStyle(R.string.custom_notices_default_style) 160 | .build() 161 | .show(); 162 | } 163 | 164 | public void onCustomCssStyleFragmentClick(final View view) throws Exception { 165 | String formatString = getString(R.string.custom_notices_format_style); 166 | String pBg = getRGBAString(Color.parseColor("#9E9E9E")); 167 | String bodyBg = getRGBAString(Color.parseColor("#424242")); 168 | String preBg = getRGBAString(Color.parseColor("#BDBDBD")); 169 | String liColor = "color: #ffffff"; 170 | String linkColor = "color: #1976D2"; 171 | 172 | String style = String.format(formatString, pBg, bodyBg, preBg, liColor, linkColor); 173 | 174 | final LicensesDialogFragment fragment = new LicensesDialogFragment.Builder(this) 175 | .setNotices(R.raw.notices) 176 | .setNoticesCssStyle(style) 177 | .build(); 178 | 179 | fragment.show(getSupportFragmentManager(), null); 180 | } 181 | 182 | public void onSingleDisableDarkModeClick(final View view) { 183 | final String name = "LicensesDialog"; 184 | final String url = "http://psdev.de"; 185 | final String copyright = "Copyright 2013 Philip Schiffer "; 186 | final License license = new ApacheSoftwareLicense20(); 187 | final Notice notice = new Notice(name, url, copyright, license); 188 | new LicensesDialog.Builder(this) 189 | .setNotices(notice) 190 | .setEnableDarkMode(false) 191 | .build() 192 | .show(); 193 | } 194 | 195 | private String getRGBAString(@ColorInt int color) { 196 | int red = Color.red(color); 197 | int green = Color.green(color); 198 | int blue = Color.blue(color); 199 | float alpha = ((float) Color.alpha(color) / 255); 200 | return String.format(getString(R.string.rgba_background_format), red, green, blue, alpha); 201 | } 202 | } -------------------------------------------------------------------------------- /sample/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSDev/LicensesDialog/24e1f9f7b8194b8435e16dc61e1e157026f7c2cc/sample/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSDev/LicensesDialog/24e1f9f7b8194b8435e16dc61e1e157026f7c2cc/sample/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSDev/LicensesDialog/24e1f9f7b8194b8435e16dc61e1e157026f7c2cc/sample/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSDev/LicensesDialog/24e1f9f7b8194b8435e16dc61e1e157026f7c2cc/sample/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSDev/LicensesDialog/24e1f9f7b8194b8435e16dc61e1e157026f7c2cc/sample/src/main/res/drawable-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 26 | 27 |