Skip to content

Commit

Permalink
Updated detection of lower versions
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminHalko committed Jul 27, 2024
1 parent 9527c9a commit 874f8ba
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ class PatcherViewModel(
val existingPackageInfo = pm.getPackageInfo(packageName)
if (existingPackageInfo != null) {
// Check if the app version is less than the installed version
if (versionNameToInt(existingPackageInfo.versionName) < versionNameToInt(input.selectedApp.version)) {
if (versionNameToInt(input.selectedApp.version) < versionNameToInt(existingPackageInfo.versionName)) {
// Exit if the selected app version is less than the installed version
installerStatusDialogModel.packageInstallerStatus = PackageInstaller.STATUS_FAILURE_CONFLICT
return@launch
Expand Down Expand Up @@ -384,7 +384,7 @@ class PatcherViewModel(
uiSafe(app, R.string.reinstall_app_fail, "Failed to reinstall") {
pm.getPackageInfo(outputFile)?.packageName?.let { pm.uninstallPackage(it) }
?: throw Exception("Failed to load application info")

pm.installApp(listOf(outputFile))
}
}
Expand Down

0 comments on commit 874f8ba

Please sign in to comment.