From fe558b2df07acf2c966f5a28e704e6d2e944b6a1 Mon Sep 17 00:00:00 2001 From: Diamond <33725716+DiamondMiner88@users.noreply.github.com> Date: Sat, 17 Dec 2022 11:53:50 -0800 Subject: [PATCH] fix: libs download cached state --- .../aliucord/manager/ui/viewmodel/InstallViewModel.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/aliucord/manager/ui/viewmodel/InstallViewModel.kt b/app/src/main/kotlin/com/aliucord/manager/ui/viewmodel/InstallViewModel.kt index d8d8461..fa59a9b 100644 --- a/app/src/main/kotlin/com/aliucord/manager/ui/viewmodel/InstallViewModel.kt +++ b/app/src/main/kotlin/com/aliucord/manager/ui/viewmodel/InstallViewModel.kt @@ -251,7 +251,10 @@ class InstallViewModel( // Download the hermes-release.aar file to replace in the apk val hermes = cacheDir.resolve("hermes-release-${latestHermesRelease.tagName}.aar").also { file -> - if (file.exists()) return@also + if (file.exists()) { + cached = true + return@also + } latestHermesRelease.assets .find { it.name == "hermes-release.aar" }!!.browserDownloadUrl @@ -261,6 +264,7 @@ class InstallViewModel( // Download the hermes-cppruntime-release.aar file to replace in the apk val cppRuntime = cacheDir.resolve("hermes-cppruntime-release-${latestHermesRelease.tagName}.aar").also { file -> if (file.exists()) return@also + cached = false latestHermesRelease.assets .find { it.name == "hermes-cppruntime-release.aar" }!!.browserDownloadUrl @@ -277,7 +281,10 @@ class InstallViewModel( // Download the Aliucord classes.dex file to add to the apk cacheDir.resolve("aliucord-${latestAliucordNativeRelease.tagName}.dex").also { file -> - if (file.exists()) return@also + if (file.exists()) { + cached = true + return@also + } latestAliucordNativeRelease.assets .find { it.name == "classes.dex" }!!.browserDownloadUrl