Shows AltStore build version in Settings for BETA builds

This commit is contained in:
Riley Testut
2023-05-18 16:03:27 -05:00
committed by Magesh K
parent 07bc34ae7a
commit 9bb6f7eac0

View File

@@ -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 {