From 9bb6f7eac06e0285c6e0be1c1f2865938155bfeb 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 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/AltStore/Settings/SettingsViewController.swift b/AltStore/Settings/SettingsViewController.swift index 540727e6..6c418182 100644 --- a/AltStore/Settings/SettingsViewController.swift +++ b/AltStore/Settings/SettingsViewController.swift @@ -126,8 +126,18 @@ final class SettingsViewController: UITableViewController debugModeGestureRecognizer.numberOfTouchesRequired = 3 self.tableView.addGestureRecognizer(debugModeGestureRecognizer) - var versionString: String = "" - 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 { versionString += "SideStore \(version)" if let xcode = Bundle.main.object(forInfoDictionaryKey: "DTXcode") as? String {