From 66b390c62abc62aa5411ecec5cbde8f3229b5016 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Wed, 8 Jul 2026 13:43:17 +0600 Subject: [PATCH] Fix app not reading `tachiyomix.extensionLib` extension metadata (#3545) Android was interpreting the field as a float and failing (which is nuts imo) Also cleaned up the lib validation logic --- CHANGELOG.md | 1 + .../tachiyomi/extension/util/ExtensionLoader.kt | 17 ++++------------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7de9b58f8..0c62491a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co - Fix crash when putting app in background ([@AntsyLich](https://github.com/AntsyLich)) ([#3523](https://github.com/mihonapp/mihon/pull/3523)) - Fix support for non-system SAF providers ([@AntsyLich](https://github.com/AntsyLich)) ([#3530](https://github.com/mihonapp/mihon/pull/3530)) - Fix chapter's `memo` field not being updated for existing chapters ([@cuong-tran](https://github.com/cuong-tran)) ([#3538](https://github.com/mihonapp/mihon/pull/3538)) +- Fix app not reading `tachiyomix.extensionLib` extension metadata ([@AntsyLich](https://github.com/AntsyLich)) ([#3545](https://github.com/mihonapp/mihon/pull/3545)) ## [v0.20.0] - 2026-06-27 ### Added diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt index c5df74ac1..5fb222edd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt @@ -54,8 +54,7 @@ internal object ExtensionLoader { private const val METADATA_EXTENSION_LIB = "tachiyomix.extensionLib" private const val METADATA_CONTENT_WARNING = "tachiyomix.contentWarning" - const val LIB_VERSION_MIN = 1.4 - const val LIB_VERSION_MAX = 1.6 + private val SUPPORTED_LIB_VERSIONS = listOf(1.4, 1.6) @Suppress("DEPRECATION") private val PACKAGE_FLAGS = PackageManager.GET_CONFIGURATIONS or @@ -244,22 +243,14 @@ internal object ExtensionLoader { } // Validate lib version - val libVersion = appInfo.metaData.getDouble(METADATA_EXTENSION_LIB).takeUnless { it == 0.0 } + val libVersion = appInfo.metaData.getString(METADATA_EXTENSION_LIB)?.toDouble() ?: versionName.substringBeforeLast('.').toDoubleOrNull() - if (libVersion == null || (libVersion != LIB_VERSION_MIN && libVersion != LIB_VERSION_MAX)) { + if (libVersion == null || libVersion !in SUPPORTED_LIB_VERSIONS) { logcat(LogPriority.WARN) { - "Lib version is $libVersion, while only versions " + - "$LIB_VERSION_MIN and $LIB_VERSION_MAX is allowed" + "Lib version is $libVersion, while only version(s) ${SUPPORTED_LIB_VERSIONS.joinToString()} are supported" } return LoadResult.Error } -// if (libVersion == null || libVersion < LIB_VERSION_MIN || libVersion > LIB_VERSION_MAX) { -// logcat(LogPriority.WARN) { -// "Lib version is $libVersion, while only versions " + -// "$LIB_VERSION_MIN or $LIB_VERSION_MAX is allowed" -// } -// return LoadResult.Error -// } val signatures = getSignatures(pkgInfo) if (signatures.isNullOrEmpty()) {