Skip to content

Commit

Permalink
remove unsafe check for big sur 11.3 and lower
Browse files Browse the repository at this point in the history
Since we are no longer using `softwareupdate --download --all` this bug may no longer be triggering. This needs to be tested but I think it will work.
  • Loading branch information
erikng committed Dec 17, 2021
1 parent 6d25eb9 commit 322bc55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
18 changes: 6 additions & 12 deletions Nudge/UI/Main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,13 @@ class AppDelegate: NSObject, NSApplicationDelegate {
if Utils().demoModeEnabled() {
return
}
if Utils().unsafeSoftwareUpdate() {
// Temporary workaround for Big Sur bug
let msg = "Due to a bug in Big Sur 11.3 and lower, Nudge cannot reliably use /usr/sbin/softwareupdate to download updates. See https://openradar.appspot.com/radar?id=4987491098558464 for more information regarding this issue."
softwareupdateDownloadLog.warning("\(msg, privacy: .public)")
return
} else {
if asyncronousSoftwareUpdate && Utils().requireMajorUpgrade() == false {
DispatchQueue(label: "nudge-su", attributes: .concurrent).asyncAfter(deadline: .now(), execute: {
SoftwareUpdate().Download()
})
} else {

if asyncronousSoftwareUpdate && Utils().requireMajorUpgrade() == false {
DispatchQueue(label: "nudge-su", attributes: .concurrent).asyncAfter(deadline: .now(), execute: {
SoftwareUpdate().Download()
}
})
} else {
SoftwareUpdate().Download()
}
}

Expand Down
9 changes: 0 additions & 9 deletions Nudge/Utilities/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -473,15 +473,6 @@ struct Utils {
return simpleModeEnabled
}

func unsafeSoftwareUpdate() -> Bool {
let runningUnsafeSoftwareUpdateOSVersion = versionLessThan(currentVersion: currentOSVersion, newVersion: "11.4")
if runningUnsafeSoftwareUpdateOSVersion {
return true
} else {
return false
}
}

func updateDevice(userClicked: Bool = true) {
if userClicked {
let msg = "User clicked updateDevice"
Expand Down

0 comments on commit 322bc55

Please sign in to comment.