From 8d40e20b7de49056940a6f07378778934724534a Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Sat, 27 Aug 2022 22:12:59 +0600 Subject: [PATCH] Prevent unofficial exts from getting marked as obsolete or updateable (#7871) * Prevent unofficial exts from getting marked as obsolete * Prevent unofficial ext `hasUpdate` getting marked as true --- .../main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt | 2 +- .../eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt index 2d441e60d8..f13a6298ad 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt @@ -184,7 +184,7 @@ class ExtensionManager( val pkgName = installedExt.pkgName val availableExt = availableExtensions.find { it.pkgName == pkgName } - if (availableExt == null && !installedExt.isObsolete) { + if (!installedExt.isUnofficial && availableExt == null && !installedExt.isObsolete) { mutInstalledExtensions[index] = installedExt.copy(isObsolete = true) changed = true } else if (availableExt != null) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt index 853e0e8e9e..acbf0d56cb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt @@ -80,7 +80,7 @@ internal class ExtensionGithubApi { val pkgName = installedExt.pkgName val availableExt = extensions.find { it.pkgName == pkgName } ?: continue - val hasUpdate = availableExt.versionCode > installedExt.versionCode + val hasUpdate = installedExt.isUnofficial.not() && (availableExt.versionCode > installedExt.versionCode) if (hasUpdate) { extensionsWithUpdate.add(installedExt) }