1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-09 12:32:30 +01:00

Update versions and apply migrations

This commit is contained in:
Allan Wang 2022-09-15 15:13:07 -07:00
parent b6cc172c77
commit 225b34db09
No known key found for this signature in database
GPG Key ID: C93E3F9C679D7A56
7 changed files with 40 additions and 61 deletions

View File

@ -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<Library> {
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(

View File

@ -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 }
}
}

View File

@ -107,7 +107,9 @@ private class SearchParserImpl : FrostParserBase<FrostSearches>(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 <span /> 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 }

View File

@ -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(

View File

@ -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"
}

View File

@ -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

View File

@ -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