- ReleaseTracks: Added in-app ReleaseTracks switching support

This commit is contained in:
Magesh K
2025-02-09 17:28:24 +05:30
parent a8fd1a3e83
commit eb0e1326b9
14 changed files with 791 additions and 276 deletions

View File

@@ -13,8 +13,9 @@ jobs:
Reuseable-build:
uses: ./.github/workflows/reusable-build-workflow.yml
with:
bundle_id: "com.SideStore.SideStore.Alpha"
bundle_id_suffix: ".Alpha"
# bundle_id: "com.SideStore.SideStore.Alpha"
bundle_id: "com.SideStore.SideStore"
# bundle_id_suffix: ".Alpha"
is_beta: true
publish: true
is_shared_build_num: false

View File

@@ -66,8 +66,9 @@ jobs:
needs: check-changes
uses: ./.github/workflows/reusable-build-workflow.yml
with:
bundle_id: "com.SideStore.SideStore.Nightly"
bundle_id_suffix: ".Nightly"
# bundle_id: "com.SideStore.SideStore.Nightly"
bundle_id: "com.SideStore.SideStore"
# bundle_id_suffix: ".Nightly"
is_beta: true
publish: true
is_shared_build_num: false

View File

@@ -56,6 +56,7 @@
A809F69F2D04D7B300F0F0F3 /* libem_proxy_static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A809F6942D04D71200F0F0F3 /* libem_proxy_static.a */; };
A809F6A82D04DA1900F0F0F3 /* minimuxer.swift in Sources */ = {isa = PBXBuildFile; fileRef = A809F6A32D04DA1900F0F0F3 /* minimuxer.swift */; };
A809F6A92D04DA1900F0F0F3 /* SwiftBridgeCore.swift in Sources */ = {isa = PBXBuildFile; fileRef = A809F6A72D04DA1900F0F0F3 /* SwiftBridgeCore.swift */; };
A80D60D32D3DD85100CEF65D /* ReleaseTrack.swift in Sources */ = {isa = PBXBuildFile; fileRef = A80D60D12D3D705F00CEF65D /* ReleaseTrack.swift */; };
A80D790D2D2F20AF00A40F40 /* PaginationIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = A80D790C2D2F20AF00A40F40 /* PaginationIntent.swift */; };
A80D790F2D2F217000A40F40 /* PaginationDataHolder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A80D790E2D2F217000A40F40 /* PaginationDataHolder.swift */; };
A82067842D03DC0600645C0D /* OperatingSystemVersion+Comparable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5708416292448DA00D42D34 /* OperatingSystemVersion+Comparable.swift */; };
@@ -636,6 +637,7 @@
A809F6A52D04DA1900F0F0F3 /* minimuxer-helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "minimuxer-helpers.swift"; sourceTree = "<group>"; };
A809F6A62D04DA1900F0F0F3 /* SwiftBridgeCore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftBridgeCore.h; sourceTree = "<group>"; };
A809F6A72D04DA1900F0F0F3 /* SwiftBridgeCore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftBridgeCore.swift; sourceTree = "<group>"; };
A80D60D12D3D705F00CEF65D /* ReleaseTrack.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReleaseTrack.swift; sourceTree = "<group>"; };
A80D790C2D2F20AF00A40F40 /* PaginationIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaginationIntent.swift; sourceTree = "<group>"; };
A80D790E2D2F217000A40F40 /* PaginationDataHolder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaginationDataHolder.swift; sourceTree = "<group>"; };
A859ED5B2D1EE80D003DCC58 /* OpenSSL.xcframework */ = {isa = PBXFileReference; expectedSignature = "AppleDeveloperProgram:67RAULRX93:Marcin Krzyzanowski"; lastKnownFileType = wrapper.xcframework; name = OpenSSL.xcframework; path = SideStore/AltSign/Dependencies/OpenSSL/Frameworks/OpenSSL.xcframework; sourceTree = "<group>"; };
@@ -1697,6 +1699,7 @@
D58916FD28C7C55C00E39C8B /* LoggedError.swift */,
BF66EEBF2501AECA007EE018 /* NewsItem.swift */,
BF66EEC32501AECA007EE018 /* RefreshAttempt.swift */,
A80D60D12D3D705F00CEF65D /* ReleaseTrack.swift */,
BF66EEAB2501AECA007EE018 /* Source.swift */,
BF66EEC42501AECA007EE018 /* StoreApp.swift */,
BF66EEC22501AECA007EE018 /* Team.swift */,
@@ -2975,6 +2978,7 @@
D5F99A1A28D12B1400476A16 /* StoreApp10ToStoreApp11Policy.swift in Sources */,
D5177B0D2A26944600270065 /* AltStore12ToAltStore13.xcmappingmodel in Sources */,
BFAECC562501B0A400528F27 /* ALTServerError+Conveniences.swift in Sources */,
A80D60D32D3DD85100CEF65D /* ReleaseTrack.swift in Sources */,
D56915072AD5E91B00A2B747 /* Regex+Permissions.swift in Sources */,
BFAECC592501B0A400528F27 /* Result+Conveniences.swift in Sources */,
D571ADD02A02FC7200B24B63 /* ALTAppPermission.swift in Sources */,

View File

@@ -138,11 +138,12 @@ extension AppBannerView
init(app: AppProtocol)
{
self.name = app.name
guard let storeApp = (app as? StoreApp) ?? (app as? InstalledApp)?.storeApp else { return }
self.developerName = storeApp.developerName
if storeApp.isBeta
if let track = storeApp.latestSupportedVersion?.channel,
ReleaseTracks.betaTracks.contains(track)
{
self.name = String(format: NSLocalizedString("%@ beta", comment: ""), app.name)
self.isBeta = true

View File

@@ -257,7 +257,7 @@ private extension MyAppsViewController
let appName: String
if app.isBeta
if ReleaseTracks.betaTracks.contains(latestSupportedVersion.channel)
{
appName = String(format: NSLocalizedString("%@ beta", comment: ""), app.name)
}

View File

@@ -22,7 +22,7 @@
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="separatorColor" white="1" alpha="0.25" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<stackView key="tableFooterView" opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalCentering" alignment="center" spacing="15" id="48g-cT-stR">
<rect key="frame" x="0.0" y="1790.6666698455811" width="402" height="125"/>
<rect key="frame" x="0.0" y="1986.3333377838135" width="402" height="125"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="900" text="Follow SideStore for updates" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XFa-MY-7cV">
@@ -500,13 +500,13 @@
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="View Error Log" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vH6-7i-tCE">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="View Error Log" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vH6-7i-tCE">
<rect key="frame" x="30" y="15.333333333333334" width="119" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="AeT-qF-bwB">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="AeT-qF-bwB">
<rect key="frame" x="356.33333333333331" y="14.333333333333334" width="15.666666666666686" height="22.333333333333329"/>
<imageReference key="image" image="chevron.right" catalog="system" symbolScale="large"/>
</imageView>
@@ -537,7 +537,7 @@
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Clear Cache…" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j4e-Mz-DlL">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Clear Cache…" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j4e-Mz-DlL">
<rect key="frame" x="29.999999999999993" y="15.333333333333334" width="114.33333333333331" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -569,22 +569,22 @@
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Developers" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hRA-OK-Vjw">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Developers" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hRA-OK-Vjw">
<rect key="frame" x="30" y="15.333333333333334" width="86" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="lx9-35-OSk">
<rect key="frame" x="217" y="15.333333333333334" width="155" height="20.333333333333329"/>
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="lx9-35-OSk">
<rect key="frame" x="217" y="15.333333333333336" width="155" height="20.333333333333329"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SideStore Team" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JAA-iZ-VGb">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="SideStore Team" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JAA-iZ-VGb">
<rect key="frame" x="0.0" y="0.0" width="125.33333333333333" height="20.333333333333332"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Mmj-3V-fTb">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Mmj-3V-fTb">
<rect key="frame" x="139.33333333333331" y="-1" width="15.666666666666657" height="22.333333333333332"/>
<imageReference key="image" image="chevron.right" catalog="system" symbolScale="large"/>
</imageView>
@@ -614,23 +614,23 @@
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="UI Designer" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oqY-wY-1Vf">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="UI Designer" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oqY-wY-1Vf">
<rect key="frame" x="30" y="15.333333333333334" width="89" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="gUq-6Q-t5X">
<rect key="frame" x="227.33333333333337" y="15.333333333333334" width="144.66666666666663" height="20.333333333333329"/>
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="gUq-6Q-t5X">
<rect key="frame" x="227.33333333333337" y="15.333333333333336" width="144.66666666666663" height="20.333333333333329"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Fabian (thdev)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ylE-VL-7Fq">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Fabian (thdev)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ylE-VL-7Fq">
<rect key="frame" x="0.0" y="0.0" width="115" height="20.333333333333332"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="e3L-vR-Jae">
<rect key="frame" x="128.99999999999997" y="-1" width="15.666666666666657" height="22.333333333333332"/>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="e3L-vR-Jae">
<rect key="frame" x="129" y="-1" width="15.666666666666657" height="22.333333333333332"/>
<imageReference key="image" image="chevron.right" catalog="system" symbolScale="large"/>
</imageView>
</subviews>
@@ -659,23 +659,23 @@
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Asset Designer" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fGU-Fp-XgM">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Asset Designer" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fGU-Fp-XgM">
<rect key="frame" x="29.999999999999993" y="15.333333333333334" width="115.33333333333331" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="R8B-DW-7mY">
<rect key="frame" x="235.33333333333337" y="15.333333333333334" width="136.66666666666663" height="20.333333333333329"/>
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="R8B-DW-7mY">
<rect key="frame" x="235.33333333333337" y="15.333333333333336" width="136.66666666666663" height="20.333333333333329"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Chris (LitRitt)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hId-3P-41T">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Chris (LitRitt)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hId-3P-41T">
<rect key="frame" x="0.0" y="0.0" width="107" height="20.333333333333332"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="baq-cE-fMY">
<rect key="frame" x="120.99999999999999" y="-1" width="15.666666666666671" height="22.333333333333332"/>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="baq-cE-fMY">
<rect key="frame" x="121" y="-1" width="15.666666666666629" height="22.333333333333332"/>
<imageReference key="image" image="chevron.right" catalog="system" symbolScale="large"/>
</imageView>
</subviews>
@@ -698,19 +698,19 @@
</userDefinedRuntimeAttributes>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="O5R-Al-lGj" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1107.6666698455811" width="402" height="51"/>
<rect key="frame" x="0.0" y="1071.6666698455811" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="O5R-Al-lGj" id="CrG-Mr-xQq">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Licenses" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="D6b-cd-pVK">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Licenses" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="D6b-cd-pVK">
<rect key="frame" x="30" y="15.333333333333334" width="67.333333333333329" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="s79-GQ-khr">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="s79-GQ-khr">
<rect key="frame" x="356.33333333333331" y="14.333333333333334" width="15.666666666666686" height="22.333333333333329"/>
<imageReference key="image" image="chevron.right" catalog="system" symbolScale="large"/>
</imageView>
@@ -739,7 +739,7 @@
<tableViewSection headerTitle="" id="OMa-EK-hRI">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="FMZ-as-Ljo" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1199.0000038146973" width="402" height="51"/>
<rect key="frame" x="0.0" y="1163.0000038146973" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="FMZ-as-Ljo" id="JzL-Of-A3T">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
@@ -773,7 +773,7 @@
</userDefinedRuntimeAttributes>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="Qca-pU-sJh" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1250.0000038146973" width="402" height="51"/>
<rect key="frame" x="0.0" y="1214.0000038146973" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Qca-pU-sJh" id="QtU-8J-VQN">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
@@ -810,7 +810,7 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="VrV-qI-zXF" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1301.0000038146973" width="402" height="51"/>
<rect key="frame" x="0.0" y="1265.0000038146973" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="VrV-qI-zXF" id="w1r-uY-4pD">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
@@ -844,7 +844,7 @@
</userDefinedRuntimeAttributes>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="VNn-u4-cN8" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1352.0000038146973" width="402" height="51"/>
<rect key="frame" x="0.0" y="1316.0000038146973" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="VNn-u4-cN8" id="4bh-qe-l2N">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
@@ -878,7 +878,7 @@
</userDefinedRuntimeAttributes>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="e7s-hL-kv9" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1403.0000038146973" width="402" height="51"/>
<rect key="frame" x="0.0" y="1367.0000038146973" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="e7s-hL-kv9" id="yjL-Mu-HTk">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
@@ -906,17 +906,89 @@
<edgeInsets key="layoutMargins" top="8" left="30" bottom="8" right="30"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="style">
<integer key="value" value="3"/>
<integer key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="isSelectable" value="YES"/>
</userDefinedRuntimeAttributes>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="XW5-Zc-nXH" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1418.0000038146973" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="XW5-Zc-nXH" id="AtM-bL-8pS">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enable Beta Updates" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2px-HD-0UT">
<rect key="frame" x="30" y="15.333333333333334" width="169" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="e32-w4-5fk">
<rect key="frame" x="323" y="10" width="51" height="31"/>
<connections>
<action selector="toggleEnableBetaUpdates:" destination="aMk-Xp-UL8" eventType="valueChanged" id="uxG-df-7GK"/>
</connections>
</switch>
</subviews>
<constraints>
<constraint firstItem="2px-HD-0UT" firstAttribute="centerY" secondItem="AtM-bL-8pS" secondAttribute="centerY" id="07r-jt-3rz"/>
<constraint firstItem="2px-HD-0UT" firstAttribute="leading" secondItem="AtM-bL-8pS" secondAttribute="leadingMargin" id="K2i-9G-bG8"/>
<constraint firstAttribute="trailingMargin" secondItem="e32-w4-5fk" secondAttribute="trailing" id="Wa7-m6-lcl"/>
<constraint firstItem="e32-w4-5fk" firstAttribute="centerY" secondItem="AtM-bL-8pS" secondAttribute="centerY" id="n7R-av-FBX"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" white="1" alpha="0.14999999999999999" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<edgeInsets key="layoutMargins" top="8" left="30" bottom="8" right="30"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="style">
<integer key="value" value="2"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="qbY-8c-LYT" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1469.0000038146973" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="qbY-8c-LYT" id="NxK-qB-w7Q">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Beta Updates Track" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5J9-vR-vhX" userLabel="Beta Track Label">
<rect key="frame" x="30" y="15.333333333333334" width="159.66666666666666" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" showsMenuAsPrimaryAction="YES" contentHorizontalAlignment="right" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" changesSelectionAsPrimaryAction="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Oct-iT-NwP" userLabel="Beta Track Drop Down Button">
<rect key="frame" x="301.66666666666669" y="8.3333333333333321" width="70.333333333333314" height="34.333333333333343"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="50" id="new-width-constraint"/>
</constraints>
<buttonConfiguration key="configuration" style="plain" title="stable" titleAlignment="trailing"/>
</button>
</subviews>
<constraints>
<constraint firstItem="5J9-vR-vhX" firstAttribute="centerY" secondItem="NxK-qB-w7Q" secondAttribute="centerY" id="5gk-uR-bun"/>
<constraint firstAttribute="trailingMargin" secondItem="Oct-iT-NwP" secondAttribute="trailing" id="Wa8-m6-lcl"/>
<constraint firstItem="5J9-vR-vhX" firstAttribute="leading" secondItem="NxK-qB-w7Q" secondAttribute="leadingMargin" id="af8-XD-RSn"/>
<constraint firstItem="Oct-iT-NwP" firstAttribute="centerY" secondItem="NxK-qB-w7Q" secondAttribute="centerY" id="n7t-av-FBX"/>
<constraint firstItem="Oct-iT-NwP" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="5J9-vR-vhX" secondAttribute="trailing" constant="16" id="new-spacing-constraint"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" white="1" alpha="0.14999999999999999" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<edgeInsets key="layoutMargins" top="8" left="30" bottom="8" right="30"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="style">
<integer key="value" value="3"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="" id="lLQ-K0-XSb">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="daQ-mk-yqC" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1494.3333377838135" width="402" height="51"/>
<rect key="frame" x="0.0" y="1560.3333377838135" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="daQ-mk-yqC" id="ZkW-ZR-twy">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
@@ -951,7 +1023,7 @@
</userDefinedRuntimeAttributes>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="hRP-jU-2hd" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1545.3333377838135" width="402" height="51"/>
<rect key="frame" x="0.0" y="1611.3333377838135" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="hRP-jU-2hd" id="JhE-O4-pRg">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
@@ -986,19 +1058,19 @@
</userDefinedRuntimeAttributes>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="JoN-Aj-XtZ" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1596.3333377838135" width="402" height="51"/>
<rect key="frame" x="0.0" y="1662.3333377838135" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="JoN-Aj-XtZ" id="v8Q-VQ-Q1h">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Enable Verbose Ops Logging" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7bz-tI-tLY">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enable Verbose Ops Logging" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7bz-tI-tLY">
<rect key="frame" x="29.999999999999986" y="15.333333333333334" width="232.66666666666663" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Q5X-Mo-KpE">
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Q5X-Mo-KpE">
<rect key="frame" x="323" y="10" width="51" height="31"/>
<connections>
<action selector="toggleVerboseOperationsLogging:" destination="aMk-Xp-UL8" eventType="valueChanged" id="n9N-Gt-OY2"/>
@@ -1021,13 +1093,13 @@
</userDefinedRuntimeAttributes>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="QOO-bO-4M5" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1647.3333377838135" width="402" height="51"/>
<rect key="frame" x="0.0" y="1713.3333377838135" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="QOO-bO-4M5" id="VTT-z5-C89">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Export Database..." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ho1-To-wve" userLabel="Export Database">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Export Database..." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ho1-To-wve" userLabel="Export Database">
<rect key="frame" x="30" y="15.333333333333334" width="151.66666666666666" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -1049,13 +1121,13 @@
</userDefinedRuntimeAttributes>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="ToB-H7-2lR" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1698.3333377838135" width="402" height="51"/>
<rect key="frame" x="0.0" y="1764.3333377838135" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="ToB-H7-2lR" id="Acf-xV-Isn">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Delete Database..." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CcF-9x-Eu8" userLabel="Delete Database Label">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Delete Database..." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CcF-9x-Eu8" userLabel="Delete Database Label">
<rect key="frame" x="30" y="15.333333333333334" width="150.33333333333334" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -1077,19 +1149,19 @@
</userDefinedRuntimeAttributes>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="xtI-eU-LFb" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1749.3333377838135" width="402" height="51"/>
<rect key="frame" x="0.0" y="1815.3333377838135" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="xtI-eU-LFb" id="bc9-41-6mE">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Operations Logging Control" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LW3-gm-lj5">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Operations Logging Control" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LW3-gm-lj5">
<rect key="frame" x="30.000000000000014" y="15.333333333333334" width="224.33333333333337" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zl4-ti-HTW">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="zl4-ti-HTW">
<rect key="frame" x="356.33333333333331" y="14.333333333333334" width="15.666666666666686" height="22.333333333333329"/>
<imageReference key="image" image="chevron.right" catalog="system" symbolScale="large"/>
</imageView>
@@ -1111,19 +1183,19 @@
</userDefinedRuntimeAttributes>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="pvu-IV-Poa" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1800.3333377838135" width="402" height="51"/>
<rect key="frame" x="0.0" y="1866.3333377838135" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="pvu-IV-Poa" id="zck-an-8cK">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Recreate Database on Next Start" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZRk-8S-kBQ" userLabel="Recreate Database Label">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Recreate Database on Next Start" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZRk-8S-kBQ" userLabel="Recreate Database Label">
<rect key="frame" x="30" y="15.333333333333334" width="265.33333333333331" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="uGv-Lb-Ita" userLabel="Recreate DB switch">
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="uGv-Lb-Ita" userLabel="Recreate DB switch">
<rect key="frame" x="323" y="10" width="51" height="31"/>
<connections>
<action selector="toggleRecreateDatabaseSwitch:" destination="aMk-Xp-UL8" eventType="valueChanged" id="vlf-Iz-kWr"/>
@@ -1146,19 +1218,19 @@
</userDefinedRuntimeAttributes>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="51" id="9By-QW-Jw9" customClass="InsetGroupTableViewCell" customModule="SideStore" customModuleProvider="target">
<rect key="frame" x="0.0" y="1851.3333377838135" width="402" height="51"/>
<rect key="frame" x="0.0" y="1917.3333377838135" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="9By-QW-Jw9" id="Dzq-gE-zyT">
<rect key="frame" x="0.0" y="0.0" width="402" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Minimuxer Console Logging" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jW6-pb-xdP">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Minimuxer Console Logging" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jW6-pb-xdP">
<rect key="frame" x="30.000000000000014" y="15.333333333333334" width="225.33333333333337" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="os8-7F-rSm" userLabel="Minimuxer logging Switch">
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="os8-7F-rSm" userLabel="Minimuxer logging Switch">
<rect key="frame" x="323" y="10" width="51" height="31"/>
<connections>
<action selector="toggleMinimuxerConsoleLogging:" destination="aMk-Xp-UL8" eventType="valueChanged" id="d0C-kx-aFV"/>
@@ -1194,6 +1266,9 @@
<outlet property="accountNameLabel" destination="CnN-M1-AYK" id="Ldc-Py-Bix"/>
<outlet property="accountTypeLabel" destination="434-MW-Den" id="mNB-QE-4Jg"/>
<outlet property="backgroundRefreshSwitch" destination="DPu-zD-Als" id="eiG-Hv-Vko"/>
<outlet property="betaTrackLabel" destination="5J9-vR-vhX" id="x2k-X7-pUr"/>
<outlet property="betaTrackPopupButton" destination="Oct-iT-NwP" id="sOR-cc-IWC"/>
<outlet property="betaUpdatesSwitch" destination="e32-w4-5fk" id="kdn-ZR-cNU"/>
<outlet property="disableAppLimitSwitch" destination="1aa-og-ZXD" id="oVL-Md-yZ8"/>
<outlet property="disableResponseCachingSwitch" destination="AAh-cu-qw8" id="aVT-Md-yZ8"/>
<outlet property="exportResignedAppsSwitch" destination="GYP-qn-wzh" id="aVL-Md-yZ8"/>

View File

@@ -75,6 +75,8 @@ extension SettingsViewController
case refreshSideJITServer
case resetPairingFile
case anisetteServers
case betaUpdates
case betaTrack
// case hiddenSettings
}
@@ -86,7 +88,7 @@ extension SettingsViewController
case exportDatabase
case deleteDatabase
case operationsLoggingControl
case recreateDatabase
case recreateDatabase
case minimuxerConsoleLogging
}
}
@@ -97,6 +99,10 @@ final class SettingsViewController: UITableViewController
private var prototypeHeaderFooterView: SettingsHeaderFooterView!
// Add outlet
@IBOutlet private var betaTrackLabel: UILabel!
@IBOutlet private var betaTrackPopupButton: UIButton!
private var debugGestureCounter = 0
private weak var debugGestureTimer: Timer?
@@ -107,6 +113,7 @@ final class SettingsViewController: UITableViewController
@IBOutlet private var backgroundRefreshSwitch: UISwitch!
@IBOutlet private var noIdleTimeoutSwitch: UISwitch!
@IBOutlet private var disableAppLimitSwitch: UISwitch!
@IBOutlet private var betaUpdatesSwitch: UISwitch!
@IBOutlet private var exportResignedAppsSwitch: UISwitch!
@IBOutlet private var verboseOperationsLoggingSwitch: UISwitch!
@IBOutlet private var minimuxerConsoleLoggingSwitch: UISwitch!
@@ -120,7 +127,7 @@ final class SettingsViewController: UITableViewController
@IBOutlet private var githubButton: UIButton!
@IBOutlet private var versionLabel: UILabel!
@IBOutlet private var recreateDatabaseSwitch: UISwitch!
override var preferredStatusBarStyle: UIStatusBarStyle {
@@ -128,7 +135,7 @@ final class SettingsViewController: UITableViewController
}
private static var exportDBInProgress = false
private static var deleteDBInProgress = false
private static var deleteDBInProgress = false
required init?(coder aDecoder: NSCoder)
{
@@ -138,6 +145,48 @@ private static var deleteDBInProgress = false
NotificationCenter.default.addObserver(self, selector: #selector(SettingsViewController.openErrorLog(_:)), name: ToastView.openErrorLogNotification, object: nil)
}
private func handleReleaseChannelSelection(_ channel: String) {
// Update your model/preferences
UserDefaults.standard.betaUdpatesTrack = channel
updateReleaseChannelButtonTitle()
}
private func updateReleaseChannelButtonTitle() {
let channel = UserDefaults.standard.betaUdpatesTrack ?? UserDefaults.defaultBetaUpdatesTrack
betaTrackPopupButton.setTitle(channel, for: .normal)
}
private func configureReleaseChannelButton() {
let currentTrack = UserDefaults.standard.betaUdpatesTrack
// get all tracks as string available except .stable and .unknown
var trackOptions: [String] = ReleaseTracks.betaTracks.map {$0.rawValue}
if let currentTrack{
// prepend currently selected beta track from the user defaults
trackOptions = [currentTrack] + trackOptions.filter { $0 != currentTrack }
}
// Create menu items with proper styling
let items = trackOptions.map{ channel in
UIAction(title: channel, handler: { [weak self] _ in
self?.handleReleaseChannelSelection(channel)
})
}
// Create menu with proper styling
let menu = UIMenu(title: "",
options: [.singleSelection, .displayInline], // Add displayInline
children: items
)
betaTrackPopupButton.menu = menu
// Set initial state
updateReleaseChannelButtonTitle()
}
override func viewDidLoad()
{
super.viewDidLoad()
@@ -185,6 +234,8 @@ private static var deleteDBInProgress = false
button.imageView?.contentMode = .scaleAspectFit
}
}
configureReleaseChannelButton()
}
override func viewWillAppear(_ animated: Bool)
@@ -286,7 +337,7 @@ private extension SettingsViewController
localizedVersion += buildInfo.project_version.map{ version in
version.isEmpty ? "" : " (\(version))"
} ?? installedApp.localizedVersion
versionLabel = NSLocalizedString(String(format: "Version %@", localizedVersion), comment: "SideStore Version")
}
else if let version = buildInfo.marketing_version
@@ -306,7 +357,7 @@ private extension SettingsViewController
{
versionLabel += "\n\(getXcodeVersion())"
}
return versionLabel
}
@@ -332,6 +383,9 @@ private extension SettingsViewController
self.disableAppLimitSwitch.isOn = UserDefaults.standard.isAppLimitDisabled
// AdvancedSettingsRow
self.betaUpdatesSwitch.isOn = UserDefaults.standard.isBetaUpdatesEnabled
self.betaTrackLabel.isEnabled = UserDefaults.standard.isBetaUpdatesEnabled
self.betaTrackPopupButton.isEnabled = UserDefaults.standard.isBetaUpdatesEnabled
// DiagnosticsRow
self.disableResponseCachingSwitch.isOn = UserDefaults.standard.responseCachingDisabled
@@ -573,6 +627,13 @@ private extension SettingsViewController
}
@IBAction func toggleEnableBetaUpdates(_ sender: UISwitch) {
betaTrackLabel.isEnabled = sender.isOn
betaTrackPopupButton.isEnabled = sender.isOn
// update it in database
UserDefaults.standard.isBetaUpdatesEnabled = sender.isOn
}
@IBAction func toggleIsBackgroundRefreshEnabled(_ sender: UISwitch)
{
UserDefaults.standard.isBackgroundRefreshEnabled = sender.isOn
@@ -1134,7 +1195,7 @@ extension SettingsViewController
// } else {
// ELOG("UIApplication.openSettingsURLString invalid")
// }
case .refreshAttempts : break
case .refreshAttempts, .betaUpdates, .betaTrack: break
}

View File

@@ -32,6 +32,7 @@ public extension UserDefaults
@NSManaged var isBackgroundRefreshEnabled: Bool
@NSManaged var isIdleTimeoutDisableEnabled: Bool
@NSManaged var isAppLimitDisabled: Bool
@NSManaged var isBetaUpdatesEnabled: Bool
@NSManaged var isExportResignedAppEnabled: Bool
@NSManaged var isVerboseOperationsLoggingEnabled: Bool
@NSManaged var isMinimuxerConsoleLoggingEnabled: Bool
@@ -55,6 +56,8 @@ public extension UserDefaults
@NSManaged var trustedServerURL: String?
@NSManaged var skipPatreonDownloads: Bool
@NSManaged var betaUdpatesTrack: String?
@nonobjc var preferredAppSorting: AppSorting {
get {
let sorting = _preferredAppSorting.flatMap { AppSorting(rawValue: $0) } ?? .default
@@ -89,7 +92,10 @@ public extension UserDefaults
@NSManaged var permissionCheckingDisabled: Bool
@NSManaged var responseCachingDisabled: Bool
// Default track for beta updates when beta-updates are enabled
static let defaultBetaUpdatesTrack: String = ReleaseTracks.beta.rawValue
class func registerDefaults()
{
let ios13_5 = OperatingSystemVersion(majorVersion: 13, minorVersion: 5, patchVersion: 0)
@@ -121,6 +127,7 @@ public extension UserDefaults
let defaults = [
#keyPath(UserDefaults.isAppLimitDisabled): false,
#keyPath(UserDefaults.isBetaUpdatesEnabled): false,
#keyPath(UserDefaults.isExportResignedAppEnabled): false,
#keyPath(UserDefaults.isDebugModeEnabled): false,
#keyPath(UserDefaults.isVerboseOperationsLoggingEnabled): false,
@@ -138,6 +145,7 @@ public extension UserDefaults
#keyPath(UserDefaults.isCowExploitSupported): isMacDirtyCowSupported,
#keyPath(UserDefaults.permissionCheckingDisabled): permissionCheckingDisabled,
#keyPath(UserDefaults._preferredAppSorting): preferredAppSorting.rawValue,
#keyPath(UserDefaults.betaUdpatesTrack): defaultBetaUpdatesTrack,
] as [String: Any]
UserDefaults.standard.register(defaults: defaults)

View File

@@ -62,6 +62,7 @@
<entity name="AppVersion" representedClassName="AppVersion" syncable="YES">
<attribute name="appBundleID" attributeType="String"/>
<attribute name="buildVersion" optional="YES" attributeType="String"/>
<attribute name="channel" optional="YES" attributeType="String"/>
<attribute name="date" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="downloadURL" attributeType="URI"/>
<attribute name="localizedDescription" optional="YES" attributeType="String"/>
@@ -73,6 +74,7 @@
<attribute name="version" attributeType="String"/>
<relationship name="app" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="StoreApp" inverseName="versions" inverseEntity="StoreApp"/>
<relationship name="latestVersionApp" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="StoreApp" inverseName="latestVersion" inverseEntity="StoreApp"/>
<relationship name="releaseTrack" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="ReleaseTrack" inverseName="releases" inverseEntity="ReleaseTrack"/>
<uniquenessConstraints>
<uniquenessConstraint>
<constraint value="appBundleID"/>
@@ -216,6 +218,16 @@
</uniquenessConstraint>
</uniquenessConstraints>
</entity>
<entity name="ReleaseTrack" representedClassName="ReleaseTrack" syncable="YES">
<attribute name="track" optional="YES" attributeType="String"/>
<relationship name="releases" optional="YES" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="AppVersion" inverseName="releaseTrack" inverseEntity="AppVersion"/>
<relationship name="storeApp" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="StoreApp" inverseName="releaseTracks" inverseEntity="StoreApp"/>
<uniquenessConstraints>
<uniquenessConstraint>
<constraint value="track"/>
</uniquenessConstraint>
</uniquenessConstraints>
</entity>
<entity name="Source" representedClassName="Source" syncable="YES">
<attribute name="error" optional="YES" attributeType="Transformable" valueTransformerName="ALTSecureValueTransformer"/>
<attribute name="featuredSortID" optional="YES" attributeType="String"/>
@@ -247,7 +259,6 @@
<attribute name="downloadURL" optional="YES" attributeType="URI"/>
<attribute name="featuredSortID" optional="YES" attributeType="String"/>
<attribute name="iconURL" attributeType="URI"/>
<attribute name="isBeta" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<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"/>
@@ -272,6 +283,7 @@
<relationship name="loggedErrors" toMany="YES" deletionRule="Nullify" destinationEntity="LoggedError" inverseName="storeApp" inverseEntity="LoggedError"/>
<relationship name="newsItems" toMany="YES" deletionRule="Nullify" destinationEntity="NewsItem" inverseName="storeApp" inverseEntity="NewsItem"/>
<relationship name="permissions" toMany="YES" deletionRule="Cascade" destinationEntity="AppPermission" inverseName="app" inverseEntity="AppPermission"/>
<relationship name="releaseTracks" optional="YES" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="ReleaseTrack" inverseName="storeApp" inverseEntity="ReleaseTrack"/>
<relationship name="screenshots" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="AppScreenshot" inverseName="app" inverseEntity="AppScreenshot"/>
<relationship name="source" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Source" inverseName="apps" inverseEntity="Source"/>
<relationship name="versions" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="AppVersion" inverseName="app" inverseEntity="AppVersion"/>

View File

@@ -27,7 +27,8 @@ public class AppVersion: BaseEntity, Decodable
@NSManaged public private(set) var downloadURL: URL
@NSManaged public private(set) var size: Int64
@NSManaged public private(set) var sha256: String?
@NSManaged @objc(channel) private var _channel: String?
@nonobjc public var minOSVersion: OperatingSystemVersion? {
guard let osVersionString = self._minOSVersion else { return nil }
@@ -45,11 +46,21 @@ public class AppVersion: BaseEntity, Decodable
@NSManaged @objc(maxOSVersion) private var _maxOSVersion: String?
@NSManaged public var appBundleID: String
@NSManaged public var sourceID: String?
@NSManaged public var sourceID: String?
/* Relationships */
@NSManaged public private(set) var app: StoreApp?
@NSManaged @objc(app) public private(set) var _app: StoreApp?
@NSManaged @objc(latestVersionApp) public internal(set) var latestSupportedVersionApp: StoreApp?
@NSManaged public var releaseTrack: ReleaseTrack?
// public accessors
public var app: StoreApp? {
return releaseTrack?.storeApp ?? _app
}
public var channel: ReleaseTracks {
ReleaseTracks(stringValue: releaseTrack?.track ?? _channel ?? "") ?? .unknown
}
private override init(entity: NSEntityDescription, insertInto context: NSManagedObjectContext?)
{
@@ -136,6 +147,7 @@ public extension AppVersion
class func makeAppVersion(
version: String,
buildVersion: String?,
channel: String? = nil,
date: Date,
localizedDescription: String? = nil,
downloadURL: URL,
@@ -148,6 +160,7 @@ public extension AppVersion
let appVersion = AppVersion(context: context)
appVersion.version = version
appVersion.buildVersion = buildVersion
appVersion._channel = channel
appVersion.date = date
appVersion.localizedDescription = localizedDescription
appVersion.downloadURL = downloadURL
@@ -159,6 +172,49 @@ public extension AppVersion
return appVersion
}
// update with new values
func mutateForData(
version: String? = nil,
channel: String? = nil,
buildVersion: String? = nil,
date: Date? = nil,
localizedDescription: String? = nil,
downloadURL: URL? = nil,
size: Int64? = nil,
sha256: String? = nil,
appBundleID: String? = nil,
sourceID: String? = nil) -> AppVersion
{
// use overriding incoming params if present else retain existing
// non-optionals
if let version {
self.version = version
}
if let date {
self.date = date
}
if let downloadURL{
self.downloadURL = downloadURL
}
if let size{
self.size = size
}
if let appBundleID{
self.appBundleID = appBundleID
}
// optionals
self.localizedDescription = localizedDescription ?? self.localizedDescription
self._channel = channel ?? self._channel
self.buildVersion = buildVersion ?? self.buildVersion
self.sha256 = sha256 ?? self.sha256
self.sourceID = sourceID ?? self.sourceID
return self
}
var isSupported: Bool {
if let minOSVersion = self.minOSVersion, !ProcessInfo.processInfo.isOperatingSystemAtLeast(minOSVersion)
{

View File

@@ -122,7 +122,7 @@ public class InstalledApp: BaseEntity, InstalledAppProtocol
{
return false
}
// Check pledge requirements
guard !storeApp.isPledgeRequired || storeApp.isPledged else
{
@@ -137,26 +137,26 @@ public class InstalledApp: BaseEntity, InstalledAppProtocol
if currentSemVer == nil || latestSemVer == nil {
return !matches(latestVersion)
}
// let currentVer = SemanticVersion("\(currentSemVer!.major).\(currentSemVer!.minor).\(currentSemVer!.patch)")
// let latestVer = SemanticVersion("\(latestSemVer!.major).\(latestSemVer!.minor).\(latestSemVer!.patch)")
let currentVer = SemanticVersion("\(currentSemVer!.major).\(currentSemVer!.minor).\(currentSemVer!.patch)")
let latestVer = SemanticVersion("\(latestSemVer!.major).\(latestSemVer!.minor).\(latestSemVer!.patch)")
// // Compare by major.minor.patch
// if latestVer! > latestVer! {
// return true
// }
// Compare by major.minor.patch
if latestVer! > latestVer! {
return true
}
// // Check beta updates if enabled
// if UserDefaults.standard.isBetaUpdatesEnabled,
// ReleaseTracks.betaTracks.contains(latestVersion.channel),
// latestVer == currentVer, // major.minor.patch are matching
// // now compare by preRelease and build to break the tie
// // TODO: since multiple tracks can be independent, when a different version is available on selected track than installed
// // we accept it, now ex: if the setup is consistent for upstream merge lets say from alpha to nightly and alpha can never fall behind nightly,
// // then the preRelease+build combo will always be incremental and our below not-equals check will still work.
// (latestSemVer!.build != currentSemVer!.build) || (latestSemVer!.preRelease != currentSemVer!.preRelease)
// {
// return true
// }
// Check beta updates if enabled
if UserDefaults.standard.isBetaUpdatesEnabled,
ReleaseTracks.betaTracks.contains(latestVersion.channel),
latestVer == currentVer, // major.minor.patch are matching
// now compare by preRelease and build to break the tie
// TODO: since multiple tracks can be independent, when a different version is available on selected track than installed
// we accept it, now ex: if the setup is consistent for upstream merge lets say from alpha to nightly and alpha can never fall behind nightly,
// then the preRelease+build combo will always be incremental and our below not-equals check will still work.
(latestSemVer!.build != currentSemVer!.build) || (latestSemVer!.preRelease != currentSemVer!.preRelease)
{
return true
}
// else include everything as-is when doing lexicographic comparison
// NOTE: stable x.y.z is always > x.y.z-abcd+1234
@@ -268,8 +268,8 @@ public extension InstalledApp
}
}
}
func matches(_ appVersion: AppVersion) -> Bool
func matches(_ appVersion: AppVersion) -> Bool
{
let matchesAppVersion = (self.version == appVersion.version && self.storeBuildVersion == appVersion.buildVersion)
return matchesAppVersion
@@ -283,12 +283,12 @@ public extension InstalledApp
return NSFetchRequest<InstalledApp>(entityName: "InstalledApp")
}
class func supportedUpdatesFetchRequest() -> NSFetchRequest<InstalledApp>
class func supportedUpdatesFetchRequest() -> NSFetchRequest<InstalledApp>
{
let fetchRequest = InstalledApp.fetchRequest() as NSFetchRequest<InstalledApp>
fetchRequest.predicate = NSPredicate(format: "%K == YES", #keyPath(InstalledApp.hasUpdate))
return fetchRequest
}

View File

@@ -0,0 +1,114 @@
//
// AppreleaseTrack.swift
// AltStore
//
// Created by Magesh K on 19/01/25.
// Copyright © 2025 SideStore. All rights reserved.
//
import CoreData
// created for 0.6.0
@objc(ReleaseTrack)
public class ReleaseTrack: BaseEntity, Decodable
{
// attributes
@NSManaged @objc(track) private var _track: String?
// RelationShips
@NSManaged @objc(releases) private var _releases: NSOrderedSet?
@NSManaged public private(set) var storeApp: StoreApp?
private enum CodingKeys: String, CodingKey, CaseIterable {
case track
case releases
}
public var track: String? {
return _track?.isEmpty == false ? _track : nil
}
public var releases:[AppVersion]? {
return _releases?.array as? [AppVersion]
}
// Required initializer for Core Data (context saves)
private override init(entity: NSEntityDescription, insertInto context: NSManagedObjectContext?) {
super.init(entity: entity, insertInto: context)
}
public required init(from decoder: Decoder) throws{
guard let context = decoder.managedObjectContext else {
preconditionFailure("Decoder must have non-nil NSManagedObjectContext.")
}
// Must initialize with context in order for child context saves to work correctly.
super.init(entity: ReleaseTrack.entity(), insertInto: context)
do
{
let container = try decoder.container(keyedBy: CodingKeys.self)
self._track = try container.decode(String.self, forKey: .track)
let releases = try container.decode([AppVersion].self, forKey: .releases)
guard releases.count > 0 else
{
throw DecodingError.dataCorruptedError(forKey: .releases, in: container, debugDescription: "At least one version is required in key: releases")
}
self._releases = NSOrderedSet(array: releases)
}
catch
{
if let context = self.managedObjectContext
{
context.delete(self)
}
throw error
}
}
}
public extension ReleaseTrack{
/// Warning:
/// - Special handling required for deleted objects:
/// - CoreData sets all properties to nil during deletion
/// - This triggers KVO and could cause "mutating removed object" errors
/// - We guard against this by checking deletion state before updates
///
internal func updateVersions(for storeApp: StoreApp?) {
guard let storeApp = storeApp else { return }
releases?.forEach { version in
// never mutate objects that are being deleted or is already deleted
guard let context = version.managedObjectContext,
!version.isDeleted, !context.deletedObjects.contains(version) else
{
return
}
// update it into the appVersion
_ = version.mutateForData(channel: track, appBundleID: storeApp.bundleIdentifier)
}
}
/// Defer updates to fields that require storeApp inverse relationship to be set, which is not available in init(),
/// by observing changes to the prop and update the data later
///
/// NOTE: We use KVO here only coz, ReleaseTrack already has an inverse relationship to StoreAppV2
/// So coredata will actually set the storeApp but only issue is that it happens after init() is complete
/// hence we are using KVO so that one doesn't need to manually set the value via a setter method
///
/// However this caused an issue when an object is marked deleted during merge policy conflict resolution, all its props are set to nil by coredata.
/// this causes this KVO observer to be triggered and mutating the deleted entity causing a "coredata error: Mutating removed object"
/// which is now handled by checking if context.deletedObjects doesn't contain it and version.isDeleted is not true yet
///
override func didChangeValue(forKey key: String) {
super.didChangeValue(forKey: key)
if key == NSExpression(forKeyPath: #keyPath(ReleaseTrack.storeApp)).keyPath
{
updateVersions(for: storeApp)
}
}
}

View File

@@ -12,6 +12,32 @@ import CoreData
import Roxas
import AltSign
import SemanticVersion
public enum ReleaseTracks: String, CodingKey, CaseIterable
{
case unknown
case local
case alpha
case beta = "nightly"
case stable
public static var betaTracks: [ReleaseTracks] {
ReleaseTracks.allCases.filter(isBetaTrack)
}
public static var nonBetaTracks: [ReleaseTracks] {
ReleaseTracks.allCases.filter { !isBetaTrack($0) }
}
private static func isBetaTrack(_ key: ReleaseTracks) -> Bool {
key == .alpha || key == .beta
}
}
public extension StoreApp
{
#if ALPHA
@@ -21,7 +47,7 @@ public extension StoreApp
#else
static let altstoreAppID = Bundle.Info.appbundleIdentifier
#endif
static let dolphinAppID = "me.oatmealdome.dolphinios-njb"
}
@@ -37,22 +63,22 @@ public final class PlatformURL: NSManagedObject, Decodable {
/* Properties */
@NSManaged public private(set) var platform: Platform
@NSManaged public private(set) var downloadURL: URL
private enum CodingKeys: String, CodingKey
{
case platform
case downloadURL
}
public init(from decoder: Decoder) throws
{
guard let context = decoder.managedObjectContext else { preconditionFailure("Decoder must have non-nil NSManagedObjectContext.") }
// Must initialize with context in order for child context saves to work correctly.
super.init(entity: PlatformURL.entity(), insertInto: context)
do
{
let container = try decoder.container(keyedBy: CodingKeys.self)
@@ -65,7 +91,7 @@ public final class PlatformURL: NSManagedObject, Decodable {
{
context.delete(self)
}
throw error
}
}
@@ -75,15 +101,15 @@ extension PlatformURL: Comparable {
public static func < (lhs: PlatformURL, rhs: PlatformURL) -> Bool {
return lhs.platform.rawValue < rhs.platform.rawValue
}
public static func > (lhs: PlatformURL, rhs: PlatformURL) -> Bool {
return lhs.platform.rawValue > rhs.platform.rawValue
}
public static func <= (lhs: PlatformURL, rhs: PlatformURL) -> Bool {
return lhs.platform.rawValue <= rhs.platform.rawValue
}
public static func >= (lhs: PlatformURL, rhs: PlatformURL) -> Bool {
return lhs.platform.rawValue >= rhs.platform.rawValue
}
@@ -97,11 +123,11 @@ private struct PatreonParameters: Decodable
{
var amount: Decimal
var isCustom: Bool
init(from decoder: Decoder) throws
{
let container = try decoder.singleValueContainer()
if let stringValue = try? container.decode(String.self), stringValue == "custom"
{
self.amount = 0 // Use 0 as amount internally to simplify logic.
@@ -115,7 +141,7 @@ private struct PatreonParameters: Decodable
}
}
}
var pledge: Pledge?
var currency: String?
var tiers: Set<String>?
@@ -124,6 +150,51 @@ private struct PatreonParameters: Decodable
}
extension StoreApp {
//MARK: - relationships
@NSManaged @objc(releaseTracks) private(set) var _releaseTracks: NSOrderedSet?
private var releaseTracks: [ReleaseTrack]?{
return _releaseTracks?.array as? [ReleaseTrack]
}
private func releaseTrackFor(track: String) -> ReleaseTrack? {
return releaseTracks?.first(where: { $0.track == track })
}
private var stableTrack: ReleaseTrack? {
releaseTrackFor(track: ReleaseTracks.stable.stringValue)
}
private var betaReleases: [AppVersion]? {
// If beta track is selected, use it instead
if UserDefaults.standard.isBetaUpdatesEnabled,
let betaTrack = UserDefaults.standard.betaUdpatesTrack {
// Filter and flatten beta and stable releases
let betaReleases = releaseTrackFor(track: betaTrack)?.releases?.compactMap { $0 }
// Ensure both beta and stable releases are found and supported
if let latestBeta = betaReleases?.first(where: { $0.isSupported }),
let latestStable = stableTrack?.releases?.first(where: { $0.isSupported }),
let stableSemVer = SemanticVersion(latestStable.version),
let betaSemVer = SemanticVersion(latestBeta.version),
betaSemVer >= stableSemVer
{
return betaReleases
}
}
return nil
}
private func getReleases(default releases: ReleaseTrack?) -> [AppVersion]?
{
return betaReleases ?? releases?.releases?.compactMap { $0 }
}
}
@objc(StoreApp)
public class StoreApp: BaseEntity, Decodable
{
@@ -131,27 +202,26 @@ public class StoreApp: BaseEntity, Decodable
@NSManaged public private(set) var name: String
@NSManaged public private(set) var bundleIdentifier: String
@NSManaged public private(set) var subtitle: String?
@NSManaged public private(set) var developerName: String
@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 }
let category = StoreCategory(rawValue: _category)
return category
}
@NSManaged @objc(category) public private(set) var _category: String?
@NSManaged public private(set) var iconURL: URL
@NSManaged public private(set) var screenshotURLs: [URL]
@NSManaged public private(set) var downloadURL: URL?
@NSManaged public private(set) var platformURLs: PlatformURLs?
@NSManaged public private(set) var tintColor: UIColor?
@NSManaged public private(set) var isBeta: Bool
// Required for Marketplace apps.
@NSManaged public private(set) var marketplaceID: String?
@@ -161,18 +231,18 @@ public class StoreApp: BaseEntity, Decodable
@NSManaged public private(set) var isHiddenWithoutPledge: Bool
@NSManaged public private(set) var pledgeCurrency: String?
@NSManaged public private(set) var prefersCustomPledge: Bool
@nonobjc public var pledgeAmount: Decimal? { _pledgeAmount as? Decimal }
@NSManaged @objc(pledgeAmount) private var _pledgeAmount: NSDecimalNumber?
@NSManaged public var sortIndex: Int32
@NSManaged public var featuredSortID: String?
@objc public internal(set) var sourceIdentifier: String? {
get {
self.willAccessValue(forKey: #keyPath(sourceIdentifier))
defer { self.didAccessValue(forKey: #keyPath(sourceIdentifier)) }
let sourceIdentifier = self.primitiveSourceIdentifier
return sourceIdentifier
}
@@ -180,17 +250,17 @@ public class StoreApp: BaseEntity, Decodable
self.willChangeValue(forKey: #keyPath(sourceIdentifier))
self.primitiveSourceIdentifier = newValue
self.didChangeValue(forKey: #keyPath(sourceIdentifier))
for version in self.versions
{
version.sourceID = newValue
}
for permission in self.permissions
{
permission.sourceID = self.sourceIdentifier ?? ""
}
for screenshot in self.allScreenshots
{
screenshot.sourceID = self.sourceIdentifier ?? ""
@@ -198,26 +268,26 @@ public class StoreApp: BaseEntity, Decodable
}
}
@NSManaged private var primitiveSourceIdentifier: String?
// Legacy (kept for backwards compatibility)
@NSManaged public private(set) var version: String?
@NSManaged public private(set) var versionDate: Date?
@NSManaged public private(set) var versionDescription: String?
/* Relationships */
@NSManaged public var installedApp: InstalledApp?
@NSManaged public var newsItems: Set<NewsItem>
@NSManaged @objc(source) public var _source: Source?
@NSManaged public internal(set) var featuringSource: Source?
@NSManaged @objc(latestVersion) public private(set) var latestSupportedVersion: AppVersion?
@NSManaged @objc(versions) public private(set) var _versions: NSOrderedSet
@NSManaged public private(set) var loggedErrors: NSSet /* Set<LoggedError> */ // Use NSSet to avoid eagerly fetching values.
/* Non-Core Data Properties */
// Used to set isPledged after fetching source.
public var _tierIDs: Set<String>?
public var _rewardID: String?
@@ -236,11 +306,11 @@ public class StoreApp: BaseEntity, Decodable
return self._permissions as! Set<AppPermission>
}
@NSManaged @objc(permissions) internal private(set) var _permissions: NSSet // Use NSSet to avoid eagerly fetching values.
@nonobjc public var versions: [AppVersion] {
return self._versions.array as! [AppVersion]
}
@nonobjc public var allScreenshots: [AppScreenshot] {
return self._screenshots.array as! [AppScreenshot]
}
@@ -250,7 +320,7 @@ public class StoreApp: BaseEntity, Decodable
{
super.init(entity: entity, insertInto: context)
}
private enum CodingKeys: String, CodingKey
{
case name
@@ -265,19 +335,22 @@ public class StoreApp: BaseEntity, Decodable
case subtitle
case permissions = "appPermissions"
case size
case isBeta = "beta"
case isBeta = "beta" // backward compatibility for altstore source format
case versions
case patreon
case category
// Legacy
case version
case versionDescription
case versionDate
case downloadURL
case screenshotURLs
}
// v2 source format
case releaseTracks = "releaseChannels"
}
public required init(from decoder: Decoder) throws
{
guard let context = decoder.managedObjectContext else { preconditionFailure("Decoder must have non-nil NSManagedObjectContext.") }
@@ -293,10 +366,9 @@ public class StoreApp: BaseEntity, Decodable
self.developerName = try container.decode(String.self, forKey: .developerName)
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)
@@ -305,17 +377,17 @@ public class StoreApp: BaseEntity, Decodable
guard let tintColor = UIColor(hexString: tintColorHex) else {
throw DecodingError.dataCorruptedError(forKey: .tintColor, in: container, debugDescription: "Hex code is invalid.")
}
self.tintColor = tintColor
}
if let rawCategory = try container.decodeIfPresent(String.self, forKey: .category)
{
self._category = rawCategory.lowercased() // Store raw (lowercased) category value.
}
let appScreenshots: [AppScreenshot]
if let screenshots = try container.decodeIfPresent(AppScreenshots.self, forKey: .screenshots)
{
appScreenshots = screenshots.screenshots
@@ -324,7 +396,7 @@ public class StoreApp: BaseEntity, Decodable
{
// Assume 9:16 iPhone 8 screen dimensions for legacy screenshotURLs.
let legacyAspectRatio = CGSize(width: 750, height: 1334)
appScreenshots = screenshotURLs.map { imageURL in
let screenshot = AppScreenshot(imageURL: imageURL, size: legacyAspectRatio, deviceType: .iphone, context: context)
return screenshot
@@ -342,14 +414,14 @@ public class StoreApp: BaseEntity, Decodable
{
appScreenshots = []
}
for screenshot in appScreenshots
{
screenshot.appBundleID = self.bundleIdentifier
}
self.setScreenshots(appScreenshots)
if let appPermissions = try container.decodeIfPresent(AppPermissions.self, forKey: .permissions)
{
let allPermissions = appPermissions.entitlements + appPermissions.privacy
@@ -357,7 +429,7 @@ public class StoreApp: BaseEntity, Decodable
{
permission.appBundleID = self.bundleIdentifier
}
self._permissions = NSSet(array: allPermissions)
}
else
@@ -365,66 +437,8 @@ public class StoreApp: BaseEntity, Decodable
self._permissions = NSSet()
}
if let versions = try container.decodeIfPresent([AppVersion].self, forKey: .versions)
{
if (versions.count == 0){
throw DecodingError.dataCorruptedError(forKey: .versions, in: container, debugDescription: "At least one version is required in key: versions")
}
for (index, version) in zip(0..., versions)
{
version.appBundleID = self.bundleIdentifier
if self.marketplaceID != nil
{
struct IndexCodingKey: CodingKey
{
var stringValue: String { self.intValue?.description ?? "" }
var intValue: Int?
init?(stringValue: String)
{
fatalError()
}
init(intValue: Int)
{
self.intValue = intValue
}
}
// Marketplace apps must provide build version.
guard version.buildVersion != nil else {
let codingPath = container.codingPath + [CodingKeys.versions as CodingKey] + [IndexCodingKey(intValue: index) as CodingKey]
let context = DecodingError.Context(codingPath: codingPath, debugDescription: "Notarized apps must provide a build version.")
throw DecodingError.keyNotFound(AppVersion.CodingKeys.buildVersion, context)
}
}
}
try self.setVersions(versions)
}
else
{
let version = try container.decode(String.self, forKey: .version)
let versionDate = try container.decode(Date.self, forKey: .versionDate)
let versionDescription = try container.decodeIfPresent(String.self, forKey: .versionDescription)
let downloadURL = try container.decode(URL.self, forKey: .downloadURL)
let size = try container.decode(Int32.self, forKey: .size)
let appVersion = AppVersion.makeAppVersion(version: version,
buildVersion: nil,
date: versionDate,
localizedDescription: versionDescription,
downloadURL: downloadURL,
size: Int64(size),
appBundleID: self.bundleIdentifier,
in: context)
try self.setVersions([appVersion])
}
try self.decodeVersions(from: decoder) // pre-req for downloadURL procesing
// latestSupportedVersion is set by this point if one was available
let platformURLs = try container.decodeIfPresent(PlatformURLs.self.self, forKey: .platformURLs)
if let platformURLs = platformURLs {
@@ -450,12 +464,12 @@ public class StoreApp: BaseEntity, Decodable
// Must _explicitly_ set to false to ensure it updates cached database value.
self.isPledged = false
self.prefersCustomPledge = false
if let patreon = try container.decodeIfPresent(PatreonParameters.self, forKey: .patreon)
{
self.isPledgeRequired = true
self.isHiddenWithoutPledge = patreon.hidden ?? false // Default to showing Patreon apps
if let pledge = patreon.pledge
{
self._pledgeAmount = pledge.amount as NSDecimalNumber
@@ -467,7 +481,7 @@ public class StoreApp: BaseEntity, Decodable
// No conditions, so default to pledgeAmount of 0 to simplify logic.
self._pledgeAmount = 0 as NSDecimalNumber
}
self._tierIDs = patreon.tiers
self._rewardID = patreon.benefit
}
@@ -477,7 +491,7 @@ public class StoreApp: BaseEntity, Decodable
self.isHiddenWithoutPledge = false
self._pledgeAmount = nil
self.pledgeCurrency = nil
self._tierIDs = nil
self._rewardID = nil
}
@@ -488,23 +502,118 @@ public class StoreApp: BaseEntity, Decodable
{
context.delete(self)
}
throw error
}
}
private func decodeVersions(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
if let releaseTracks = try container.decodeIfPresent([ReleaseTrack].self, forKey: .releaseTracks){
self._releaseTracks = NSOrderedSet(array: releaseTracks)
}
// get channel info if present, else default to stable
var channel = ReleaseTracks.stable.stringValue
var versions = getReleases(default: stableTrack) ?? []
if versions.isEmpty {
if let appVersions = try container.decodeIfPresent([AppVersion].self, forKey: .versions)
{
versions = appVersions
}
else
{
if try container.decodeIfPresent(Bool.self, forKey: .isBeta) ?? false
{
channel = ReleaseTracks.beta.stringValue
}
// create one from the storeApp description and use it as current
let newRelease = try createNewAppVersion(decoder: decoder)
.mutateForData(
channel: channel,
appBundleID: self.bundleIdentifier
)
versions = [newRelease]
}
}
for (index, version) in zip(0..., versions)
{
version.appBundleID = self.bundleIdentifier
// ignore setting, if it was already updated by ReleaseTracks in V2 sources
if version.channel == .unknown {
_ = version.mutateForData(channel: channel)
}
if self.marketplaceID != nil
{
struct IndexCodingKey: CodingKey
{
var stringValue: String { self.intValue?.description ?? "" }
var intValue: Int?
init?(stringValue: String)
{
fatalError()
}
init(intValue: Int)
{
self.intValue = intValue
}
}
// Marketplace apps must provide build version.
guard version.buildVersion != nil else {
let codingPath = container.codingPath + [CodingKeys.versions as CodingKey] + [IndexCodingKey(intValue: index) as CodingKey]
let context = DecodingError.Context(codingPath: codingPath, debugDescription: "Notarized apps must provide a build version.")
throw DecodingError.keyNotFound(AppVersion.CodingKeys.buildVersion, context)
}
}
}
try self.setVersions(versions)
}
func createNewAppVersion(decoder: Decoder) throws -> AppVersion {
guard let context = decoder.managedObjectContext else { preconditionFailure("Decoder must have non-nil NSManagedObjectContext.") }
let container = try decoder.container(keyedBy: CodingKeys.self)
//
let version = try container.decode(String.self, forKey: .version)
let versionDate = try container.decode(Date.self, forKey: .versionDate)
let versionDescription = try container.decodeIfPresent(String.self, forKey: .versionDescription)
let downloadURL = try container.decode(URL.self, forKey: .downloadURL)
let size = try container.decode(Int32.self, forKey: .size)
return AppVersion.makeAppVersion(version: version,
buildVersion: nil,
date: versionDate,
localizedDescription: versionDescription,
downloadURL: downloadURL,
size: Int64(size),
appBundleID: self.bundleIdentifier,
in: context)
}
public override func awakeFromInsert()
{
super.awakeFromInsert()
self.featuredSortID = UUID().uuidString
}
}
internal extension StoreApp
{
func setVersions(_ versions: [AppVersion]) throws
{
func setVersions(_ versions: [AppVersion]) throws
{
guard let latestVersion = versions.first else {
throw MergeError.noVersions(for: self)
}
@@ -513,7 +622,7 @@ internal extension StoreApp
let latestSupportedVersion = versions.first(where: { $0.isSupported })
self.latestSupportedVersion = latestSupportedVersion
for case let version as AppVersion in self._versions
{
if version == latestSupportedVersion
@@ -534,7 +643,7 @@ internal extension StoreApp
self.downloadURL = latestVersion.downloadURL
self._size = Int32(latestVersion.size)
}
func setPermissions(_ permissions: Set<AppPermission>)
{
for case let permission as AppPermission in self._permissions
@@ -548,10 +657,10 @@ internal extension StoreApp
permission.app = nil
}
}
self._permissions = permissions as NSSet
}
func setScreenshots(_ screenshots: [AppScreenshot])
{
for case let screenshot as AppScreenshot in self._screenshots
@@ -565,9 +674,9 @@ internal extension StoreApp
screenshot.app = nil
}
}
self._screenshots = NSOrderedSet(array: screenshots)
// Backwards compatibility
self.screenshotURLs = screenshots.map { $0.imageURL }
}
@@ -581,11 +690,11 @@ public extension StoreApp
let filteredScreenshots = self.allScreenshots.filter { $0.deviceType == deviceType }
return filteredScreenshots
}
func preferredScreenshots() -> [AppScreenshot]
{
let deviceType: ALTDeviceType
if UIDevice.current.model.contains("iPad")
{
deviceType = .ipad
@@ -594,13 +703,13 @@ public extension StoreApp
{
deviceType = .iphone
}
let preferredScreenshots = self.screenshots(for: deviceType)
guard !preferredScreenshots.isEmpty else {
// There are no screenshots for deviceType, so return _all_ screenshots instead.
return self.allScreenshots
}
return preferredScreenshots
}
}
@@ -610,10 +719,10 @@ public extension StoreApp
var latestAvailableVersion: AppVersion? {
return self._versions.firstObject as? AppVersion
}
var globallyUniqueID: String? {
guard let sourceIdentifier = self.sourceIdentifier else { return nil }
let globallyUniqueID = self.bundleIdentifier + "|" + sourceIdentifier
return globallyUniqueID
}
@@ -629,63 +738,71 @@ public extension StoreApp
#keyPath(StoreApp.isPledged))
return predicate
}
class var otherCategoryPredicate: NSPredicate {
let knownCategories = StoreCategory.allCases.lazy.filter { $0 != .other }.map { $0.rawValue }
let predicate = NSPredicate(format: "%K == nil OR NOT (%K IN %@)", #keyPath(StoreApp._category), #keyPath(StoreApp._category), Array(knownCategories))
return predicate
}
@nonobjc class func fetchRequest() -> NSFetchRequest<StoreApp>
{
return NSFetchRequest<StoreApp>(entityName: "StoreApp")
}
private static var sideStoreAppIconURL: URL {
let iconNames = [
"AppIcon76x76@2x~ipad",
"AppIcon60x60@2x",
"AppIcon"
]
for iconName in iconNames {
if let path = Bundle.main.path(forResource: iconName, ofType: "png") {
return URL(fileURLWithPath: path)
}
}
return URL(string: "https://sidestore.io/apps-v2.json/apps/sidestore/icon.png")!
}
class func makeAltStoreApp(version: String, buildVersion: String?, in context: NSManagedObjectContext) -> StoreApp
{
let placeholderAppID = StoreApp.altstoreAppID
let placeholderBundleId = StoreApp.altstoreAppID
let placeholderDownloadURL = URL(string: "https://sidestore.io")!
let placeholderSourceID = Source.altStoreIdentifier
let placeholderVersion = "0.0.0"
let placeholderDate = Date.distantPast
// let placeholderDate = Date(timeIntervalSinceReferenceDate: 0)
// let placeholderDate = Date(timeIntervalSince1970: 0)
var placeholderChannel = ReleaseTracks.stable.stringValue // placeholder is always assumed to be from stable channel
let placeholderSize: Int32 = 0
#if BETA
placeholderChannel = ReleaseTracks.beta.stringValue
#endif
let app = StoreApp(context: context)
app.name = "SideStore"
app.bundleIdentifier = placeholderAppID
app.bundleIdentifier = placeholderBundleId
app.developerName = "Side Team"
app.localizedDescription = "SideStore is an alternative App Store."
app.iconURL = Self.sideStoreAppIconURL
app.iconURL = sideStoreAppIconURL
app.screenshotURLs = []
app.sourceIdentifier = placeholderSourceID
let appVersion = AppVersion.makeAppVersion(version: version,
let appVersion = AppVersion.makeAppVersion(version: placeholderVersion,
buildVersion: buildVersion,
date: Date(),
channel: placeholderChannel,
date: placeholderDate,
downloadURL: placeholderDownloadURL,
size: 0,
size: Int64(app._size),
appBundleID: app.bundleIdentifier,
sourceID: app.sourceIdentifier,
in: context)
try? app.setVersions([appVersion])
#if BETA
app.isBeta = true
#endif
return app
}

View File

@@ -10,6 +10,7 @@ import sys
VERSION_IPA = os.getenv("VERSION_IPA")
VERSION_DATE = os.getenv("VERSION_DATE")
IS_BETA = os.getenv("IS_BETA")
RELEASE_CHANNEL = os.getenv("RELEASE_CHANNEL")
SIZE = os.getenv("SIZE")
SHA256 = os.getenv("SHA256")
LOCALIZED_DESCRIPTION = os.getenv("LOCALIZED_DESCRIPTION")
@@ -21,6 +22,7 @@ BUNDLE_IDENTIFIER = os.getenv("BUNDLE_IDENTIFIER")
# VERSION_IPA = os.getenv("VERSION_IPA", "0.0.0")
# VERSION_DATE = os.getenv("VERSION_DATE", "2000-12-18T00:00:00Z")
# IS_BETA = os.getenv("IS_BETA", True)
# RELEASE_CHANNEL = os.getenv("RELEASE_CHANNEL", "alpha")
# SIZE = int(os.getenv("SIZE", "0")) # Convert to integer
# SHA256 = os.getenv("SHA256", "")
# LOCALIZED_DESCRIPTION = os.getenv("LOCALIZED_DESCRIPTION", "Invalid Update")
@@ -40,6 +42,7 @@ print("Bundle Identifier:", BUNDLE_IDENTIFIER)
print("Version:", VERSION_IPA)
print("Version Date:", VERSION_DATE)
print("IsBeta:", IS_BETA)
print("ReleaseChannel:", RELEASE_CHANNEL)
print("Size:", SIZE)
print("Sha256:", SHA256)
print("Localized Description:", LOCALIZED_DESCRIPTION)
@@ -63,6 +66,7 @@ except Exception as e:
if (not BUNDLE_IDENTIFIER or
not VERSION_IPA or
not VERSION_DATE or
not RELEASE_CHANNEL or
not SIZE or
not SHA256 or
not LOCALIZED_DESCRIPTION or
@@ -76,45 +80,106 @@ SIZE = int(SIZE)
# Process the JSON data
updated = False
apps = data.get("apps", [])
appsToUpdate = [app for app in apps if app.get("bundleIdentifier") == BUNDLE_IDENTIFIER]
if len(appsToUpdate) == 0:
# apps = data.get("apps", [])
# appsToUpdate = [app for app in apps if app.get("bundleIdentifier") == BUNDLE_IDENTIFIER]
# if len(appsToUpdate) == 0:
# print("No app with the specified bundle identifier found.")
# sys.exit(1)
# if len(appsToUpdate) > 1:
# print(f"Multiple apps with same `bundleIdentifier` = ${BUNDLE_IDENTIFIER} are not allowed!")
# sys.exit(1)
# app = appsToUpdate[0]
# # Update app-level metadata for store front page
# app.update({
# "beta": IS_BETA,
# })
# versions = app.get("versions", [])
# versionIfExists = [version for version in versions if version == VERSION_IPA]
# if versionIfExists: # current version is a duplicate, so reject it
# print(f"`version` = ${VERSION_IPA} already exists!, new build cannot have an existing version, Aborting!")
# sys.exit(1)
# # create an entry and keep ready
# new_version = {
# "version": VERSION_IPA,
# "date": VERSION_DATE,
# "localizedDescription": LOCALIZED_DESCRIPTION,
# "downloadURL": DOWNLOAD_URL,
# "size": SIZE,
# "sha256": SHA256,
# }
# if versions is []:
# versions.append(new_version)
# else:
# # versions.insert(0, new_version) # insert at front
# versions[0] = new_version # replace top one
# make it lowecase
RELEASE_CHANNEL = RELEASE_CHANNEL.lower()
version = data.get("version", 1)
if int(version) < 2:
print("Only v2 and above are supported for direct updates to sources.json on push")
sys.exit(1)
for app in data.get("apps", []):
if app.get("bundleIdentifier") == BUNDLE_IDENTIFIER:
if RELEASE_CHANNEL == "stable" :
# Update app-level metadata for store front page
app.update({
"version": VERSION_IPA,
"versionDate": VERSION_DATE,
"size": SIZE,
"sha256": SHA256,
"localizedDescription": LOCALIZED_DESCRIPTION,
"downloadURL": DOWNLOAD_URL,
})
# Process the versions array
channels = app.get("releaseChannels", [])
if not channels:
app["releaseChannels"] = channels
# create an entry and keep ready
new_version = {
"version": VERSION_IPA,
"date": VERSION_DATE,
"localizedDescription": LOCALIZED_DESCRIPTION,
"downloadURL": DOWNLOAD_URL,
"size": SIZE,
"sha256": SHA256,
}
tracks = [track for track in channels if track.get("track") == RELEASE_CHANNEL]
if len(tracks) > 1:
print(f"Multiple tracks with same `track` name = ${RELEASE_CHANNEL} are not allowed!")
sys.exit(1)
if not tracks:
# there was no entries in this release channel so create one
track = {
"track": RELEASE_CHANNEL,
"releases": [new_version]
}
channels.insert(0, track)
else:
track = tracks[0] # first result is the selected track
# Update the existing TOP version object entry
track["releases"][0] = new_version
updated = True
break
if not updated:
print("No app with the specified bundle identifier found.")
sys.exit(1)
if len(appsToUpdate) > 1:
print(f"Multiple apps with same `bundleIdentifier` = ${BUNDLE_IDENTIFIER} are not allowed!")
sys.exit(1)
app = appsToUpdate[0]
# Update app-level metadata for store front page
app.update({
"beta": IS_BETA,
})
versions = app.get("versions", [])
versionIfExists = [version for version in versions if version == VERSION_IPA]
if versionIfExists: # current version is a duplicate, so reject it
print(f"`version` = ${VERSION_IPA} already exists!, new build cannot have an existing version, Aborting!")
sys.exit(1)
# create an entry and keep ready
new_version = {
"version": VERSION_IPA,
"date": VERSION_DATE,
"localizedDescription": LOCALIZED_DESCRIPTION,
"downloadURL": DOWNLOAD_URL,
"size": SIZE,
"sha256": SHA256,
}
if versions is []:
versions.append(new_version)
else:
# versions.insert(0, new_version) # insert at front
versions[0] = new_version # replace top one
# Save the updated JSON to the input file
try:
print("\nUpdated Sources File:\n")