- Minor fixes and cleanup

This commit is contained in:
Magesh K
2025-02-09 16:18:41 +05:30
parent 533655c96b
commit a8fd1a3e83
7 changed files with 164 additions and 164 deletions

View File

@@ -3505,7 +3505,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = "$(inherited)"; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = "$(inherited)";
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 6000; CURRENT_PROJECT_VERSION = "$(inherited)";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
@@ -3545,7 +3545,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = "$(inherited)"; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = "$(inherited)";
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 6000; CURRENT_PROJECT_VERSION = "$(inherited)";
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_COMPATIBILITY_VERSION = 1;
@@ -3587,7 +3587,7 @@
CODE_SIGN_ENTITLEMENTS = AltWidget/AltWidgetExtension.entitlements; CODE_SIGN_ENTITLEMENTS = AltWidget/AltWidgetExtension.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 6000; CURRENT_PROJECT_VERSION = "$(inherited)";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)";
ENABLE_DEBUG_DYLIB = NO; ENABLE_DEBUG_DYLIB = NO;
@@ -3622,7 +3622,7 @@
CODE_SIGN_ENTITLEMENTS = AltWidget/AltWidgetExtension.entitlements; CODE_SIGN_ENTITLEMENTS = AltWidget/AltWidgetExtension.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 6000; CURRENT_PROJECT_VERSION = "$(inherited)";
DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)";
ENABLE_DEBUG_DYLIB = NO; ENABLE_DEBUG_DYLIB = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)"; FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@@ -3793,7 +3793,7 @@
CODE_SIGN_ENTITLEMENTS = AltStore/AltStore.entitlements; CODE_SIGN_ENTITLEMENTS = AltStore/AltStore.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 6000; CURRENT_PROJECT_VERSION = "$(inherited)";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)";
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
@@ -3814,7 +3814,7 @@
"$(PROJECT_DIR)/Dependencies/libcurl", "$(PROJECT_DIR)/Dependencies/libcurl",
); );
LLVM_LTO = YES_THIN; LLVM_LTO = YES_THIN;
MARKETING_VERSION = 0.6.0; MARKETING_VERSION = "$(inherited)";
OTHER_LDFLAGS = "$(inherited)"; OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)"; PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
@@ -3839,7 +3839,7 @@
CODE_SIGN_ENTITLEMENTS = AltStore/AltStore.entitlements; CODE_SIGN_ENTITLEMENTS = AltStore/AltStore.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 6000; CURRENT_PROJECT_VERSION = "$(inherited)";
DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)";
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_DEBUG_DYLIB = NO; ENABLE_DEBUG_DYLIB = NO;
@@ -3860,7 +3860,7 @@
"$(PROJECT_DIR)/Dependencies/libcurl", "$(PROJECT_DIR)/Dependencies/libcurl",
); );
LLVM_LTO = YES_THIN; LLVM_LTO = YES_THIN;
MARKETING_VERSION = 0.6.0; MARKETING_VERSION = "$(inherited)";
OTHER_LDFLAGS = "$(inherited)"; OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)"; PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";

View File

@@ -289,11 +289,10 @@ private extension SettingsViewController
versionLabel = NSLocalizedString(String(format: "Version %@", localizedVersion), comment: "SideStore Version") versionLabel = NSLocalizedString(String(format: "Version %@", localizedVersion), comment: "SideStore Version")
} }
else if var version = buildInfo.marketing_version else if let version = buildInfo.marketing_version
{ {
versionLabel = 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"
@@ -303,10 +302,7 @@ private extension SettingsViewController
// add xcode build version for local builds // add xcode build version for local builds
if let installedApp, if let installedApp,
let version = installedApp.storeApp?.latestSupportedVersion?.version, SemanticVersion(installedApp.version)?.preRelease == "local"
// if MARKETING_VERSION is set as "0.6.0-local" in CodeSigning.xcconfig as override,
// then it is assumed it is local build and we should show xcode build information
SemanticVersion(version)?.preRelease == "local"
{ {
versionLabel += "\n\(getXcodeVersion())" versionLabel += "\n\(getXcodeVersion())"
} }

View File

@@ -222,7 +222,7 @@ extension MergePolicy{
// When conflict.databaseObject is available, it means this is replace (delete + insert) or update // When conflict.databaseObject is available, it means this is replace (delete + insert) or update
private func resolveWhenDatabaseObjectAvailable(_ conflicts: [NSConstraintConflict]) throws { private func resolveWhenDatabaseObjectAvailable(_ conflicts: [NSConstraintConflict]) throws {
for conflict in conflicts for conflict in conflicts
{ {
switch conflict.databaseObject switch conflict.databaseObject
@@ -354,7 +354,7 @@ extension MergePolicy{
do do
{ {
var appVersions = databaseObject.versions var appVersions = databaseObject.versions
if let globallyUniqueID = databaseObject.globallyUniqueID if let globallyUniqueID = databaseObject.globallyUniqueID
{ {
// Permissions // Permissions
@@ -365,16 +365,16 @@ extension MergePolicy{
// Sorting order doesn't matter, but elements themselves don't match so throw error. // Sorting order doesn't matter, but elements themselves don't match so throw error.
throw MergeError.incorrectPermissions(for: databaseObject) throw MergeError.incorrectPermissions(for: databaseObject)
} }
// App versions // App versions
if let sortedAppVersionIDs = sortedVersionIDsByGlobalAppID[globallyUniqueID], if let sortedAppVersionIDs = sortedVersionIDsByGlobalAppID[globallyUniqueID],
let sortedAppVersionsIDsArray = sortedAppVersionIDs.array as? [String], let sortedAppVersionsIDsArray = sortedAppVersionIDs.array as? [String],
case let databaseVersionIDs = databaseObject.versions.map({ $0.versionID }), case let databaseVersionIDs = databaseObject.versions.map({ $0.versionID }),
databaseVersionIDs != sortedAppVersionsIDsArray databaseVersionIDs != sortedAppVersionsIDsArray
{ {
// databaseObject.versions post-merge doesn't match contextApp.versions pre-merge, so attempt to fix by re-sorting. // databaseObject.versions post-merge doesn't match contextApp.versions pre-merge, so attempt to fix by re-sorting.
let fixedAppVersions = databaseObject.versions.sorted { (versionA, versionB) in let fixedAppVersions = databaseObject.versions.sorted { (versionA, versionB) in
let indexA = sortedAppVersionIDs.index(of: versionA.versionID) let indexA = sortedAppVersionIDs.index(of: versionA.versionID)
let indexB = sortedAppVersionIDs.index(of: versionB.versionID) let indexB = sortedAppVersionIDs.index(of: versionB.versionID)
return indexA < indexB return indexA < indexB
@@ -387,16 +387,19 @@ extension MergePolicy{
} }
appVersions = fixedAppVersions appVersions = fixedAppVersions
// Always update versions post-merging to make sure latestSupportedVersion is correct.
try databaseObject.setVersions(appVersions)
} }
// Screenshots // Screenshots
if let sortedScreenshotIDs = sortedScreenshotIDsByGlobalAppID[globallyUniqueID], if let sortedScreenshotIDs = sortedScreenshotIDsByGlobalAppID[globallyUniqueID],
let sortedScreenshotIDsArray = sortedScreenshotIDs.array as? [String], let sortedScreenshotIDsArray = sortedScreenshotIDs.array as? [String],
case let databaseScreenshotIDs = databaseObject.allScreenshots.map({ $0.screenshotID }), case let databaseScreenshotIDs = databaseObject.allScreenshots.map({ $0.screenshotID }),
databaseScreenshotIDs != sortedScreenshotIDsArray databaseScreenshotIDs != sortedScreenshotIDsArray
{ {
// Screenshot order is incorrect, so attempt to fix by re-sorting. // Screenshot order is incorrect, so attempt to fix by re-sorting.
let fixedScreenshots = databaseObject.allScreenshots.sorted { (screenshotA, screenshotB) in let fixedScreenshots = databaseObject.allScreenshots.sorted { (screenshotA, screenshotB) in
let indexA = sortedScreenshotIDs.index(of: screenshotA.screenshotID) let indexA = sortedScreenshotIDs.index(of: screenshotA.screenshotID)
let indexB = sortedScreenshotIDs.index(of: screenshotB.screenshotID) let indexB = sortedScreenshotIDs.index(of: screenshotB.screenshotID)
return indexA < indexB return indexA < indexB
@@ -415,8 +418,6 @@ extension MergePolicy{
} }
} }
// Always update versions post-merging to make sure latestSupportedVersion is correct.
try databaseObject.setVersions(appVersions)
} }
catch catch
{ {

View File

@@ -33,172 +33,171 @@ public extension Source
#endif #endif
} }
public struct AppPermissionFeed: Codable { // public struct AppPermissionFeed: Codable {
let type: String // ALTAppPermissionType // let type: String // ALTAppPermissionType
let usageDescription: String // let usageDescription: String
enum CodingKeys: String, CodingKey // enum CodingKeys: String, CodingKey
{ // {
case type // case type
case usageDescription // case usageDescription
} // }
} // }
public struct AppVersionFeed: Codable { // public struct AppVersionFeed: Codable {
/* Properties */ // /* Properties */
let version: String // let version: String
let date: Date // let date: Date
let localizedDescription: String? // let localizedDescription: String?
let downloadURL: URL // let downloadURL: URL
let size: Int64 // let size: Int64
// added in 0.6.0 // // added in 0.6.0
let sha256: String? // sha 256 of the uploaded IPA // let sha256: String? // sha 256 of the uploaded IPA
enum CodingKeys: String, CodingKey // enum CodingKeys: String, CodingKey
{ // {
case version // case version
case date // case date
case localizedDescription // case localizedDescription
case downloadURL // case downloadURL
case size // case size
// added in 0.6.0 // // added in 0.6.0
case sha256 // case sha256
} // }
} // }
public struct PlatformURLFeed: Codable { // public struct PlatformURLFeed: Codable {
/* Properties */ // /* Properties */
let platform: Platform // let platform: Platform
let downloadURL: URL // let downloadURL: URL
private enum CodingKeys: String, CodingKey // private enum CodingKeys: String, CodingKey
{ // {
case platform // case platform
case downloadURL // case downloadURL
} // }
} // }
public struct StoreAppFeed: Codable { // public struct StoreAppFeed: Codable {
let name: String // let name: String
let bundleIdentifier: String // let bundleIdentifier: String
let subtitle: String? // let subtitle: String?
let developerName: String // let developerName: String
let localizedDescription: String // let localizedDescription: String
let size: Int64 // let size: Int64
let iconURL: URL // let iconURL: URL
let screenshotURLs: [URL] // let screenshotURLs: [URL]
let version: String // let version: String
let versionDate: Date // let versionDate: Date
let versionDescription: String? // let versionDescription: String?
let downloadURL: URL // let downloadURL: URL
let platformURLs: [PlatformURLFeed]? // let platformURLs: [PlatformURLFeed]?
let tintColor: String? // UIColor? // let tintColor: String? // UIColor?
let isBeta: Bool // let isBeta: Bool
// let source: Source? // // let source: Source?
let appPermissions: [AppPermissionFeed] // let appPermissions: [AppPermissionFeed]
let versions: [AppVersionFeed] // let versions: [AppVersionFeed]
enum CodingKeys: String, CodingKey // enum CodingKeys: String, CodingKey
{ // {
case bundleIdentifier // case bundleIdentifier
case developerName // case developerName
case downloadURL // case downloadURL
case iconURL // case iconURL
case isBeta = "beta" // case isBeta = "beta"
case localizedDescription // case localizedDescription
case name // case name
case appPermissions // case appPermissions
case platformURLs // case platformURLs
case screenshotURLs // case screenshotURLs
case size // case size
case subtitle // case subtitle
case tintColor // case tintColor
case version // case version
case versionDate // case versionDate
case versionDescription // case versionDescription
case versions // case versions
} // }
} // }
public struct NewsItemFeed: Codable { // public struct NewsItemFeed: Codable {
let identifier: String // let identifier: String
let date: Date // let date: Date
let title: String // let title: String
let caption: String // let caption: String
let tintColor: String //UIColor // let tintColor: String //UIColor
let notify: Bool // let notify: Bool
let imageURL: URL? // let imageURL: URL?
let externalURL: URL? // let externalURL: URL?
let appID: String? // let appID: String?
private enum CodingKeys: String, CodingKey // private enum CodingKeys: String, CodingKey
{ // {
case identifier // case identifier
case date // case date
case title // case title
case caption // case caption
case tintColor // case tintColor
case imageURL // case imageURL
case externalURL = "url" // case externalURL = "url"
case appID // case appID
case notify // case notify
} // }
} // }
public struct SourceJSON: Codable { // public struct SourceJSON: Codable {
let version: Int? // let version: Int?
let name: String // let name: String
let identifier: String // let identifier: String
let sourceURL: URL // let sourceURL: URL
let userInfo: [String:String]? //[ALTSourceUserInfoKey:String]? // let userInfo: [String:String]? //[ALTSourceUserInfoKey:String]?
let apps: [StoreAppFeed] // let apps: [StoreAppFeed]
let news: [NewsItemFeed] // let news: [NewsItemFeed]
enum CodingKeys: String, CodingKey // enum CodingKeys: String, CodingKey
{ // {
case version // case version
case name // case name
case identifier // case identifier
case sourceURL // case sourceURL
case userInfo // case userInfo
case apps // case apps
case news // case news
} // }
// }
}
public extension Source public extension Source
{ {
// Fallbacks for optional JSON values. // Fallbacks for optional JSON values.
var effectiveIconURL: URL? { var effectiveIconURL: URL? {
return self.iconURL ?? self.apps.first?.iconURL return self.iconURL ?? self.apps.first?.iconURL
} }
var effectiveHeaderImageURL: URL? { var effectiveHeaderImageURL: URL? {
return self.headerImageURL ?? self.effectiveIconURL return self.headerImageURL ?? self.effectiveIconURL
} }
var effectiveTintColor: UIColor? { var effectiveTintColor: UIColor? {
return self.tintColor ?? self.apps.first?.tintColor return self.tintColor ?? self.apps.first?.tintColor
} }
var effectiveFeaturedApps: [StoreApp] { var effectiveFeaturedApps: [StoreApp] {
return self.featuredApps ?? self.apps return self.featuredApps ?? self.apps
} }
} }
@objc(Source) @objc(Source)
public class Source: BaseEntity, Decodable public class Source: BaseEntity, Decodable

View File

@@ -3,12 +3,16 @@
// https://developer.apple.com/account/#/membership // https://developer.apple.com/account/#/membership
DEVELOPMENT_TEAM = XYZ0123456 DEVELOPMENT_TEAM = XYZ0123456
// Set this for dev-local xcode builds
MARKETING_VERSION_SUFFIX = -local
// Prefix of unique bundle IDs registered to you in Apple Developer Portal. // Prefix of unique bundle IDs registered to you in Apple Developer Portal.
// You need to register: // You need to register:
// - com.myuniquename.provenance // - com.myuniquename.provenance
// - com.myuniquename.provenance.spotlight // - com.myuniquename.provenance.spotlight
// - com.myuniquename.provenance.topshelf // - com.myuniquename.provenance.topshelf
ORG_IDENTIFIER = com.myuniquename // Uncomment the folowing and customize it to set the override:
//ORG_IDENTIFIER = com.myuniquename
// add team ID to bundle ID for debug builds since these will most likely be installed via Xcode // add team ID to bundle ID for debug builds since these will most likely be installed via Xcode
// SideStore will expect the team ID to be at the end of the bundle ID, but this doesn't happen when we install via Xcode // SideStore will expect the team ID to be at the end of the bundle ID, but this doesn't happen when we install via Xcode

View File

@@ -7,8 +7,6 @@ RUBY := $(shell command -v ruby 2>/dev/null)
HOMEBREW := $(shell command -v brew 2>/dev/null) HOMEBREW := $(shell command -v brew 2>/dev/null)
BUNDLER := $(shell command -v bundle 2>/dev/null) BUNDLER := $(shell command -v bundle 2>/dev/null)
default: help
# Add the following 'help' target to your Makefile # Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#' # And add help text after each target name starting with '\#\#'
# A category can be added with @category # A category can be added with @category

View File

@@ -14,11 +14,13 @@ SIZE = os.getenv("SIZE")
SHA256 = os.getenv("SHA256") SHA256 = os.getenv("SHA256")
LOCALIZED_DESCRIPTION = os.getenv("LOCALIZED_DESCRIPTION") LOCALIZED_DESCRIPTION = os.getenv("LOCALIZED_DESCRIPTION")
DOWNLOAD_URL = os.getenv("DOWNLOAD_URL") DOWNLOAD_URL = os.getenv("DOWNLOAD_URL")
# BUNDLE_IDENTIFIER = os.getenv("BUNDLE_IDENTIFIER", SIDESTORE_BUNDLE_ID)
BUNDLE_IDENTIFIER = os.getenv("BUNDLE_IDENTIFIER") BUNDLE_IDENTIFIER = os.getenv("BUNDLE_IDENTIFIER")
# Uncomment to debug/test by simulating dummy input locally # Uncomment to debug/test by simulating dummy input locally
# VERSION_IPA = os.getenv("VERSION_IPA", "0.0.0") # VERSION_IPA = os.getenv("VERSION_IPA", "0.0.0")
# VERSION_DATE = os.getenv("VERSION_DATE", "2000-12-18T00:00:00Z") # VERSION_DATE = os.getenv("VERSION_DATE", "2000-12-18T00:00:00Z")
# IS_BETA = os.getenv("IS_BETA", True)
# SIZE = int(os.getenv("SIZE", "0")) # Convert to integer # SIZE = int(os.getenv("SIZE", "0")) # Convert to integer
# SHA256 = os.getenv("SHA256", "") # SHA256 = os.getenv("SHA256", "")
# LOCALIZED_DESCRIPTION = os.getenv("LOCALIZED_DESCRIPTION", "Invalid Update") # LOCALIZED_DESCRIPTION = os.getenv("LOCALIZED_DESCRIPTION", "Invalid Update")