From cb0e3297160aab7a2d1486aeeecdd92394eb220e Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Mon, 23 Mar 2026 16:37:04 +0600 Subject: [PATCH 1/6] Fix wrong exception being caught after 8c480c6355 migration `android.database.sqlite.SQLiteException` instead of `android.database.SQLException` --- CHANGELOG.md | 2 ++ .../mihon/data/repository/ExtensionRepoRepositoryImpl.kt | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77f11b6f2..8040c4ec9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co - `Other` - for technical stuff. ## [Unreleased] +### Fixed +- Fix app crashing when trying to add extension repo with existing signature ([@AntsyLich](https://github.com/AntsyLich)) ## [v0.19.5] - 2026-03-20 ### Changed diff --git a/data/src/main/java/mihon/data/repository/ExtensionRepoRepositoryImpl.kt b/data/src/main/java/mihon/data/repository/ExtensionRepoRepositoryImpl.kt index 24910d968..61c279630 100644 --- a/data/src/main/java/mihon/data/repository/ExtensionRepoRepositoryImpl.kt +++ b/data/src/main/java/mihon/data/repository/ExtensionRepoRepositoryImpl.kt @@ -1,6 +1,6 @@ package mihon.data.repository -import android.database.sqlite.SQLiteException +import android.database.SQLException import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map import mihon.domain.extensionrepo.exception.SaveExtensionRepoException @@ -42,7 +42,7 @@ class ExtensionRepoRepositoryImpl( ) { try { handler.await { extension_reposQueries.insert(baseUrl, name, shortName, website, signingKeyFingerprint) } - } catch (ex: SQLiteException) { + } catch (ex: SQLException) { throw SaveExtensionRepoException(ex) } } @@ -56,7 +56,7 @@ class ExtensionRepoRepositoryImpl( ) { try { handler.await { extension_reposQueries.upsert(baseUrl, name, shortName, website, signingKeyFingerprint) } - } catch (ex: SQLiteException) { + } catch (ex: SQLException) { throw SaveExtensionRepoException(ex) } } From f8e82b932238776d98a8e708ef6886ceea8e7549 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Mon, 23 Mar 2026 20:13:39 +0600 Subject: [PATCH 2/6] Potentially fix 'database is locked' crash --- CHANGELOG.md | 1 + .../java/eu/kanade/tachiyomi/di/AppModule.kt | 27 ++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8040c4ec9..efc5ff8f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co ## [Unreleased] ### Fixed - Fix app crashing when trying to add extension repo with existing signature ([@AntsyLich](https://github.com/AntsyLich)) +- Potentially fix 'database is locked' crash ([@AntsyLich](https://github.com/AntsyLich)) ## [v0.19.5] - 2026-03-20 ### Changed diff --git a/app/src/main/java/eu/kanade/tachiyomi/di/AppModule.kt b/app/src/main/java/eu/kanade/tachiyomi/di/AppModule.kt index c243d9568..59f1a2c25 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/di/AppModule.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/di/AppModule.kt @@ -7,7 +7,6 @@ import app.cash.sqldelight.db.SqlDriver import com.eygraber.sqldelight.androidx.driver.AndroidxSqliteConfiguration import com.eygraber.sqldelight.androidx.driver.AndroidxSqliteDatabaseType import com.eygraber.sqldelight.androidx.driver.AndroidxSqliteDriver -import com.eygraber.sqldelight.androidx.driver.File import com.eygraber.sqldelight.androidx.driver.FileProvider import eu.kanade.domain.track.store.DelayedTrackingStore import eu.kanade.tachiyomi.data.cache.ChapterCache @@ -44,21 +43,31 @@ import uy.kohesive.injekt.api.InjektRegistrar import uy.kohesive.injekt.api.addSingleton import uy.kohesive.injekt.api.addSingletonFactory import uy.kohesive.injekt.api.get +import java.lang.ref.WeakReference + +private val lock = Any() class AppModule(val app: Application) : InjektModule { + private var sqlDriverRef: WeakReference? = null + override fun InjektRegistrar.registerInjectables() { addSingleton(app) addSingletonFactory { - AndroidxSqliteDriver( - driver = BundledSQLiteDriver(), - databaseType = AndroidxSqliteDatabaseType.FileProvider(app, "tachiyomi.db"), - schema = Database.Schema, - configuration = AndroidxSqliteConfiguration( - isForeignKeyConstraintsEnabled = true, - ), - ) + synchronized(lock) { + sqlDriverRef?.get()?.let { return@synchronized it } + + AndroidxSqliteDriver( + driver = BundledSQLiteDriver(), + databaseType = AndroidxSqliteDatabaseType.FileProvider(app, "tachiyomi.db"), + schema = Database.Schema, + configuration = AndroidxSqliteConfiguration( + isForeignKeyConstraintsEnabled = true, + ), + ) + .also { sqlDriverRef = WeakReference(it) } + } } addSingletonFactory { Database( From 42daa3f432292be5fdfb3ecae07592cb94324164 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Mon, 23 Mar 2026 20:12:14 +0600 Subject: [PATCH 3/6] Fix occasional crash when mass installing/uninstalling extension using `PackageManager` --- CHANGELOG.md | 1 + .../extension/installer/PackageInstallerInstaller.kt | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efc5ff8f5..521778e34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co ### Fixed - Fix app crashing when trying to add extension repo with existing signature ([@AntsyLich](https://github.com/AntsyLich)) - Potentially fix 'database is locked' crash ([@AntsyLich](https://github.com/AntsyLich)) +- Fix occasional crash when mass installing/uninstalling extension using `PackageManager` ([@AntsyLich](https://github.com/AntsyLich)) ## [v0.19.5] - 2026-03-20 ### Changed diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/installer/PackageInstallerInstaller.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/installer/PackageInstallerInstaller.kt index 931bf48af..e65862330 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/installer/PackageInstallerInstaller.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/installer/PackageInstallerInstaller.kt @@ -106,8 +106,13 @@ class PackageInstallerInstaller(private val service: Service) : Installer(servic override fun cancelEntry(entry: Entry): Boolean { activeSession?.let { (activeEntry, sessionId) -> if (activeEntry == entry) { - packageInstaller.abandonSession(sessionId) - return false + return try { + packageInstaller.abandonSession(sessionId) + false + } catch (_: SecurityException) { + // Highly likely the session has succeeded + true + } } } return true From b40f1d39751c18438770b61d39c95c6c3bc8d6ec Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Mon, 23 Mar 2026 21:12:30 +0600 Subject: [PATCH 4/6] Fix app crash on startup on some Android TV Why do you guys even exist --- CHANGELOG.md | 1 + .../tachiyomi/util/system/WebViewUtil.kt | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 521778e34..a9e627f61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co - Fix app crashing when trying to add extension repo with existing signature ([@AntsyLich](https://github.com/AntsyLich)) - Potentially fix 'database is locked' crash ([@AntsyLich](https://github.com/AntsyLich)) - Fix occasional crash when mass installing/uninstalling extension using `PackageManager` ([@AntsyLich](https://github.com/AntsyLich)) +- Fix app crash on startup on some Android TV ([@AntsyLich](https://github.com/AntsyLich)) ## [v0.19.5] - 2026-03-20 ### Changed diff --git a/core/common/src/main/kotlin/eu/kanade/tachiyomi/util/system/WebViewUtil.kt b/core/common/src/main/kotlin/eu/kanade/tachiyomi/util/system/WebViewUtil.kt index 0ca4361f8..39bebcbae 100644 --- a/core/common/src/main/kotlin/eu/kanade/tachiyomi/util/system/WebViewUtil.kt +++ b/core/common/src/main/kotlin/eu/kanade/tachiyomi/util/system/WebViewUtil.kt @@ -13,6 +13,7 @@ import kotlin.coroutines.resume object WebViewUtil { private const val CHROME_PACKAGE = "com.android.chrome" + private const val YOUTUBE_FOR_TV_PACKAGE = "com.google.android.youtube.tv" private const val SYSTEM_SETTINGS_PACKAGE = "com.android.settings" const val MINIMUM_WEBVIEW_VERSION = 118 @@ -56,13 +57,16 @@ object WebViewUtil { } fun spoofedPackageName(context: Context): String { - return try { - context.packageManager.getPackageInfo(CHROME_PACKAGE, PackageManager.GET_META_DATA) - - CHROME_PACKAGE - } catch (_: PackageManager.NameNotFoundException) { - SYSTEM_SETTINGS_PACKAGE - } + return runCatching { context.packageManager.getPackageInfo(CHROME_PACKAGE, 0) } + .recoverCatching { context.packageManager.getPackageInfo(SYSTEM_SETTINGS_PACKAGE, 0) } + .recoverCatching { context.packageManager.getPackageInfo(YOUTUBE_FOR_TV_PACKAGE, 0) } + .fold( + onSuccess = { it.packageName }, + onFailure = { + context.packageManager.getInstalledPackages(0) + .random().packageName + }, + ) } } From 3bde9672910d7125f59dcb15e29198aa7fe929f3 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Mon, 23 Mar 2026 21:25:08 +0600 Subject: [PATCH 5/6] Release v0.19.6 --- .github/ISSUE_TEMPLATE/1_request_feature.yml | 2 +- .github/ISSUE_TEMPLATE/2_report_issue.yml | 4 ++-- CHANGELOG.md | 15 +++++++++------ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/1_request_feature.yml b/.github/ISSUE_TEMPLATE/1_request_feature.yml index 0b76875f3..8e814e79c 100644 --- a/.github/ISSUE_TEMPLATE/1_request_feature.yml +++ b/.github/ISSUE_TEMPLATE/1_request_feature.yml @@ -30,7 +30,7 @@ body: required: true - label: I have written a short but informative title. required: true - - label: I have updated the app to version **[0.19.5](https://github.com/mihonapp/mihon/releases/latest)**. + - label: I have updated the app to version **[0.19.6](https://github.com/mihonapp/mihon/releases/latest)**. required: true - label: I will fill out all of the requested information in this form. required: true diff --git a/.github/ISSUE_TEMPLATE/2_report_issue.yml b/.github/ISSUE_TEMPLATE/2_report_issue.yml index 51afb59d3..659d9e7c5 100644 --- a/.github/ISSUE_TEMPLATE/2_report_issue.yml +++ b/.github/ISSUE_TEMPLATE/2_report_issue.yml @@ -52,7 +52,7 @@ body: label: Mihon version description: You can find your Mihon version in **More → About**. placeholder: | - Example: "0.19.5" + Example: "0.19.6" validations: required: true @@ -95,7 +95,7 @@ body: required: true - label: I have gone through the [FAQ](https://mihon.app/docs/faq/general) and [troubleshooting guide](https://mihon.app/docs/guides/troubleshooting/). required: true - - label: I have updated the app to version **[0.19.5](https://github.com/mihonapp/mihon/releases/latest)**. + - label: I have updated the app to version **[0.19.6](https://github.com/mihonapp/mihon/releases/latest)**. required: true - label: I have filled out all of the requested information in this form, including specific version numbers. required: true diff --git a/CHANGELOG.md b/CHANGELOG.md index a9e627f61..38ed8c838 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,11 +11,13 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co - `Other` - for technical stuff. ## [Unreleased] + +## [v0.19.6] - 2026-03-23 ### Fixed -- Fix app crashing when trying to add extension repo with existing signature ([@AntsyLich](https://github.com/AntsyLich)) -- Potentially fix 'database is locked' crash ([@AntsyLich](https://github.com/AntsyLich)) -- Fix occasional crash when mass installing/uninstalling extension using `PackageManager` ([@AntsyLich](https://github.com/AntsyLich)) -- Fix app crash on startup on some Android TV ([@AntsyLich](https://github.com/AntsyLich)) +- Fix app crashing when trying to add extension repo with existing signature ([@AntsyLich](https://github.com/AntsyLich)) ([`cb0e329`](https://github.com/mihonapp/mihon/commit/cb0e329)) +- Potentially fix 'database is locked' crash ([@AntsyLich](https://github.com/AntsyLich)) ([`f8e82b9`](https://github.com/mihonapp/mihon/commit/f8e82b9)) +- Fix occasional crash when mass installing/uninstalling extension using `PackageManager` ([@AntsyLich](https://github.com/AntsyLich)) ([`42daa3f`](https://github.com/mihonapp/mihon/commit/42daa3f)) +- Fix app crash on startup on some Android TV ([@AntsyLich](https://github.com/AntsyLich)) ([`b40f1d3`](https://github.com/mihonapp/mihon/commit/b40f1d3)) ## [v0.19.5] - 2026-03-20 ### Changed @@ -500,8 +502,9 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co - Branding to Mihon ([@AntsyLich](https://github.com/AntsyLich)) - Minimum supported Android version to 8 ([@AntsyLich](https://github.com/AntsyLich)) ([`dfb3091`](https://github.com/mihonapp/mihon/commit/dfb3091e380dda3e9bfb64bf5c9a685cf3a03d0e)) -[unreleased]: https://github.com/mihonapp/mihon/compare/v0.19.5...main -[v0.19.4]: https://github.com/mihonapp/mihon/compare/v0.19.4...v0.19.5 +[unreleased]: https://github.com/mihonapp/mihon/compare/v0.19.6...main +[v0.19.6]: https://github.com/mihonapp/mihon/compare/v0.19.5...v0.19.6 +[v0.19.5]: https://github.com/mihonapp/mihon/compare/v0.19.4...v0.19.5 [v0.19.4]: https://github.com/mihonapp/mihon/compare/v0.19.3...v0.19.4 [v0.19.3]: https://github.com/mihonapp/mihon/compare/v0.19.2...v0.19.3 [v0.19.2]: https://github.com/mihonapp/mihon/compare/v0.19.1...v0.19.2 From 54d2c7b9e06924b89a45633d1673a6c830fd4977 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Mon, 23 Mar 2026 22:31:36 +0600 Subject: [PATCH 6/6] Release v0.19.7 --- .github/ISSUE_TEMPLATE/1_request_feature.yml | 2 +- .github/ISSUE_TEMPLATE/2_report_issue.yml | 4 ++-- CHANGELOG.md | 6 +++++- app/build.gradle.kts | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/1_request_feature.yml b/.github/ISSUE_TEMPLATE/1_request_feature.yml index 8e814e79c..5f34c4b12 100644 --- a/.github/ISSUE_TEMPLATE/1_request_feature.yml +++ b/.github/ISSUE_TEMPLATE/1_request_feature.yml @@ -30,7 +30,7 @@ body: required: true - label: I have written a short but informative title. required: true - - label: I have updated the app to version **[0.19.6](https://github.com/mihonapp/mihon/releases/latest)**. + - label: I have updated the app to version **[0.19.7](https://github.com/mihonapp/mihon/releases/latest)**. required: true - label: I will fill out all of the requested information in this form. required: true diff --git a/.github/ISSUE_TEMPLATE/2_report_issue.yml b/.github/ISSUE_TEMPLATE/2_report_issue.yml index 659d9e7c5..701f210c0 100644 --- a/.github/ISSUE_TEMPLATE/2_report_issue.yml +++ b/.github/ISSUE_TEMPLATE/2_report_issue.yml @@ -52,7 +52,7 @@ body: label: Mihon version description: You can find your Mihon version in **More → About**. placeholder: | - Example: "0.19.6" + Example: "0.19.7" validations: required: true @@ -95,7 +95,7 @@ body: required: true - label: I have gone through the [FAQ](https://mihon.app/docs/faq/general) and [troubleshooting guide](https://mihon.app/docs/guides/troubleshooting/). required: true - - label: I have updated the app to version **[0.19.6](https://github.com/mihonapp/mihon/releases/latest)**. + - label: I have updated the app to version **[0.19.7](https://github.com/mihonapp/mihon/releases/latest)**. required: true - label: I have filled out all of the requested information in this form, including specific version numbers. required: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 38ed8c838..773204784 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co ## [Unreleased] +## [v0.19.7] - 2026-03-23 +Same as v0.19.6 + ## [v0.19.6] - 2026-03-23 ### Fixed - Fix app crashing when trying to add extension repo with existing signature ([@AntsyLich](https://github.com/AntsyLich)) ([`cb0e329`](https://github.com/mihonapp/mihon/commit/cb0e329)) @@ -502,7 +505,8 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co - Branding to Mihon ([@AntsyLich](https://github.com/AntsyLich)) - Minimum supported Android version to 8 ([@AntsyLich](https://github.com/AntsyLich)) ([`dfb3091`](https://github.com/mihonapp/mihon/commit/dfb3091e380dda3e9bfb64bf5c9a685cf3a03d0e)) -[unreleased]: https://github.com/mihonapp/mihon/compare/v0.19.6...main +[unreleased]: https://github.com/mihonapp/mihon/compare/v0.19.7...main +[v0.19.7]: https://github.com/mihonapp/mihon/compare/v0.19.6...v0.19.7 [v0.19.6]: https://github.com/mihonapp/mihon/compare/v0.19.5...v0.19.6 [v0.19.5]: https://github.com/mihonapp/mihon/compare/v0.19.4...v0.19.5 [v0.19.4]: https://github.com/mihonapp/mihon/compare/v0.19.3...v0.19.4 diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ad6624026..7fc56ac66 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -26,8 +26,8 @@ android { defaultConfig { applicationId = "app.mihon" - versionCode = 19 - versionName = "0.19.5" + versionCode = 20 + versionName = "0.19.7" buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"") buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")