mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-15 17:53:31 +01:00
[Settings]: version info now includes xcode build version if in debug config
This commit is contained in:
@@ -209,9 +209,27 @@ private extension SettingsViewController
|
|||||||
let BUILD_REVISION = "CFBundleRevision" // commit ID for now (but could be any, set by build env vars
|
let BUILD_REVISION = "CFBundleRevision" // commit ID for now (but could be any, set by build env vars
|
||||||
let CURRENT_PROJECT_VERSION = kCFBundleVersionKey as String
|
let CURRENT_PROJECT_VERSION = kCFBundleVersionKey as String
|
||||||
|
|
||||||
let XCODE_VERSION = "DTXcode"
|
func getXcodeVersion() -> String {
|
||||||
let XCODE_REVISION = "DTXcodeBuild"
|
let XCODE_VERSION = "DTXcode"
|
||||||
|
let XCODE_REVISION = "DTXcodeBuild"
|
||||||
|
|
||||||
|
let xcode = Bundle.main.object(forInfoDictionaryKey: XCODE_VERSION) as? String
|
||||||
|
let build = Bundle.main.object(forInfoDictionaryKey: XCODE_REVISION) as? String
|
||||||
|
|
||||||
|
var xcodeVersion = xcode.map { version in
|
||||||
|
// " - Xcode \(version) - " + (build.map { revision in "\(revision)" } ?? "") // Ex: "0.6.0 - Xcode 16.2 - 21ac1ef"
|
||||||
|
"Xcode \(version) - " + (build.map { revision in "\(revision)" } ?? "") // Ex: "0.6.0 - Xcode 16.2 - 21ac1ef"
|
||||||
|
} ?? ""
|
||||||
|
|
||||||
|
if let pairing = Bundle.main.object(forInfoDictionaryKey: "ALTPairingFile") as? String,
|
||||||
|
pairing != "<insert pairing file here>"{
|
||||||
|
xcodeVersion += " - true"
|
||||||
|
}
|
||||||
|
return xcodeVersion
|
||||||
|
}
|
||||||
|
|
||||||
|
var versionLabel: String = ""
|
||||||
|
|
||||||
if let installedApp = InstalledApp.fetchAltStore(in: DatabaseManager.shared.viewContext)
|
if let installedApp = InstalledApp.fetchAltStore(in: DatabaseManager.shared.viewContext)
|
||||||
{
|
{
|
||||||
#if BETA
|
#if BETA
|
||||||
@@ -219,40 +237,37 @@ private extension SettingsViewController
|
|||||||
let bundleVersion: String? = Bundle.main.object(forInfoDictionaryKey: CURRENT_PROJECT_VERSION) as? String
|
let bundleVersion: String? = Bundle.main.object(forInfoDictionaryKey: CURRENT_PROJECT_VERSION) as? String
|
||||||
let buildRevision: String? = Bundle.main.object(forInfoDictionaryKey: BUILD_REVISION) as? String
|
let buildRevision: String? = Bundle.main.object(forInfoDictionaryKey: BUILD_REVISION) as? String
|
||||||
|
|
||||||
let localizedVersion = bundleVersion.map { version in
|
var localizedVersion = bundleVersion.map { version in
|
||||||
"\(installedApp.version) (\(version))" + (buildRevision.map { revision in " - \(revision)" } ?? "") // Ex: "0.6.0 (0600) - 1acdef3"
|
"\(installedApp.version) (\(version))" + (buildRevision.map { revision in " - \(revision)" } ?? "") // Ex: "0.6.0 (0600) - 1acdef3"
|
||||||
} ?? installedApp.localizedVersion
|
} ?? installedApp.localizedVersion
|
||||||
|
|
||||||
#else
|
#else
|
||||||
let localizedVersion = installedApp.version
|
var localizedVersion = installedApp.version
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return NSLocalizedString(String(format: "Version %@", localizedVersion), comment: "SideStore Version")
|
versionLabel = NSLocalizedString(String(format: "Version %@", localizedVersion), comment: "SideStore Version")
|
||||||
}
|
}
|
||||||
else if let version = Bundle.main.object(forInfoDictionaryKey: MARKETING_VERSION_KEY) as? String
|
else if let version = Bundle.main.object(forInfoDictionaryKey: MARKETING_VERSION_KEY) as? String
|
||||||
{
|
{
|
||||||
var version = "SideStore \(version)"
|
var version = "SideStore \(version)"
|
||||||
|
|
||||||
let xcode = Bundle.main.object(forInfoDictionaryKey: XCODE_VERSION) as? String
|
|
||||||
let build = Bundle.main.object(forInfoDictionaryKey: XCODE_REVISION) as? String
|
|
||||||
|
|
||||||
version += xcode.map { version in
|
version += getXcodeVersion()
|
||||||
" - Xcode \(version) - " + (build.map { revision in "\(revision)" } ?? "") // Ex: "0.6.0 - Xcode 16.2 - 21ac1ef"
|
|
||||||
} ?? ""
|
|
||||||
|
|
||||||
if let pairing = Bundle.main.object(forInfoDictionaryKey: "ALTPairingFile") as? String,
|
|
||||||
pairing != "<insert pairing file here>"{
|
|
||||||
version += " - true"
|
|
||||||
}
|
|
||||||
|
|
||||||
return NSLocalizedString(String(format: "Version %@", version), comment: "SideStore Version")
|
versionLabel = NSLocalizedString(String(format: "Version %@", version), comment: "SideStore Version")
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var version = "SideStore\t"
|
var version = "SideStore\t"
|
||||||
version += "\n\(Bundle.Info.appbundleIdentifier)"
|
version += "\n\(Bundle.Info.appbundleIdentifier)"
|
||||||
return NSLocalizedString(version, comment: "SideStore Version")
|
versionLabel = NSLocalizedString(version, comment: "SideStore Version")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add xcode build version if in debug mode
|
||||||
|
#if DEBUG
|
||||||
|
versionLabel += "\n\(getXcodeVersion())"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return versionLabel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ public extension UserDefaults
|
|||||||
#keyPath(UserDefaults.isAppLimitDisabled): false,
|
#keyPath(UserDefaults.isAppLimitDisabled): false,
|
||||||
#keyPath(UserDefaults.isBetaUpdatesEnabled): false,
|
#keyPath(UserDefaults.isBetaUpdatesEnabled): false,
|
||||||
#keyPath(UserDefaults.isExportResignedAppEnabled): false,
|
#keyPath(UserDefaults.isExportResignedAppEnabled): false,
|
||||||
|
#keyPath(UserDefaults.isDebugModeEnabled): false,
|
||||||
#keyPath(UserDefaults.isVerboseOperationsLoggingEnabled): false,
|
#keyPath(UserDefaults.isVerboseOperationsLoggingEnabled): false,
|
||||||
#keyPath(UserDefaults.isBackgroundRefreshEnabled): true,
|
#keyPath(UserDefaults.isBackgroundRefreshEnabled): true,
|
||||||
#keyPath(UserDefaults.isIdleTimeoutDisableEnabled): true,
|
#keyPath(UserDefaults.isIdleTimeoutDisableEnabled): true,
|
||||||
|
|||||||
Reference in New Issue
Block a user