From 9d3a8e7c40535765c89c022ae270bc13ca77d833 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 18 Jun 2019 17:42:07 +0200 Subject: [PATCH 1/4] Add usage of com.google.android.gms:oss-licenses-plugin to list open source licenses --- build.gradle | 1 + vector/build.gradle | 4 ++++ .../riotredesign/features/settings/PreferencesManager.java | 1 + .../features/settings/VectorSettingsPreferencesFragment.kt | 7 +++++++ vector/src/main/res/values/strings_riotX.xml | 1 + vector/src/main/res/xml/vector_settings_preferences.xml | 4 ++++ 6 files changed, 18 insertions(+) diff --git a/build.gradle b/build.gradle index 14d07f07..605bccbb 100644 --- a/build.gradle +++ b/build.gradle @@ -17,6 +17,7 @@ buildscript { classpath "com.airbnb.okreplay:gradle-plugin:1.4.0" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2' + classpath 'com.google.android.gms:oss-licenses-plugin:0.9.5' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/vector/build.gradle b/vector/build.gradle index 2f49297b..e2b4f5ac 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.android.application' +apply plugin: 'com.google.android.gms.oss-licenses-plugin' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' @@ -162,6 +163,9 @@ dependencies { implementation "com.squareup.moshi:moshi-adapters:$moshi_version" kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version" + // OSS License + implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0' + // Log implementation 'com.jakewharton.timber:timber:4.7.1' diff --git a/vector/src/main/java/im/vector/riotredesign/features/settings/PreferencesManager.java b/vector/src/main/java/im/vector/riotredesign/features/settings/PreferencesManager.java index c695d4cd..4a917592 100755 --- a/vector/src/main/java/im/vector/riotredesign/features/settings/PreferencesManager.java +++ b/vector/src/main/java/im/vector/riotredesign/features/settings/PreferencesManager.java @@ -54,6 +54,7 @@ public class PreferencesManager { public static final String SETTINGS_NOTIFICATION_TROUBLESHOOT_PREFERENCE_KEY = "SETTINGS_NOTIFICATION_TROUBLESHOOT_PREFERENCE_KEY"; public static final String SETTINGS_NOTIFICATION_ADVANCED_PREFERENCE_KEY = "SETTINGS_NOTIFICATION_ADVANCED_PREFERENCE_KEY"; public static final String SETTINGS_THIRD_PARTY_NOTICES_PREFERENCE_KEY = "SETTINGS_THIRD_PARTY_NOTICES_PREFERENCE_KEY"; + public static final String SETTINGS_OTHER_THIRD_PARTY_NOTICES_PREFERENCE_KEY = "SETTINGS_OTHER_THIRD_PARTY_NOTICES_PREFERENCE_KEY"; public static final String SETTINGS_COPYRIGHT_PREFERENCE_KEY = "SETTINGS_COPYRIGHT_PREFERENCE_KEY"; public static final String SETTINGS_CLEAR_CACHE_PREFERENCE_KEY = "SETTINGS_CLEAR_CACHE_PREFERENCE_KEY"; public static final String SETTINGS_CLEAR_MEDIA_CACHE_PREFERENCE_KEY = "SETTINGS_CLEAR_MEDIA_CACHE_PREFERENCE_KEY"; diff --git a/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsPreferencesFragment.kt b/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsPreferencesFragment.kt index e386eaa9..10c06bc7 100755 --- a/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsPreferencesFragment.kt +++ b/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsPreferencesFragment.kt @@ -41,6 +41,7 @@ import androidx.core.content.ContextCompat import androidx.core.content.edit import androidx.core.view.isVisible import androidx.preference.* +import com.google.android.gms.oss.licenses.OssLicensesMenuActivity import com.google.android.material.textfield.TextInputEditText import com.google.android.material.textfield.TextInputLayout import im.vector.matrix.android.api.Matrix @@ -693,6 +694,12 @@ class VectorSettingsPreferencesFragment : VectorPreferenceFragment(), SharedPref false } + findPreference(PreferencesManager.SETTINGS_OTHER_THIRD_PARTY_NOTICES_PREFERENCE_KEY) + .onPreferenceClickListener = Preference.OnPreferenceClickListener { + startActivity(Intent(requireActivity(), OssLicensesMenuActivity::class.java)) + false + } + // update keep medias period findPreference(PreferencesManager.SETTINGS_MEDIA_SAVING_PERIOD_KEY).let { it.summary = PreferencesManager.getSelectedMediasSavingPeriodString(activity) diff --git a/vector/src/main/res/values/strings_riotX.xml b/vector/src/main/res/values/strings_riotX.xml index 3293c4cf..30a2c7ec 100644 --- a/vector/src/main/res/values/strings_riotX.xml +++ b/vector/src/main/res/values/strings_riotX.xml @@ -7,5 +7,6 @@ "Import e2e keys from file \"%1$s\"." Matrix SDK Version + Other third party notices \ No newline at end of file diff --git a/vector/src/main/res/xml/vector_settings_preferences.xml b/vector/src/main/res/xml/vector_settings_preferences.xml index e891b121..70489cff 100755 --- a/vector/src/main/res/xml/vector_settings_preferences.xml +++ b/vector/src/main/res/xml/vector_settings_preferences.xml @@ -480,6 +480,10 @@ android:key="SETTINGS_THIRD_PARTY_NOTICES_PREFERENCE_KEY" android:title="@string/settings_third_party_notices" /> + + From 8ff6fbb153fe68b980574d8a7e05c5183587c3b8 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 18 Jun 2019 17:46:52 +0200 Subject: [PATCH 2/4] Handle redirection --- .../main/java/im/vector/riotredesign/core/utils/Dialogs.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/riotredesign/core/utils/Dialogs.kt b/vector/src/main/java/im/vector/riotredesign/core/utils/Dialogs.kt index 6aa63660..2bd880a3 100644 --- a/vector/src/main/java/im/vector/riotredesign/core/utils/Dialogs.kt +++ b/vector/src/main/java/im/vector/riotredesign/core/utils/Dialogs.kt @@ -20,6 +20,7 @@ package im.vector.riotredesign.core.utils import android.content.Context import android.webkit.WebView +import android.webkit.WebViewClient import androidx.appcompat.app.AlertDialog /** @@ -29,9 +30,13 @@ import androidx.appcompat.app.AlertDialog */ fun Context.displayInWebView(url: String) { val wv = WebView(this) + + // Set a WebViewClient to ensure redirection is handled directly in the WebView + wv.webViewClient = WebViewClient() + wv.loadUrl(url) AlertDialog.Builder(this) .setView(wv) .setPositiveButton(android.R.string.ok, null) .show() -} \ No newline at end of file +} From 0998ffb5f246d2d390192dbffc4de8590f7992f1 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 18 Jun 2019 18:29:48 +0200 Subject: [PATCH 3/4] Update open source license file --- vector/build.gradle | 3 +- .../src/main/assets/open_source_licenses.html | 214 +++++++++++------- 2 files changed, 131 insertions(+), 86 deletions(-) diff --git a/vector/build.gradle b/vector/build.gradle index e2b4f5ac..34e1edb0 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -176,6 +176,7 @@ dependencies { implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0' implementation 'io.reactivex.rxjava2:rxandroid:2.1.0' implementation 'com.jakewharton.rxrelay2:rxrelay:2.1.0' + // TODO RxBindings3 exists implementation 'com.jakewharton.rxbinding2:rxbinding:2.2.0' implementation("com.airbnb.android:epoxy:$epoxy_version") @@ -185,7 +186,7 @@ dependencies { // Work implementation "android.arch.work:work-runtime-ktx:1.0.0" - // FP + // Functional Programming implementation "io.arrow-kt:arrow-core:$arrow_version" // Pref diff --git a/vector/src/main/assets/open_source_licenses.html b/vector/src/main/assets/open_source_licenses.html index 15d9252c..55ff8543 100755 --- a/vector/src/main/assets/open_source_licenses.html +++ b/vector/src/main/assets/open_source_licenses.html @@ -21,11 +21,12 @@ div { padding: 4px; } +
-

Riot Android

+

RiotX Android

Third Party Licenses

@@ -173,6 +174,62 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +
    +
  • + Tapadoo/Alerter +
    + Tapadoo/Alerter is licensed under the MIT License + Copyright 2017 Tapadoo, Dublin. +
  • +
+
+
+Copyright 2017 Tapadoo, Dublin.
+
+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:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+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.
+
+
+ +
    +
  • + com.github.piasy:BigImageViewer +
    + MIT License + + Copyright (c) 2018 Piasy +
  • +
+
+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:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+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.
+
+ +
    +
  • + textdrawable +
    + textdrawable is licensed under the MIT License +
  • +

Apache License @@ -192,78 +249,25 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copyright (c) 2019 The Matrix.org Foundation C.I.C
  • - Jitsi Meet (jitsi-meet) + rxkotlin
    - Copyright @ 2018-present 8x8, Inc. -
    - Copyright @ 2017-2018 Atlassian Pty Ltd + Copyright io.reactivex.
  • - Retrofit + rxandroid
    - Copyright 2013 Square, Inc. + Copyright io.reactivex.
  • - okhttp + rxrelay
    - Copyright 2016 Square, Inc. + Copyright 2014 Netflix, Inc. + Copyright 2015 Jake Wharton
  • - ShortcutBadger + rxbinding
    - Copyright 2014 Leo Lin -
  • -
  • - html-textview -
    - Copyright (C) 2013-2015 Dominik Schürmann -
    - Copyright (C) 2013-2015 Juha Kuitunen -
    - Copyright (C) 2013 Mohammed Lakkadshaw -
    - Copyright (C) 2007 The Android Open Source Project -
  • -
  • - anddown -
    - Copyright (c) 2016 CommonsWare, LLC -
  • -
  • - zip4j -
    - Copyright 2010 Srikanth Reddy Lingala -
  • -
  • - SwipeBack -
    - Copyright 2015 Eric Liu -
  • -
  • - Libphonenumber -
    - Copyright 2017 Google -
  • -
  • - Butter Knife -
    - Copyright 2013 Jake Wharton -
  • -
  • - FloatingActionButton -
    - Copyright (C) 2014 Jerzy Chalupski -
  • -
  • - Spanny -
    - Copyright 2015 Pavlovsky Ivan -
  • -
  • - PhotoView -
    - Copyright 2018 Chris Banes + Copyright (C) 2015 Jake Wharton
  • Epoxy @@ -271,9 +275,69 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copyright 2016 Airbnb, Inc.
  • - Anko + mvrx
    - Copyright 2016 JetBrains s.r.o. + Copyright 2018 Airbnb, Inc. +
  • +
  • + arrow-core +
    + Copyright (C) 2017 The Λrrow Authors +
  • +
  • + material +
    + Copyright (C) 2016 Google +
  • +
  • + span +
    + Copyright 2018 Jun Gu +
  • +
  • + ru.noties.markwon +
    + Copyright 2017 Dimitry Ivanov (mail@dimitryivanov.ru) +
  • +
  • + better-link-movement-method +
    + Copyright 2018 Saket Narayan. +
  • +
  • + zxcvbn +
    + Copyright (c) 2012-2016 Dan Wheeler and Dropbox, Inc. +
  • +
  • + com.otaliastudios:autocomplete +
    + Copyright (c) 2017 +
  • +
  • + Butterknife +
    + Copyright 2013 Jake Wharton +
  • +
  • + seismic +
    + Copyright 2012 Square, Inc. +
  • +
  • + videocache +
    + Copyright 2014-2017 Alexey Danilov +
  • +
  • + ShortcutBadger +
    + Copyright 2014 Leo Lin +
  • +
  • + FilePicker +
    + Copyright (c) 2018, Jaisel Rahman
  • @@ -453,25 +517,5 @@ Apache License
           of your accepting any such warranty or additional liability.
     
    - -
      -
    • - Tapadoo/Alerter -
      - Tapadoo/Alerter is licensed under the MIT License - Copyright 2017 Tapadoo, Dublin. -
    • -
    -
    -
    -Copyright 2017 Tapadoo, Dublin.
    -
    -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:
    -
    -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    -
    -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.
    -
    -
    From 046aac74c24b42cc294a564e083bd550616edc66 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 18 Jun 2019 18:33:04 +0200 Subject: [PATCH 4/4] Add link for reference --- .../features/settings/VectorSettingsPreferencesFragment.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsPreferencesFragment.kt b/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsPreferencesFragment.kt index 10c06bc7..d821c7f7 100755 --- a/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsPreferencesFragment.kt +++ b/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsPreferencesFragment.kt @@ -696,6 +696,7 @@ class VectorSettingsPreferencesFragment : VectorPreferenceFragment(), SharedPref findPreference(PreferencesManager.SETTINGS_OTHER_THIRD_PARTY_NOTICES_PREFERENCE_KEY) .onPreferenceClickListener = Preference.OnPreferenceClickListener { + // See https://developers.google.com/android/guides/opensource startActivity(Intent(requireActivity(), OssLicensesMenuActivity::class.java)) false }