From eebb777422e9446b7f9030cc579d358381a737b3 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Thu, 18 May 2023 16:03:27 -0500 Subject: [PATCH] Shows AltStore build version in Settings for BETA builds --- AltStore/Settings/SettingsViewController.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/AltStore/Settings/SettingsViewController.swift b/AltStore/Settings/SettingsViewController.swift index 6ab60793..a38103b5 100644 --- a/AltStore/Settings/SettingsViewController.swift +++ b/AltStore/Settings/SettingsViewController.swift @@ -101,7 +101,18 @@ class SettingsViewController: UITableViewController debugModeGestureRecognizer.numberOfTouchesRequired = 3 self.tableView.addGestureRecognizer(debugModeGestureRecognizer) - if let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String + if let installedApp = InstalledApp.fetchAltStore(in: DatabaseManager.shared.viewContext) + { + #if BETA + // Only show build version for BETA builds. + let localizedVersion = installedApp.localizedVersion + #else + let localizedVersion = installedApp.version + #endif + + self.versionLabel.text = NSLocalizedString(String(format: "AltStore %@", localizedVersion), comment: "AltStore Version") + } + else if let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String { self.versionLabel.text = NSLocalizedString(String(format: "AltStore %@", version), comment: "AltStore Version") }