From 225b34db099f2896698abca816b27f068b39de59 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 15 Sep 2022 15:13:07 -0700 Subject: [PATCH] Update versions and apply migrations --- .../frost/activities/AboutActivity.kt | 75 +++++++------------ .../frost/activities/SettingsActivity.kt | 2 +- .../frost/facebook/parsers/SearchParser.kt | 4 +- .../pitchedapps/frost/utils/JsoupCleaner.kt | 4 +- buildSrc/src/main/kotlin/Versions.kt | 12 +-- gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 7 files changed, 40 insertions(+), 61 deletions(-) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt index bbf8f8129..aec6d421c 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt @@ -27,7 +27,6 @@ import ca.allanwang.kau.about.LibraryIItem import ca.allanwang.kau.adapters.FastItemThemedAdapter import ca.allanwang.kau.adapters.ThemableIItem import ca.allanwang.kau.adapters.ThemableIItemDelegate -import ca.allanwang.kau.logging.KL import ca.allanwang.kau.utils.bindView import ca.allanwang.kau.utils.dimenPixelSize import ca.allanwang.kau.utils.drawable @@ -37,7 +36,7 @@ import ca.allanwang.kau.utils.string import ca.allanwang.kau.utils.toDrawable import ca.allanwang.kau.utils.toast import ca.allanwang.kau.utils.withMinAlpha -import com.mikepenz.aboutlibraries.Libs +import com.mikepenz.aboutlibraries.entity.Developer import com.mikepenz.aboutlibraries.entity.Library import com.mikepenz.aboutlibraries.entity.License import com.mikepenz.fastadapter.GenericItem @@ -76,30 +75,6 @@ class AboutActivity : AboutActivityBase(null) { faqParseNewLine = false } - override fun getLibraries(libs: Libs): List { - val include = arrayOf( - "AboutLibraries", - "AndroidIconics", - "fastadapter", - "glide", - "Jsoup", - "kau", - "kotterknife", - "materialdialogs", - "subsamplingscaleimageview" - ) - - val l = libs.prepareLibraries( - this, include, emptyArray(), - autoDetect = false, - checkCachedDetection = true, - sort = true - ) - if (BuildConfig.DEBUG) - l.forEach { KL.d { "Lib ${it.definedName}" } } - return l - } - var lastClick = -1L var clickCount = 0 @@ -108,22 +83,24 @@ class AboutActivity : AboutActivityBase(null) { * Frost may not be a library but we're conveying the same info */ val frost = Library( - definedName = "frost", - libraryName = string(R.string.frost_name), - author = string(R.string.dev_name), - libraryWebsite = string(R.string.github_url), - isOpenSource = true, - libraryDescription = string(R.string.frost_description), - libraryVersion = BuildConfig.VERSION_NAME, + uniqueId = "com.pitchedapps.frost", + name = string(R.string.frost_name), + developers = listOf( + Developer(name = string(R.string.dev_name), organisationUrl = null) + ), + website = string(R.string.github_url), + description = string(R.string.frost_description), + artifactVersion = BuildConfig.VERSION_NAME, licenses = setOf( License( - definedName = "gplv3", - licenseName = "GNU GPL v3", - licenseWebsite = "https://www.gnu.org/licenses/gpl-3.0.en.html", - licenseDescription = "", - licenseShortDescription = "" + spdxId = "gplv3", + name = "GNU GPL v3", + url = "https://www.gnu.org/licenses/gpl-3.0.en.html", + hash = "gplv3" ) - ) + ), + scm = null, + organization = null, ) adapter.add(LibraryIItem(frost)).add(AboutLinks()) adapter.onClickListener = { _, _, item, _ -> @@ -199,17 +176,17 @@ class AboutActivity : AboutActivityBase(null) { ) to onClick } ).mapIndexed { i, (icon, onClick) -> - ImageView(c).apply { - layoutParams = ViewGroup.LayoutParams(size, size) - id = 109389 + i - setImageDrawable(icon) - scaleType = ImageView.ScaleType.CENTER - background = - context.resolveDrawable(android.R.attr.selectableItemBackgroundBorderless) - setOnClickListener { onClick() } - container.addView(this) + ImageView(c).apply { + layoutParams = ViewGroup.LayoutParams(size, size) + id = 109389 + i + setImageDrawable(icon) + scaleType = ImageView.ScaleType.CENTER + background = + context.resolveDrawable(android.R.attr.selectableItemBackgroundBorderless) + setOnClickListener { onClick() } + container.addView(this) + } } - } val set = ConstraintSet() set.clone(container) set.createHorizontalChain( diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt index 8bf3345e9..fb3872df3 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt @@ -214,7 +214,7 @@ class SettingsActivity : KPrefActivity() { subItems(R.string.debug_frost, getDebugPrefs()) { descRes = R.string.debug_frost_desc - iicon = CommunityMaterial.Icon.cmd_android_debug_bridge + iicon = CommunityMaterial.Icon.cmd_bug visible = { prefs.debugSettings } } } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/SearchParser.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/SearchParser.kt index 0c9a7e92b..4d45d4399 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/SearchParser.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/SearchParser.kt @@ -107,7 +107,9 @@ private class SearchParserImpl : FrostParserBase(false) { // And the other entries are additional info. // There are also cases of nested tables, eg for the "join" button in groups. // Those elements have texts, so we will filter by div to ignore those - val texts = a.children().filter { it.tagName() == "div" && it.hasText() } + val texts = + a.children() + .filter { childEl: Element -> childEl.tagName() == "div" && childEl.hasText() } val title = texts.firstOrNull()?.text() ?: return@mapNotNull null val info = texts.takeIf { it.size > 1 }?.last()?.text() L.e { a } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/JsoupCleaner.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/JsoupCleaner.kt index c783a8423..4f76fb6c9 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/JsoupCleaner.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/JsoupCleaner.kt @@ -19,7 +19,7 @@ package com.pitchedapps.frost.utils import org.jsoup.Jsoup import org.jsoup.nodes.Attribute import org.jsoup.nodes.Element -import org.jsoup.safety.Whitelist +import org.jsoup.safety.Safelist /** * Created by Allan Wang on 2017-08-10. @@ -34,7 +34,7 @@ internal fun String.cleanText(): String = replace(Regex(">(?s).+?<"), "><") internal fun String.cleanJsoup(): String = Jsoup.clean(this, PrivacyWhitelist()) -class PrivacyWhitelist : Whitelist() { +class PrivacyWhitelist : Safelist() { val blacklistAttrs = arrayOf("style", "aria-label", "rel") val blacklistTags = arrayOf( diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index a80695075..5cbefda77 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -1,6 +1,6 @@ object Versions { - const val targetSdk = 31 + const val targetSdk = 33 // https://developer.android.com/jetpack/androidx/releases/biometric const val andxBiometric = "1.1.0" @@ -12,15 +12,15 @@ object Versions { const val exoMedia = "4.3.0" // https://github.com/jhy/jsoup/releases - const val jsoup = "1.14.3" + const val jsoup = "1.15.3" // https://square.github.io/okhttp/changelog/ - const val okhttp = "4.9.1" + const val okhttp = "4.10.0" // https://developer.android.com/jetpack/androidx/releases/room - const val room = "2.3.0" + const val room = "2.4.3" // http://robolectric.org/getting-started/ - const val roboelectric = "4.6" + const val roboelectric = "4.8" // https://github.com/Piasy/BigImageViewer#add-the-dependencies const val bigImageViewer = "1.8.1" // https://github.com/node-gradle/gradle-node-plugin/releases - const val nodeGradle = "3.1.1" + const val nodeGradle = "3.4.0" } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index ee36bd789..14663b9aa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,7 +16,7 @@ org.gradle.daemon = true APP_ID=Frost APP_GROUP=com.pitchedapps -KAU=6.4.0 +KAU=00595a89 android.useAndroidX=true android.enableJetifier=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a0f7639f7..8fad3f5a9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists