- Store: Reverted localized version for Store and version to be independent

This commit is contained in:
Magesh K
2025-02-08 13:11:27 +05:30
parent 61086a681a
commit 77833c6ffc
8 changed files with 128 additions and 164 deletions

View File

@@ -100,11 +100,15 @@ jobs:
echo "cat Build.xcconfig"
cat Build.xcconfig
- name: Set Release Channel info for build number bumper
run: |
echo "RELEASE_CHANNEL=${{ inputs.release_tag }}" >> $GITHUB_OUTPUT
echo "RELEASE_CHANNEL=${RELEASE_CHANNEL}"
- name: Increase build number for beta builds
if: ${{ inputs.is_beta }}
run: |
echo "RELEASE_CHANNEL=${{ inputs.release_tag }}" >> $GITHUB_OUTPUT
bash .github/workflows/increase-beta-build-num.sh
- name: Extract MARKETING_VERSION from Build.xcconfig
@@ -218,10 +222,13 @@ jobs:
echo ""
- name: Set BundleID Suffix for Sidestore build
run: |
echo "BUNDLE_ID_SUFFIX=${{ inputs.bundle_id_suffix }}" >> $GITHUB_ENV
- name: Build SideStore
# using 'tee' to intercept stdout and log for detailed build-log
run: |
echo "BUNDLE_ID_SUFFIX=${{ inputs.bundle_id_suffix }}" >> $GITHUB_ENV
NSUnbufferedIO=YES make build 2>&1 | tee build.log | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]}
- name: Fakesign app

View File

@@ -186,7 +186,7 @@ extension AppContentViewController
switch Row.allCases[indexPath.row]
{
case .screenshots:
guard !self.app.screenshots.isEmpty else { return 0.0 }
guard !self.app.allScreenshots.isEmpty else { return 0.0 }
return UITableView.automaticDimension
case .permissions:

View File

@@ -27,9 +27,9 @@
</uniquenessConstraints>
</entity>
<entity name="AppPermission" representedClassName="AppPermission" syncable="YES">
<attribute name="appBundleID" optional="YES" attributeType="String" defaultValueString=""/>
<attribute name="permission" optional="YES" attributeType="String" defaultValueString=""/>
<attribute name="sourceID" optional="YES" attributeType="String"/>
<attribute name="appBundleID" attributeType="String"/>
<attribute name="permission" attributeType="String"/>
<attribute name="sourceID" attributeType="String"/>
<attribute name="type" attributeType="String"/>
<attribute name="usageDescription" attributeType="String"/>
<relationship name="app" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="StoreApp" inverseName="permissions" inverseEntity="StoreApp"/>
@@ -88,7 +88,7 @@
<attribute name="certificateSerialNumber" optional="YES" attributeType="String"/>
<attribute name="expirationDate" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="hasAlternateIcon" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="hasUpdate" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
<attribute name="hasUpdate" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="installedDate" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="isActive" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
<attribute name="isRefreshing" transient="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
@@ -229,7 +229,7 @@
<attribute name="sourceURL" attributeType="URI"/>
<attribute name="subtitle" optional="YES" attributeType="String"/>
<attribute name="tintColor" optional="YES" attributeType="Transformable" valueTransformerName="ALTSecureValueTransformer"/>
<attribute name="version" optional="YES" attributeType="Integer 64" defaultValueString="1" usesScalarValueType="NO"/>
<attribute name="version" attributeType="Integer 64" defaultValueString="1" usesScalarValueType="YES"/>
<attribute name="websiteURL" optional="YES" attributeType="URI"/>
<relationship name="apps" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="StoreApp" inverseName="source" inverseEntity="StoreApp"/>
<relationship name="featuredApps" optional="YES" toMany="YES" deletionRule="Nullify" ordered="YES" destinationEntity="StoreApp" inverseName="featuringSource" inverseEntity="StoreApp"/>
@@ -251,15 +251,14 @@
<attribute name="isHiddenWithoutPledge" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="isPledged" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="isPledgeRequired" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="localizedDescription" optional="YES" attributeType="String"/>
<attribute name="localizedDescription" attributeType="String"/>
<attribute name="marketplaceID" optional="YES" attributeType="String"/>
<attribute name="name" attributeType="String"/>
<attribute name="pledgeAmount" optional="YES" attributeType="Decimal"/>
<attribute name="pledgeCurrency" optional="YES" attributeType="String"/>
<attribute name="prefersCustomPledge" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
<attribute name="screenshotURLs" attributeType="Transformable" valueTransformerName="ALTSecureValueTransformer"/>
<attribute name="sha256" optional="YES" attributeType="String"/>
<attribute name="size" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="size" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="sortIndex" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="sourceIdentifier" optional="YES" attributeType="String"/>
<attribute name="subtitle" optional="YES" attributeType="String"/>

View File

@@ -23,16 +23,11 @@ public class AppVersion: BaseEntity, Decodable
@NSManaged @objc(buildVersion) public private(set) var _buildVersion: String
@NSManaged public private(set) var date: Date
@NSManaged @objc(localizedDescription) private(set) var _localizedDescription: String?
@NSManaged public private(set) var localizedDescription: String?
@NSManaged public private(set) var downloadURL: URL
@NSManaged public private(set) var size: Int64
@NSManaged public private(set) var sha256: String?
@nonobjc public var localizedDescription: String {
return self._localizedDescription ?? app?.localizedDescription ??
"localizedDescription not set, contact the source owner to fix this"
}
@nonobjc public var minOSVersion: OperatingSystemVersion? {
guard let osVersionString = self._minOSVersion else { return nil }
@@ -88,7 +83,7 @@ public class AppVersion: BaseEntity, Decodable
self.buildVersion = try container.decodeIfPresent(String.self, forKey: .buildVersion)
self.date = try container.decode(Date.self, forKey: .date)
self._localizedDescription = try container.decodeIfPresent(String.self, forKey: .localizedDescription)
self.localizedDescription = try container.decodeIfPresent(String.self, forKey: .localizedDescription)
self.downloadURL = try container.decode(URL.self, forKey: .downloadURL)
self.size = try container.decode(Int64.self, forKey: .size)
@@ -154,7 +149,7 @@ public extension AppVersion
appVersion.version = version
appVersion.buildVersion = buildVersion
appVersion.date = date
appVersion._localizedDescription = localizedDescription
appVersion.localizedDescription = localizedDescription
appVersion.downloadURL = downloadURL
appVersion.size = size
appVersion.sha256 = sha256

View File

@@ -392,11 +392,11 @@ extension MergePolicy{
// Screenshots
if let sortedScreenshotIDs = sortedScreenshotIDsByGlobalAppID[globallyUniqueID],
let sortedScreenshotIDsArray = sortedScreenshotIDs.array as? [String],
case let databaseScreenshotIDs = databaseObject.screenshots.map({ $0.screenshotID }),
case let databaseScreenshotIDs = databaseObject.allScreenshots.map({ $0.screenshotID }),
databaseScreenshotIDs != sortedScreenshotIDsArray
{
// Screenshot order is incorrect, so attempt to fix by re-sorting.
let fixedScreenshots = databaseObject.screenshots.sorted { (screenshotA, screenshotB) in
let fixedScreenshots = databaseObject.allScreenshots.sorted { (screenshotA, screenshotB) in
let indexA = sortedScreenshotIDs.index(of: screenshotA.screenshotID)
let indexB = sortedScreenshotIDs.index(of: screenshotB.screenshotID)
return indexA < indexB

View File

@@ -37,7 +37,7 @@ fileprivate extension NSManagedObject
}
var storeAppSize: NSNumber? {
let size = self.value(forKey: #keyPath(StoreApp.size)) as? NSNumber
let size = self.value(forKey: #keyPath(StoreApp._size)) as? NSNumber
return size
}
@@ -66,7 +66,7 @@ fileprivate extension NSManagedObject
let appVersion = NSEntityDescription.insertNewObject(forEntityName: AppVersion.entity().name!, into: context)
appVersion.setValue(version, forKey: #keyPath(AppVersion.version))
appVersion.setValue(date, forKey: #keyPath(AppVersion.date))
appVersion.setValue(localizedDescription, forKey: #keyPath(AppVersion._localizedDescription))
appVersion.setValue(localizedDescription, forKey: #keyPath(AppVersion.localizedDescription))
appVersion.setValue(downloadURL, forKey: #keyPath(AppVersion.downloadURL))
appVersion.setValue(size, forKey: #keyPath(AppVersion.size))
appVersion.setValue(appBundleID, forKey: #keyPath(AppVersion.appBundleID))

View File

@@ -123,12 +123,6 @@ private struct PatreonParameters: Decodable
var hidden: Bool?
}
// added for v0.6.0
extension StoreApp {
//MARK: - properties
@NSManaged public private(set) var sha256: String?
}
@objc(StoreApp)
public class StoreApp: BaseEntity, Decodable
@@ -139,8 +133,8 @@ public class StoreApp: BaseEntity, Decodable
@NSManaged public private(set) var subtitle: String?
@NSManaged public private(set) var developerName: String
@NSManaged public private(set) var localizedDescription: String?
@NSManaged public private(set) var size: Int64
@NSManaged public private(set) var localizedDescription: String
@NSManaged @objc(size) internal var _size: Int32
@nonobjc public var category: StoreCategory? {
guard let _category else { return nil }
@@ -157,8 +151,6 @@ public class StoreApp: BaseEntity, Decodable
@NSManaged public private(set) var platformURLs: PlatformURLs?
@NSManaged public private(set) var tintColor: UIColor?
// TODO: @mahee96: retire isBeta and use a string type to decode and store values as enum
@NSManaged public private(set) var isBeta: Bool
// Required for Marketplace apps.
@@ -199,7 +191,7 @@ public class StoreApp: BaseEntity, Decodable
permission.sourceID = self.sourceIdentifier ?? ""
}
for screenshot in self.screenshots
for screenshot in self.allScreenshots
{
screenshot.sourceID = self.sourceIdentifier ?? ""
}
@@ -249,7 +241,7 @@ public class StoreApp: BaseEntity, Decodable
return self._versions.array as! [AppVersion]
}
@nonobjc public var screenshots: [AppScreenshot] {
@nonobjc public var allScreenshots: [AppScreenshot] {
return self._screenshots.array as! [AppScreenshot]
}
@NSManaged @objc(screenshots) private(set) var _screenshots: NSOrderedSet
@@ -284,9 +276,6 @@ public class StoreApp: BaseEntity, Decodable
case versionDate
case downloadURL
case screenshotURLs
// new for v0.6.0
case sha256
}
public required init(from decoder: Decoder) throws
@@ -299,18 +288,18 @@ public class StoreApp: BaseEntity, Decodable
do
{
let container = try decoder.container(keyedBy: CodingKeys.self)
self.sha256 = try container.decodeIfPresent(String.self, forKey: .sha256)
self.name = try container.decode(String.self, forKey: .name)
self.bundleIdentifier = try container.decode(String.self, forKey: .bundleIdentifier)
self.developerName = try container.decode(String.self, forKey: .developerName)
self.localizedDescription = try container.decodeIfPresent(String.self, forKey: .localizedDescription)
self.localizedDescription = try container.decode(String.self, forKey: .localizedDescription)
self.iconURL = try container.decode(URL.self, forKey: .iconURL)
self.subtitle = try container.decodeIfPresent(String.self, forKey: .subtitle)
self.isBeta = try container.decodeIfPresent(Bool.self, forKey: .isBeta) ?? false
// Required for Marketplace apps, but we'll verify later.
self.marketplaceID = try container.decodeIfPresent(String.self, forKey: .marketplaceID)
if let tintColorHex = try container.decodeIfPresent(String.self, forKey: .tintColor)
{
guard let tintColor = UIColor(hexString: tintColorHex) else {
@@ -376,12 +365,8 @@ public class StoreApp: BaseEntity, Decodable
self._permissions = NSSet()
}
// Required for Marketplace apps, but we'll verify later.
self.marketplaceID = try container.decodeIfPresent(String.self, forKey: .marketplaceID)
if let versions = try container.decodeIfPresent([AppVersion].self, forKey: .versions)
{
//TODO: Throw error if there isn't at least one version.
if (versions.count == 0){
throw DecodingError.dataCorruptedError(forKey: .versions, in: container, debugDescription: "At least one version is required in key: versions")
}
@@ -547,9 +532,7 @@ internal extension StoreApp
self.versionDate = latestVersion.date
self.versionDescription = latestVersion.localizedDescription
self.downloadURL = latestVersion.downloadURL
self.size = latestVersion.size
self.localizedDescription = latestVersion.localizedDescription
self.sha256 = latestVersion.sha256
self._size = Int32(latestVersion.size)
}
func setPermissions(_ permissions: Set<AppPermission>)
@@ -595,7 +578,7 @@ public extension StoreApp
func screenshots(for deviceType: ALTDeviceType) -> [AppScreenshot]
{
//TODO: Support multiple device types
let filteredScreenshots = self.screenshots.filter { $0.deviceType == deviceType }
let filteredScreenshots = self.allScreenshots.filter { $0.deviceType == deviceType }
return filteredScreenshots
}
@@ -615,7 +598,7 @@ public extension StoreApp
let preferredScreenshots = self.screenshots(for: deviceType)
guard !preferredScreenshots.isEmpty else {
// There are no screenshots for deviceType, so return _all_ screenshots instead.
return self.screenshots
return self.allScreenshots
}
return preferredScreenshots
@@ -659,25 +642,6 @@ public extension StoreApp
return NSFetchRequest<StoreApp>(entityName: "StoreApp")
}
//MARK: - override in subclasses if required
@objc func placeholderAppVersion(appVersion: AppVersion, in context: NSManagedObjectContext) -> AppVersion{
return appVersion
}
//MARK: - override in subclasses if required
@objc class func createStoreApp(in context: NSManagedObjectContext) -> StoreApp{
return StoreApp(context: context)
}
class func isPlaceHolderVersion(_ version: AppVersion) -> Bool{
return version.version == "0.0.0" && version.date == Date.distantPast && version.appBundleID == StoreApp.altstoreAppID
}
class func isPlaceHolderStoreApp(_ app: StoreApp) -> Bool{
return app.version == "0.0.0" && app.versionDate == Date.distantPast && app.bundleIdentifier == StoreApp.altstoreAppID
}
private static var sideStoreAppIconURL: URL {
let iconNames = [
"AppIcon76x76@2x~ipad",
@@ -719,8 +683,6 @@ public extension StoreApp
in: context)
try? app.setVersions([appVersion])
print("makeAltStoreApp StoreApp: \(String(describing: app))")
#if BETA
app.isBeta = true
#endif

View File

@@ -168,6 +168,7 @@ test:
# Overrides (will inherit from env if set already)
BUILD_CONFIG ?= Release
MARKETING_VERSION ?=
BUNDLE_ID_SUFFIX ?=
build:
@echo ">>>>>>>>> BUILD_CONFIG is set to '$(BUILD_CONFIG)', Building for $(BUILD_CONFIG) mode! <<<<<<<<<<"
@echo ""
@@ -182,7 +183,7 @@ build:
DEVELOPMENT_TEAM=XYZ0123456 \
ORG_IDENTIFIER=com.SideStore \
MARKETING_VERSION=$(MARKETING_VERSION) \
BUNDLE_ID_SUFFIX=
BUNDLE_ID_SUFFIX=$(BUNDLE_ID_SUFFIX)
# DWARF_DSYM_FOLDER_PATH="."
fakesign-apps: