diff --git a/app/build.gradle b/app/build.gradle index c5c1bd44d..ea0be15f9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,8 +16,8 @@ android { applicationId 'org.koitharu.kotatsu' minSdk = 21 targetSdk = 35 - versionCode = 682 - versionName = '7.7-a3' + versionCode = 683 + versionName = '7.7-a4' generatedDensities = [] testInstrumentationRunner 'org.koitharu.kotatsu.HiltTestRunner' ksp { @@ -82,7 +82,7 @@ afterEvaluate { } } dependencies { - implementation('com.github.KotatsuApp:kotatsu-parsers:d8cb38a9be') { + implementation('com.github.KotatsuApp:kotatsu-parsers:3d5cc5ceff') { exclude group: 'org.json', module: 'json' } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 33f424b19..79c61d6e5 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -15,6 +15,7 @@ -dontwarn org.bouncycastle.** -dontwarn org.openjsse.** -dontwarn com.google.j2objc.annotations.** +-dontwarn coil3.PlatformContext -keep class org.koitharu.kotatsu.core.exceptions.* { *; } -keep class org.koitharu.kotatsu.settings.NotificationSettingsLegacyFragment diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/backup/BackupRepository.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/backup/BackupRepository.kt index 2071ae6d9..a8c45f0ca 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/backup/BackupRepository.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/backup/BackupRepository.kt @@ -6,7 +6,7 @@ import org.json.JSONObject import org.koitharu.kotatsu.BuildConfig import org.koitharu.kotatsu.core.db.MangaDatabase import org.koitharu.kotatsu.core.prefs.AppSettings -import org.koitharu.kotatsu.parsers.util.json.JSONIterator +import org.koitharu.kotatsu.parsers.util.json.asTypedList import org.koitharu.kotatsu.parsers.util.json.getLongOrDefault import org.koitharu.kotatsu.parsers.util.json.mapJSON import org.koitharu.kotatsu.parsers.util.runCatchingCancellable @@ -130,7 +130,7 @@ class BackupRepository @Inject constructor( suspend fun restoreHistory(entry: BackupEntry): CompositeResult { val result = CompositeResult() - for (item in entry.data.JSONIterator()) { + for (item in entry.data.asTypedList()) { val mangaJson = item.getJSONObject("manga") val manga = JsonDeserializer(mangaJson).toMangaEntity() val tags = mangaJson.getJSONArray("tags").mapJSON { @@ -150,7 +150,7 @@ class BackupRepository @Inject constructor( suspend fun restoreCategories(entry: BackupEntry): CompositeResult { val result = CompositeResult() - for (item in entry.data.JSONIterator()) { + for (item in entry.data.asTypedList()) { val category = JsonDeserializer(item).toFavouriteCategoryEntity() result += runCatchingCancellable { db.getFavouriteCategoriesDao().upsert(category) @@ -161,7 +161,7 @@ class BackupRepository @Inject constructor( suspend fun restoreFavourites(entry: BackupEntry): CompositeResult { val result = CompositeResult() - for (item in entry.data.JSONIterator()) { + for (item in entry.data.asTypedList()) { val mangaJson = item.getJSONObject("manga") val manga = JsonDeserializer(mangaJson).toMangaEntity() val tags = mangaJson.getJSONArray("tags").mapJSON { @@ -181,7 +181,7 @@ class BackupRepository @Inject constructor( suspend fun restoreBookmarks(entry: BackupEntry): CompositeResult { val result = CompositeResult() - for (item in entry.data.JSONIterator()) { + for (item in entry.data.asTypedList()) { val mangaJson = item.getJSONObject("manga") val manga = JsonDeserializer(mangaJson).toMangaEntity() val tags = item.getJSONArray("tags").mapJSON { @@ -203,7 +203,7 @@ class BackupRepository @Inject constructor( suspend fun restoreSources(entry: BackupEntry): CompositeResult { val result = CompositeResult() - for (item in entry.data.JSONIterator()) { + for (item in entry.data.asTypedList()) { val source = JsonDeserializer(item).toMangaSourceEntity() result += runCatchingCancellable { db.getSourcesDao().upsert(source) @@ -214,7 +214,7 @@ class BackupRepository @Inject constructor( fun restoreSettings(entry: BackupEntry): CompositeResult { val result = CompositeResult() - for (item in entry.data.JSONIterator()) { + for (item in entry.data.asTypedList()) { result += runCatchingCancellable { settings.upsertAll(JsonDeserializer(item).toMap()) } diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/reader/domain/PageLoader.kt b/app/src/main/kotlin/org/koitharu/kotatsu/reader/domain/PageLoader.kt index 9de3dffdb..3b367071b 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/reader/domain/PageLoader.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/reader/domain/PageLoader.kt @@ -1,8 +1,10 @@ package org.koitharu.kotatsu.reader.domain +import android.content.ContentResolver.MimeTypeInfo import android.content.Context import android.graphics.Rect import android.net.Uri +import android.webkit.MimeTypeMap import androidx.annotation.AnyThread import androidx.collection.LongSparseArray import androidx.collection.set @@ -59,6 +61,8 @@ import org.koitharu.kotatsu.parsers.model.MangaSource import org.koitharu.kotatsu.parsers.util.mimeType import org.koitharu.kotatsu.parsers.util.requireBody import org.koitharu.kotatsu.parsers.util.runCatchingCancellable +import org.koitharu.kotatsu.core.image.BitmapDecoderCompat +import org.koitharu.kotatsu.core.util.ext.mimeType import org.koitharu.kotatsu.reader.ui.pager.ReaderPage import java.io.File import java.util.LinkedList