From 4252ebd24dbd6b805f21b0a2bdcdaa24e6be0e8b Mon Sep 17 00:00:00 2001 From: Koitharu Date: Wed, 24 Jan 2024 12:40:18 +0200 Subject: [PATCH 1/3] Bump versionCode --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index a62c13676..ab3883f94 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,7 +16,7 @@ android { applicationId 'org.koitharu.kotatsu' minSdk = 21 targetSdk = 34 - versionCode = 615 + versionCode = 616 versionName = '6.6.6' generatedDensities = [] testInstrumentationRunner 'org.koitharu.kotatsu.HiltTestRunner' From 2379efc191c4233c63457a2dbf7bc3869c064623 Mon Sep 17 00:00:00 2001 From: Zakhar Timoshenko Date: Sun, 28 Jan 2024 17:58:38 +0300 Subject: [PATCH 2/3] TLS 1.3 support for Android < 10 (cherry picked from commit 889b799d8dd9b73e61295629c35bb3e26778acca) --- app/build.gradle | 2 ++ app/src/main/kotlin/org/koitharu/kotatsu/core/BaseApp.kt | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index ab3883f94..8f0efa80f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -141,6 +141,8 @@ dependencies { compileOnly 'com.google.auto.service:auto-service-annotations:1.1.1' ksp 'dev.zacsweers.autoservice:auto-service-ksp:1.1.0' + implementation 'org.conscrypt:conscrypt-android:2.5.2' + debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.13' testImplementation 'junit:junit:4.13.2' diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/BaseApp.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/BaseApp.kt index 4082d125a..85d75e760 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/BaseApp.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/BaseApp.kt @@ -2,6 +2,7 @@ package org.koitharu.kotatsu.core import android.app.Application import android.content.Context +import android.os.Build import androidx.annotation.WorkerThread import androidx.appcompat.app.AppCompatDelegate import androidx.hilt.work.HiltWorkerFactory @@ -19,6 +20,7 @@ import org.acra.config.httpSender import org.acra.data.StringFormat import org.acra.ktx.initAcra import org.acra.sender.HttpSender +import org.conscrypt.Conscrypt import org.koitharu.kotatsu.BuildConfig import org.koitharu.kotatsu.R import org.koitharu.kotatsu.core.db.MangaDatabase @@ -27,6 +29,7 @@ import org.koitharu.kotatsu.core.prefs.AppSettings import org.koitharu.kotatsu.core.util.WorkServiceStopHelper import org.koitharu.kotatsu.core.util.ext.processLifecycleScope import org.koitharu.kotatsu.settings.work.WorkScheduleManager +import java.security.Security import javax.inject.Inject import javax.inject.Provider @@ -66,6 +69,10 @@ open class BaseApp : Application(), Configuration.Provider { super.onCreate() AppCompatDelegate.setDefaultNightMode(settings.theme) AppCompatDelegate.setApplicationLocales(settings.appLocales) + // TLS 1.3 support for Android < 10 + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + Security.insertProviderAt(Conscrypt.newProvider(), 1) + } setupActivityLifecycleCallbacks() processLifecycleScope.launch { val isOriginalApp = withContext(Dispatchers.Default) { From ae57561591725d1d1451f552554af05a8985304a Mon Sep 17 00:00:00 2001 From: Koitharu Date: Wed, 31 Jan 2024 16:16:04 +0200 Subject: [PATCH 3/3] Update parsers --- app/build.gradle | 6 +++--- .../kotatsu/core/model/parcelable/ParcelableChapter.kt | 6 ++++-- .../koitharu/kotatsu/download/ui/list/DownloadsViewModel.kt | 2 +- .../koitharu/kotatsu/local/data/input/LocalMangaInput.kt | 1 + .../org/koitharu/kotatsu/reader/ui/ReaderViewModel.kt | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8f0efa80f..c5adb6b0d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,8 +16,8 @@ android { applicationId 'org.koitharu.kotatsu' minSdk = 21 targetSdk = 34 - versionCode = 616 - versionName = '6.6.6' + versionCode = 617 + versionName = '6.6.7' generatedDensities = [] testInstrumentationRunner 'org.koitharu.kotatsu.HiltTestRunner' ksp { @@ -82,7 +82,7 @@ afterEvaluate { } dependencies { //noinspection GradleDependency - implementation('com.github.KotatsuApp:kotatsu-parsers:7c871edbca') { + implementation('com.github.KotatsuApp:kotatsu-parsers:57c9d26916') { exclude group: 'org.json', module: 'json' } diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/model/parcelable/ParcelableChapter.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/model/parcelable/ParcelableChapter.kt index 190185bdd..3eb99abdc 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/model/parcelable/ParcelableChapter.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/model/parcelable/ParcelableChapter.kt @@ -19,7 +19,8 @@ data class ParcelableChapter( MangaChapter( id = parcel.readLong(), name = parcel.readString().orEmpty(), - number = parcel.readInt(), + number = parcel.readFloat(), + volume = parcel.readInt(), url = parcel.readString().orEmpty(), scanlator = parcel.readString(), uploadDate = parcel.readLong(), @@ -31,7 +32,8 @@ data class ParcelableChapter( override fun ParcelableChapter.write(parcel: Parcel, flags: Int) = with(chapter) { parcel.writeLong(id) parcel.writeString(name) - parcel.writeInt(number) + parcel.writeFloat(number) + parcel.writeInt(volume) parcel.writeString(url) parcel.writeString(scanlator) parcel.writeLong(uploadDate) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/download/ui/list/DownloadsViewModel.kt b/app/src/main/kotlin/org/koitharu/kotatsu/download/ui/list/DownloadsViewModel.kt index 96a884748..2ed27542d 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/download/ui/list/DownloadsViewModel.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/download/ui/list/DownloadsViewModel.kt @@ -306,7 +306,7 @@ class DownloadsViewModel @Inject constructor( return chapters.mapNotNullTo(ArrayList(size)) { if (chapterIds == null || it.id in chapterIds) { DownloadChapter( - number = it.number, + number = it.number.toInt(), name = it.name, isDownloaded = it.id in localChapters, ) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/local/data/input/LocalMangaInput.kt b/app/src/main/kotlin/org/koitharu/kotatsu/local/data/input/LocalMangaInput.kt index 45454631a..13d129235 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/local/data/input/LocalMangaInput.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/local/data/input/LocalMangaInput.kt @@ -100,6 +100,7 @@ sealed class LocalMangaInput( id = id, name = name, number = number, + volume = volume, url = url, scanlator = scanlator, uploadDate = uploadDate, diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderViewModel.kt b/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderViewModel.kt index 899c837ce..757ea2efc 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderViewModel.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderViewModel.kt @@ -388,7 +388,7 @@ class ReaderViewModel @Inject constructor( mangaName = manga?.toManga()?.title, branch = chapter?.branch, chapterName = chapter?.name, - chapterNumber = chapter?.number ?: 0, + chapterNumber = chapter?.number?.toInt() ?: 0, chaptersTotal = manga?.chapters?.get(chapter?.branch)?.size ?: 0, totalPages = if (chapter != null) chaptersLoader.getPagesCount(chapter.id) else 0, currentPage = state?.page ?: 0,