Skip to content

Commit

Permalink
Merge pull request #297 from macadmins/development
Browse files Browse the repository at this point in the history
1.1.4 Official Release
  • Loading branch information
erikng committed Jan 25, 2022
2 parents 91576ce + 9c7b633 commit 505b57b
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 60 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_nudge_pr.yml
Expand Up @@ -14,6 +14,7 @@ jobs:
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Install Apple Xcode certificates
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_nudge_prerelease.yml
Expand Up @@ -18,6 +18,8 @@ jobs:

- name: Checkout nudge repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install Apple Xcode certificates
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_nudge_prerelease_manual.yml
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout nudge repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install Apple Xcode certificates
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_nudge_release.yml
Expand Up @@ -19,6 +19,8 @@ jobs:
steps:
- name: Checkout nudge repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install Apple Xcode certificates
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_nudge_release_manual.yml
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout nudge repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install Apple Xcode certificates
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
Expand Down
2 changes: 1 addition & 1 deletion Example Assets/com.github.macadmins.Nudge.json
Expand Up @@ -4,7 +4,7 @@
"us.zoom.xos"
],
"aggressiveUserExperience": true,
"asyncronousSoftwareUpdate": true,
"asynchronousSoftwareUpdate": true,
"attemptToFetchMajorUpgrade": true,
"enforceMinorUpdates": true
},
Expand Down
2 changes: 1 addition & 1 deletion Example Assets/com.github.macadmins.Nudge.mobileconfig
Expand Up @@ -27,7 +27,7 @@
</array>
<key>aggressiveUserExperience</key>
<true/>
<key>asyncronousSoftwareUpdate</key>
<key>asynchronousSoftwareUpdate</key>
<true/>
<key>attemptToFetchMajorUpgrade</key>
<true/>
Expand Down
8 changes: 4 additions & 4 deletions Nudge.xcodeproj/project.pbxproj
Expand Up @@ -615,7 +615,7 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.1.3;
CURRENT_PROJECT_VERSION = 1.1.4;
DEVELOPMENT_ASSET_PATHS = "\"Nudge/Preview Content\"";
DEVELOPMENT_TEAM = 9GQZ7KUFR6;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -626,7 +626,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.1.3;
MARKETING_VERSION = 1.1.4;
PRODUCT_BUNDLE_IDENTIFIER = com.github.macadmins.Nudge;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -644,7 +644,7 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.1.3;
CURRENT_PROJECT_VERSION = 1.1.4;
DEVELOPMENT_ASSET_PATHS = "\"Nudge/Preview Content\"";
DEVELOPMENT_TEAM = 9GQZ7KUFR6;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -655,7 +655,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.1.3;
MARKETING_VERSION = 1.1.4;
PRODUCT_BUNDLE_IDENTIFIER = com.github.macadmins.Nudge;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
4 changes: 2 additions & 2 deletions Nudge/Info.plist
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.1.3</string>
<string>1.1.4</string>
<key>CFBundleVersion</key>
<string>1.1.3</string>
<string>1.1.4</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Nudge/Preferences/DefaultPreferencesNudge.swift
Expand Up @@ -16,7 +16,7 @@ let optionalFeaturesProfile = getOptionalFeaturesProfile()
let optionalFeaturesJSON = getOptionalFeaturesJSON()
let aggressiveUserExperience = optionalFeaturesProfile?["aggressiveUserExperience"] as? Bool ?? optionalFeaturesJSON?.aggressiveUserExperience ?? true
let customAcceptableApplicationBundleIDs = optionalFeaturesProfile?["acceptableApplicationBundleIDs"] as? [String] ?? optionalFeaturesJSON?.acceptableApplicationBundleIDs ?? [""]
let asyncronousSoftwareUpdate = optionalFeaturesProfile?["asyncronousSoftwareUpdate"] as? Bool ?? optionalFeaturesJSON?.asyncronousSoftwareUpdate ?? true
let asynchronousSoftwareUpdate = optionalFeaturesProfile?["asynchronousSoftwareUpdate"] as? Bool ?? optionalFeaturesJSON?.asynchronousSoftwareUpdate ?? true
let attemptToFetchMajorUpgrade = optionalFeaturesProfile?["attemptToFetchMajorUpgrade"] as? Bool ?? optionalFeaturesJSON?.attemptToFetchMajorUpgrade ?? true
let enforceMinorUpdates = optionalFeaturesProfile?["enforceMinorUpdates"] as? Bool ?? optionalFeaturesJSON?.enforceMinorUpdates ?? true

Expand Down
6 changes: 3 additions & 3 deletions Nudge/Preferences/PreferencesStructure.swift
Expand Up @@ -59,7 +59,7 @@ extension NudgePreferences {
// MARK: - OptionalFeatures
struct OptionalFeatures: Codable {
var acceptableApplicationBundleIDs: [String]?
var aggressiveUserExperience, asyncronousSoftwareUpdate, attemptToFetchMajorUpgrade, enforceMinorUpdates: Bool?
var aggressiveUserExperience, asynchronousSoftwareUpdate, attemptToFetchMajorUpgrade, enforceMinorUpdates: Bool?
}

// MARK: OptionalFeatures convenience initializers and mutators
Expand All @@ -83,14 +83,14 @@ extension OptionalFeatures {
func with(
acceptableApplicationBundleIDs: [String]?? = nil,
aggressiveUserExperience: Bool?? = nil,
asyncronousSoftwareUpdate: Bool?? = nil,
asynchronousSoftwareUpdate: Bool?? = nil,
attemptToFetchMajorUpgrade: Bool?? = nil,
enforceMinorUpdates: Bool?? = nil
) -> OptionalFeatures {
return OptionalFeatures(
acceptableApplicationBundleIDs: acceptableApplicationBundleIDs ?? self.acceptableApplicationBundleIDs,
aggressiveUserExperience: aggressiveUserExperience ?? self.aggressiveUserExperience,
asyncronousSoftwareUpdate: asyncronousSoftwareUpdate ?? self.asyncronousSoftwareUpdate,
asynchronousSoftwareUpdate: asynchronousSoftwareUpdate ?? self.asynchronousSoftwareUpdate,
attemptToFetchMajorUpgrade: attemptToFetchMajorUpgrade ?? self.attemptToFetchMajorUpgrade,
enforceMinorUpdates: enforceMinorUpdates ?? self.enforceMinorUpdates
)
Expand Down
18 changes: 6 additions & 12 deletions Nudge/UI/Main.swift
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 asynchronousSoftwareUpdate && Utils().requireMajorUpgrade() == false {
DispatchQueue(label: "nudge-su", attributes: .concurrent).asyncAfter(deadline: .now(), execute: {
SoftwareUpdate().Download()
}
})
} else {
SoftwareUpdate().Download()
}
}

Expand Down
24 changes: 14 additions & 10 deletions Nudge/Utilities/SoftwareUpdate.swift
Expand Up @@ -86,7 +86,7 @@ class SoftwareUpdate {
do {
try task.run()
} catch {
let msg = "Error downloading software updates"
let msg = "Error downloading software update"
softwareupdateListLog.error("\(msg, privacy: .public)")
}

Expand All @@ -99,7 +99,7 @@ class SoftwareUpdate {
let _ = String(decoding: errorData, as: UTF8.self)

if task.terminationStatus != 0 {
softwareupdateDownloadLog.error("Error downloading software updates: \(output, privacy: .public)")
softwareupdateDownloadLog.error("Error downloading software update: \(output, privacy: .public)")
} else {
let msg = "softwareupdate successfully downloaded available update application - updating application paths"
softwareupdateListLog.notice("\(msg, privacy: .public)")
Expand All @@ -114,13 +114,18 @@ class SoftwareUpdate {
}
} else {
let softwareupdateList = self.List()
var updateLabel = ""
for update in softwareupdateList.components(separatedBy: "\n") {
if update.contains("Label:") {
updateLabel = update.components(separatedBy: ": ")[1]
}
}

if softwareupdateList.contains("restart") {
let msg = "softwareupdate found available updates requiring a restart - attempting download"
softwareupdateListLog.notice("\(msg, privacy: .public)")
if softwareupdateList.contains(requiredMinimumOSVersionNormalized) && updateLabel.isEmpty == false {
softwareupdateListLog.notice("softwareupdate found \(updateLabel, privacy: .public) available for download - attempting download")
let task = Process()
task.launchPath = "/usr/sbin/softwareupdate"
task.arguments = ["--download", "--all"]
task.arguments = ["--download", "\(updateLabel)"]

let outputPipe = Pipe()
let errorPipe = Pipe()
Expand All @@ -131,7 +136,7 @@ class SoftwareUpdate {
do {
try task.run()
} catch {
let msg = "Error downloading software updates"
let msg = "Error downloading software update"
softwareupdateListLog.error("\(msg, privacy: .public)")
}

Expand All @@ -146,13 +151,12 @@ class SoftwareUpdate {
if task.terminationStatus != 0 {
softwareupdateDownloadLog.error("Error downloading software updates: \(error, privacy: .public)")
} else {
let msg = "softwareupdate successfully downloaded available updates"
let msg = "softwareupdate successfully downloaded available update"
softwareupdateListLog.notice("\(msg, privacy: .public)")
softwareupdateDownloadLog.info("\(output, privacy: .public)")
}
} else {
let msg = "softwareupdate did not find any available updates requiring a restart - skipping download"
softwareupdateListLog.notice("\(msg, privacy: .public)")
softwareupdateListLog.notice("softwareupdate did not find \(requiredMinimumOSVersionNormalized, privacy: .public) available for download - skipping download attempt")
}
}
}
Expand Down
9 changes: 0 additions & 9 deletions Nudge/Utilities/Utils.swift
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
2 changes: 1 addition & 1 deletion Schema/jamf/com.github.macadmins.Nudge.json
Expand Up @@ -50,7 +50,7 @@
}
]
},
"asyncronousSoftwareUpdate": {
"asynchronousSoftwareUpdate": {
"description": "When disabled, Nudge will wait for Software Update to finish downloading (if any) updates before showing the UI.",
"anyOf": [
{
Expand Down
6 changes: 3 additions & 3 deletions build_nudge.zsh
Expand Up @@ -3,7 +3,7 @@
# Build script for Nudge

# Variables
XCODE_PATH="/Applications/Xcode_13.1.app"
XCODE_PATH="/Applications/Xcode_13.2.1.app"
CODE_SIGN_IDENTITY="Developer ID Application: Clever DevOps Co. (9GQZ7KUFR6)"
SIGNING_IDENTITY="Developer ID Installer: Clever DevOps Co. (9GQZ7KUFR6)"
MP_SHA="71c57fcfdf43692adcd41fa7305be08f66bae3e5"
Expand All @@ -17,10 +17,10 @@ XCODE_BUILD_PATH="$XCODE_PATH/Contents/Developer/usr/bin/xcodebuild"
XCODE_NOTARY_PATH="$XCODE_PATH/Contents/Developer/usr/bin/notarytool"
XCODE_STAPLER_PATH="$XCODE_PATH/Contents/Developer/usr/bin/stapler"
CURRENT_NUDGE_MAIN_BUILD_VERSION=$(/usr/libexec/PlistBuddy -c Print:CFBundleVersion $TOOLSDIR/Nudge/Info.plist)
DATE=$(/bin/date -u "+%m%d%Y%H%M%S")
NEWSUBBUILD=$((80620 + $(git rev-parse HEAD~0 | xargs -I{} git rev-list --count {})))

# automate the build version bump
AUTOMATED_NUDGE_BUILD="$CURRENT_NUDGE_MAIN_BUILD_VERSION.$DATE"
AUTOMATED_NUDGE_BUILD="$CURRENT_NUDGE_MAIN_BUILD_VERSION.$NEWSUBBUILD"
/usr/bin/xcrun agvtool new-version -all $AUTOMATED_NUDGE_BUILD
/usr/bin/xcrun agvtool new-marketing-version $AUTOMATED_NUDGE_BUILD

Expand Down
26 changes: 13 additions & 13 deletions ja.lproj/Localizable.strings
Expand Up @@ -9,30 +9,30 @@
//// Additional Device Information
"Additional Device Information" = "デバイスの追加情報";
// Username
"Username:" = "ユーザー名";
"Username:" = "ユーザー名:";
// Serial Number
"Serial Number:" = "シリアルナンバー";
"Serial Number:" = "シリアルナンバー:";
// Architecture
"Architecture:" = "アーキテクチャ";
"Architecture:" = "アーキテクチャ:";
// Nudge Version
"Version:" = "バージョン";
"Version:" = "バージョン:";
// Language
"Language:" = "言語";
"Language:" = "言語:";

//// Left side of Nudge
// Current OS Version
"Current OS Version:" = "現在のOSのバージョン";
"Current OS Version:" = "現在のOSのバージョン:";
// Required OS Version
"Required OS Version:" = "必要とされるOSのバージョン";
"Required OS Version:" = "必要とされるOSのバージョン:";
// Days Remaining To Update
"Days Remaining To Update:" = "更新までの残り日数";
"Days Remaining To Update:" = "更新までの残り日数:";
// Deferred Count
"Deferred Count:" = "延期した回数";
"Deferred Count:" = "延期した回数:";
// More Info
"More Info" = "詳細情報";

// Help buttons
"Click to close" = "クリックしてクローズ";
"Click to close" = "クリックして閉じる";
"Click for additional device information" = "クリックしてデバイスの追加情報を確認";
"Click to zoom into screenshot" = "クリックしスクリーンショットを拡大";
"Click for more information about the security update" = "クリックしてセキュリティ更新の詳細情報を確認";
Expand All @@ -42,13 +42,13 @@
"Your device will restart during this update" = "デバイスは更新中に再起動します";
"Important Notes" = "重要";
"Updates can take around 30 minutes to complete" = "更新の完了には約30分かかります";
"A fully up-to-date device is required to ensure that IT can accurately protect your device.\n\nIf you do not update your device, you may lose access to some items necessary for your day-to-day tasks.\n\nTo begin the update, simply click on the Update Device button and follow the provided steps." = "ITが正確にあなたのデバイスを守るためには、完全に最新のデバイスが必要です。\n\nデバイスを更新しない場合、日々のタスクに必要ばなアクセスが失われる可能性があります。\n\n更新を開始するには、デバイスの更新ボタンをクリックするのみです、後は指示されたステップに従いますってください。";
"A fully up-to-date device is required to ensure that IT can accurately protect your device.\n\nIf you do not update your device, you may lose access to some items necessary for your day-to-day tasks.\n\nTo begin the update, simply click on the Update Device button and follow the provided steps." = "ITが正確にあなたのデバイスを保護するためには、デバイスを完全に最新にすることが必要です。\n\nデバイスを更新しない場合、日々のタスクに必要なアイテムへのアクセスができなくなる可能性があります。\n\n更新を開始するにはデバイスの更新ボタンをクリックし、指示されたステップに従ってください。";
"Your device requires a security update" = "あなたのデバイスは更新が必要です";
"Your device requires a security update (Demo Mode)" = "あなたのデバイスはセキュリティの更新が必要です(デモモード)";
"Later" = "後で";
"I understand" = "わかりました";
"A friendly reminder from your local IT team" = "ローカルITチームからのリマインドです";
"Defer" = "延期";
"One Hour" = "1時間";
"One Day" = "1日";
"One Hour" = "1時間";
"One Day" = "1日";
"Custom" = "カスタム";

0 comments on commit 505b57b

Please sign in to comment.