From d661a753346aa4e4396c12f00b8c89790ae6c16a Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Wed, 13 Jul 2022 11:43:08 -0500 Subject: [PATCH 1/9] Updates app version to 1.5.1 --- AltStore.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AltStore.xcodeproj/project.pbxproj b/AltStore.xcodeproj/project.pbxproj index 685576bd..a3cf6c68 100644 --- a/AltStore.xcodeproj/project.pbxproj +++ b/AltStore.xcodeproj/project.pbxproj @@ -3371,8 +3371,8 @@ "$(PROJECT_DIR)/Dependencies/fragmentzip", "$(PROJECT_DIR)/Dependencies/libcurl", ); + MARKETING_VERSION = 1.5.1; PRODUCT_BUNDLE_IDENTIFIER = com.rileytestut.AltStore; - MARKETING_VERSION = 1.5.1b; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "AltStore/AltStore-Bridging-Header.h"; @@ -3405,8 +3405,8 @@ "$(PROJECT_DIR)/Dependencies/fragmentzip", "$(PROJECT_DIR)/Dependencies/libcurl", ); + MARKETING_VERSION = 1.5.1; PRODUCT_BUNDLE_IDENTIFIER = com.rileytestut.AltStore; - MARKETING_VERSION = 1.5.1b; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "AltStore/AltStore-Bridging-Header.h"; From 26ba2aa2217707eda4d0546810e7f70243a34bef Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Wed, 20 Jul 2022 13:13:23 -0500 Subject: [PATCH 2/9] =?UTF-8?q?[AltPlugin]=20Fixes=20crash=20when=20device?= =?UTF-8?q?=E2=80=99s=20serial=20number=20is=20nil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For unknown reasons, AKDevice.serialNumber can sometimes return nil. As a workaround, we just fall back to a hardcoded valid serial number if AKDevice.serialNumber is nil. --- AltPlugin/ALTPluginService.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AltPlugin/ALTPluginService.m b/AltPlugin/ALTPluginService.m index 563d5143..9bbd6c29 100644 --- a/AltPlugin/ALTPluginService.m +++ b/AltPlugin/ALTPluginService.m @@ -21,7 +21,7 @@ @interface AKDevice + (AKDevice *)currentDevice; - (NSString *)uniqueDeviceIdentifier; -- (NSString *)serialNumber; +- (nullable NSString *)serialNumber; - (NSString *)serverFriendlyDescription; @end @@ -83,7 +83,7 @@ localUserID:headers[@"X-Apple-I-MD-LU"] routingInfo:[headers[@"X-Apple-I-MD-RINFO"] longLongValue] deviceUniqueIdentifier:device.uniqueDeviceIdentifier - deviceSerialNumber:device.serialNumber + deviceSerialNumber:device.serialNumber ?: @"C02LKHBBFD57" // serialNumber can be nil, so provide valid fallback serial number. deviceDescription:device.serverFriendlyDescription date:date locale:[NSLocale currentLocale] From ec6d6db428dc70e0d161a65787e7559cb376d105 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Thu, 28 Jul 2022 11:22:55 -0500 Subject: [PATCH 3/9] [Apps] Updates AltStore to 1.5.1 --- AltStore/Resources/apps.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/AltStore/Resources/apps.json b/AltStore/Resources/apps.json index cdc80179..7db6a760 100644 --- a/AltStore/Resources/apps.json +++ b/AltStore/Resources/apps.json @@ -7,14 +7,14 @@ "name": "AltStore", "bundleIdentifier": "com.rileytestut.AltStore", "developerName": "Riley Testut", - "version": "1.5", - "versionDate": "2022-05-06T08:00:00-07:00", - "versionDescription": "TRUSTED SOURCES\n• Download and update certain third party apps entirely through AltStore\n• Add Trusted Sources directly from the new Sources page\n• Trusted Sources are sources we’ve explicitly approved that meet our safety standards\n• You can still sideload any .ipa you want via the \"+\" button in My Apps \n• Support for adding any source by URL will be coming later\n\nALTJIT\n• Allows sideloaded apps to use Just-in-Time (JIT) compilation\n• Long-press an app in My Apps, then choose “Enable JIT”\n• JIT will remain enabled until the app is quit\n• Requires iOS 14 or later\n• Requires AltServer 1.5 or later\n\nIMPROVED\n• Adds Shane to credits and Patreon screen\n• Loads “Friend Tier” Patrons much faster on Patreon screen\n\nFIXED\n• Fixed a potential crash when sideloading certain apps\n• Fixed some apps having access to AltStore’s app group after being (de-)activated\n• Fixed Core Data error when not connected to internet", - "downloadURL": "https://cdn.altstore.io/file/altstore/apps/altstore/1_5.ipa", + "version": "1.5.1", + "versionDate": "2022-07-14T12:00:00-05:00", + "versionDescription": "This update fixes the following issues:\n\n• Using Apple IDs that contain capital letters\n• Using Apple IDs with 2FA enabled without any trusted devices\n• Repeatedly asking some users to sign in every refresh\n• \"Incorrect Apple ID or password\" error after changing Apple ID email address\n• “Application is missing application-identifier” error when sideloading or (de-)activating certain apps\n• Potential crash when receiving unknown error codes from AltServer", + "downloadURL": "https://cdn.altstore.io/file/altstore/apps/altstore/1_5_1.ipa", "localizedDescription": "AltStore is an alternative app store for non-jailbroken devices. \n\nThis version of AltStore allows you to install Delta, an all-in-one emulator for iOS, as well as sideload other .ipa files from the Files app.", "iconURL": "https://user-images.githubusercontent.com/705880/65270980-1eb96f80-dad1-11e9-9367-78ccd25ceb02.png", "tintColor": "018084", - "size": 5459395, + "size": 5465976, "screenshotURLs": [ "https://user-images.githubusercontent.com/705880/78942028-acf54300-7a6d-11ea-821c-5bb7a9b3e73a.PNG", "https://user-images.githubusercontent.com/705880/78942222-0fe6da00-7a6e-11ea-9f2a-dda16157583c.PNG", From c7e69f495466edfe07110c87d1564045dc8a10d1 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Thu, 28 Jul 2022 11:41:52 -0500 Subject: [PATCH 4/9] =?UTF-8?q?[Apps]=20Adds=20=E2=80=9CNew=20to=20AltStor?= =?UTF-8?q?e=3F=E2=80=9D=20news=20to=20highlight=20revamped=20FAQ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also removes old “Welcome to AltStore” news --- AltStore/Resources/apps.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/AltStore/Resources/apps.json b/AltStore/Resources/apps.json index 7db6a760..0b2ab646 100644 --- a/AltStore/Resources/apps.json +++ b/AltStore/Resources/apps.json @@ -186,15 +186,6 @@ "date": "2019-09-28", "notify": true }, - { - "title": "Welcome to AltStore", - "identifier": "welcome-to-altstore", - "caption": "Please read the FAQ for help with installing apps.", - "tintColor": "018084", - "url": "https://altstore.io/faq/", - "date": "2019-09-28", - "notify": false - }, { "title": "Sideloading is Here!", "identifier": "sideloading-is-here", @@ -261,6 +252,15 @@ "url": "https://faq.altstore.io/release-notes/altstore", "date": "2022-05-05", "notify": true + }, + { + "title": "New to AltStore?", + "identifier": "updated-faq", + "caption": "Check out our updated guide to learn how to sideload apps!", + "tintColor": "018084", + "url": "https://faq.altstore.io", + "date": "2022-07-28", + "notify": false } ], "userInfo": { From 7ffa7df8bfd0e1f953fe3c227b3e2a26d1de8015 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Wed, 17 Aug 2022 15:22:43 -0500 Subject: [PATCH 5/9] =?UTF-8?q?Fixes=20=E2=80=9Cstored=20properties=20cann?= =?UTF-8?q?ot=20be=20marked=20@available=E2=80=9D=20compiler=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Xcode 13 and earlier allowed us to mark lazy stored properties with @available, but it turns out this was never actually supported. Xcode 14 now throws a compiler error, so we work around it by converting lazy @available properties into computed properties, backed by typed-erased lazy ivars. --- AltStore/AppDelegate.swift | 22 ++++++++++++++++++--- AltStore/Managing Apps/AppManager.swift | 26 ++++++++++++++++++++----- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/AltStore/AppDelegate.swift b/AltStore/AppDelegate.swift index 49be4e2a..dbbf160f 100644 --- a/AltStore/AppDelegate.swift +++ b/AltStore/AppDelegate.swift @@ -34,11 +34,27 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? @available(iOS 14, *) - private lazy var intentHandler = IntentHandler() + private var intentHandler: IntentHandler { + get { _intentHandler as! IntentHandler } + set { _intentHandler = newValue } + } @available(iOS 14, *) - private lazy var viewAppIntentHandler = ViewAppIntentHandler() - + private var viewAppIntentHandler: ViewAppIntentHandler { + get { _viewAppIntentHandler as! ViewAppIntentHandler } + set { _viewAppIntentHandler = newValue } + } + + private lazy var _intentHandler: Any = { + guard #available(iOS 14, *) else { fatalError() } + return IntentHandler() + }() + + private lazy var _viewAppIntentHandler: Any = { + guard #available(iOS 14, *) else { fatalError() } + return ViewAppIntentHandler() + }() + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Register default settings before doing anything else. diff --git a/AltStore/Managing Apps/AppManager.swift b/AltStore/Managing Apps/AppManager.swift index f9ddba2d..a440824a 100644 --- a/AltStore/Managing Apps/AppManager.swift +++ b/AltStore/Managing Apps/AppManager.swift @@ -46,9 +46,6 @@ class AppManager { static let shared = AppManager() - @available(iOS 13, *) - private(set) lazy var publisher: AppManagerPublisher = AppManagerPublisher() - private(set) var updatePatronsResult: Result? private let operationQueue = OperationQueue() @@ -67,8 +64,27 @@ class AppManager } } - @available(iOS 13.0, *) - private lazy var cancellables = Set() + @available(iOS 13, *) + private(set) var publisher: AppManagerPublisher { + get { _publisher as! AppManagerPublisher } + set { _publisher = newValue } + } + + @available(iOS 13, *) + private(set) var cancellables: Set { + get { _cancellables as! Set } + set { _cancellables = newValue } + } + + private lazy var _publisher: Any = { + guard #available(iOS 13, *) else { fatalError() } + return AppManagerPublisher() + }() + + private lazy var _cancellables: Any = { + guard #available(iOS 13, *) else { fatalError() } + return Set() + }() private init() { From 3ec9fc7370ff1b076ae2917f5e113d300737c7d0 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Wed, 17 Aug 2022 15:27:19 -0500 Subject: [PATCH 6/9] [Apps] Updates Delta beta to 1.4b2 --- AltStore/Resources/apps.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/AltStore/Resources/apps.json b/AltStore/Resources/apps.json index 0b2ab646..c2d70935 100644 --- a/AltStore/Resources/apps.json +++ b/AltStore/Resources/apps.json @@ -92,14 +92,14 @@ "bundleIdentifier": "com.rileytestut.Delta.Beta", "developerName": "Riley Testut", "subtitle": "Classic games in your pocket.", - "version": "1.4b1", - "versionDate": "2022-06-02T09:00:00-07:00", - "versionDescription": "NEW\n• iPad-optimized UI\n• Redesigned iPad controller skins for NES, SNES, and DS games\n• Temporary iPad controller skins for GBC, GBA, Genesis, and N64 games\n\nIMPROVED\n• Modern menu UI when importing games\n• Updated \"Copy Deep Link\" icon when sharing a game\n\nFIXED\n• Fixed keyboard support on iOS 15+\n• Fixed invisible \"Games\" navigation bar and toolbar on iOS 15+\n• Fixed error sharing games via certain share methods\n• Fixed exporting save files for games with names containing special characters\n• Fixed UI bug where previous game controller would remaining selected after switching\n• Fixed game controller input mapping UI on iPad\n• Fixed crash importing games on iPad\n• Fixed crash sharing games on iPad", - "downloadURL": "https://cdn.altstore.io/file/altstore/apps/delta/1_4_b1.ipa", + "version": "1.4b2", + "versionDate": "2022-08-16T08:00:00-05:00", + "versionDescription": "NEW\n• Supports Split View and Stage Manager multitasking on iPad\n• Automatically pauses + resumes emulation when switching between foreground apps with Stage Manager\n• Optimized full screen-width controller skins when using Split View, Slide Over, or Stage Manager\n• Supports controller skins with new `placement` parameter\n• Supports controller skins with custom screens that don’t have explicit `outputFrame`\n\nFIXED\n• Fixed not detecting keyboard presses when remapping inputs\n• Fixed potential crash rendering game screen after changing EAGLContext\n• Fixed incorrect game screen frame when software keyboard appears on iOS 16\n• Fixed software keyboard sometimes appearing when not emulating anything", + "downloadURL": "https://cdn.altstore.io/file/altstore/apps/delta/1_4_b2.ipa", "localizedDescription": "The next consoles for Delta are coming: this beta version of Delta brings support for playing Nintendo DS and Sega Genesis games!\n\nPlease report any issues you find to support@altstore.io. Thanks!", "iconURL": "https://user-images.githubusercontent.com/705880/63391976-4d311700-c37a-11e9-91a8-4fb0c454413d.png", "tintColor": "8A28F7", - "size": 38346715, + "size": 42968657, "beta": true, "permissions": [ { From c27b93e8b516a8da2ccb3ca4c0a09395f9d26935 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Wed, 17 Aug 2022 15:33:13 -0500 Subject: [PATCH 7/9] Adds iOS 16 Lock Screen widget --- AltStore.xcodeproj/project.pbxproj | 8 +++ AltWidget/AltWidget.swift | 35 +++++++++++- AltWidget/ComplicationView.swift | 86 ++++++++++++++++++++++++++++++ AltWidget/ProgressRing.swift | 54 +++++++++++++++++++ 4 files changed, 181 insertions(+), 2 deletions(-) create mode 100644 AltWidget/ComplicationView.swift create mode 100644 AltWidget/ProgressRing.swift diff --git a/AltStore.xcodeproj/project.pbxproj b/AltStore.xcodeproj/project.pbxproj index a3cf6c68..e86bbd7f 100644 --- a/AltStore.xcodeproj/project.pbxproj +++ b/AltStore.xcodeproj/project.pbxproj @@ -348,9 +348,11 @@ BFF7C90F257844C900E55F36 /* AltXPC.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = BFF7C904257844C900E55F36 /* AltXPC.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; BFF7C920257844FA00E55F36 /* ALTPluginService.m in Sources */ = {isa = PBXBuildFile; fileRef = BF5C5FCE237DF69100EDD0C6 /* ALTPluginService.m */; }; BFF7C9342578492100E55F36 /* ALTAnisetteData.m in Sources */ = {isa = PBXBuildFile; fileRef = BFB49AA823834CF900D542D9 /* ALTAnisetteData.m */; }; + D504F42628AD72C50014BB5D /* ProgressRing.swift in Sources */ = {isa = PBXBuildFile; fileRef = D504F42528AD72C50014BB5D /* ProgressRing.swift */; }; D533E8B72727841800A9B5DD /* libAppleArchive.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D533E8B62727841800A9B5DD /* libAppleArchive.tbd */; settings = {ATTRIBUTES = (Weak, ); }; }; D533E8BC2727BBEE00A9B5DD /* libfragmentzip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D533E8BB2727BBEE00A9B5DD /* libfragmentzip.a */; }; D533E8BE2727BBF800A9B5DD /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D533E8BD2727BBF800A9B5DD /* libcurl.a */; }; + D55E163728776CB700A627A1 /* ComplicationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D55E163528776CB000A627A1 /* ComplicationView.swift */; }; D57DF638271E32F000677701 /* PatchApp.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D57DF637271E32F000677701 /* PatchApp.storyboard */; }; D57DF63F271E51E400677701 /* ALTAppPatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = D57DF63E271E51E400677701 /* ALTAppPatcher.m */; }; D57F2C9126E0070200B9FA39 /* EnableJITOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57F2C9026E0070200B9FA39 /* EnableJITOperation.swift */; }; @@ -811,10 +813,12 @@ BFF7EC4C25081E9300BDE521 /* AltStore 8.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "AltStore 8.xcdatamodel"; sourceTree = ""; }; BFFCFA45248835530077BFCE /* AltDaemon.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AltDaemon.entitlements; sourceTree = ""; }; C9EEAA842DA87A88A870053B /* Pods_AltStore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AltStore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D504F42528AD72C50014BB5D /* ProgressRing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressRing.swift; sourceTree = ""; }; D533E8B62727841800A9B5DD /* libAppleArchive.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libAppleArchive.tbd; path = usr/lib/libAppleArchive.tbd; sourceTree = SDKROOT; }; D533E8B82727B61400A9B5DD /* fragmentzip.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fragmentzip.h; sourceTree = ""; }; D533E8BB2727BBEE00A9B5DD /* libfragmentzip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfragmentzip.a; path = Dependencies/fragmentzip/libfragmentzip.a; sourceTree = SOURCE_ROOT; }; D533E8BD2727BBF800A9B5DD /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = Dependencies/libcurl/libcurl.a; sourceTree = SOURCE_ROOT; }; + D55E163528776CB000A627A1 /* ComplicationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComplicationView.swift; sourceTree = ""; }; D57DF637271E32F000677701 /* PatchApp.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = PatchApp.storyboard; sourceTree = ""; }; D57DF63D271E51E400677701 /* ALTAppPatcher.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALTAppPatcher.h; sourceTree = ""; }; D57DF63E271E51E400677701 /* ALTAppPatcher.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALTAppPatcher.m; sourceTree = ""; }; @@ -1398,6 +1402,8 @@ BF98917D250AAC4F002ACF50 /* AltWidget.swift */, BF42345825101C1D006D1EB2 /* WidgetView.swift */, BF98917C250AAC4F002ACF50 /* Countdown.swift */, + D55E163528776CB000A627A1 /* ComplicationView.swift */, + D504F42528AD72C50014BB5D /* ProgressRing.swift */, BF989170250AABF4002ACF50 /* Assets.xcassets */, BF989172250AABF4002ACF50 /* Info.plist */, ); @@ -2543,7 +2549,9 @@ files = ( BF98917E250AAC4F002ACF50 /* Countdown.swift in Sources */, BF42345A25101C35006D1EB2 /* WidgetView.swift in Sources */, + D55E163728776CB700A627A1 /* ComplicationView.swift in Sources */, BF98917F250AAC4F002ACF50 /* AltWidget.swift in Sources */, + D504F42628AD72C50014BB5D /* ProgressRing.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/AltWidget/AltWidget.swift b/AltWidget/AltWidget.swift index ca64beaa..8dbd8f7c 100644 --- a/AltWidget/AltWidget.swift +++ b/AltWidget/AltWidget.swift @@ -173,8 +173,7 @@ struct Provider: IntentTimelineProvider } } -@main -struct AltWidget: Widget +struct HomeScreenWidget: Widget { private let kind: String = "AppDetail" @@ -189,3 +188,35 @@ struct AltWidget: Widget .description("View remaining days until your sideloaded apps expire.") } } + +struct LockScreenWidget: Widget +{ + private let kind: String = "LockAppDetail" + + public var body: some WidgetConfiguration { + if #available(iOSApplicationExtension 16, *) + { + return IntentConfiguration(kind: kind, + intent: ViewAppIntent.self, + provider: Provider()) { (entry) in + ComplicationView(entry: entry) + } + .supportedFamilies([.accessoryCircular]) + .configurationDisplayName("AltWidget") + .description("View remaining days until AltStore expires.") + } + else + { + return EmptyWidgetConfiguration() + } + } +} + +@main +struct AltWidgets: WidgetBundle +{ + var body: some Widget { + HomeScreenWidget() + LockScreenWidget() + } +} diff --git a/AltWidget/ComplicationView.swift b/AltWidget/ComplicationView.swift new file mode 100644 index 00000000..19222926 --- /dev/null +++ b/AltWidget/ComplicationView.swift @@ -0,0 +1,86 @@ +// +// ComplicationView.swift +// AltStore +// +// Created by Riley Testut on 7/7/22. +// Copyright © 2022 Riley Testut. All rights reserved. +// + +import SwiftUI +import WidgetKit + +@available(iOS 16, *) +struct ComplicationView: View +{ + let entry: AppEntry + + var body: some View { + let refreshedDate = self.entry.app?.refreshedDate ?? .now + let expirationDate = self.entry.app?.expirationDate ?? .now + + let totalDays = expirationDate.numberOfCalendarDays(since: refreshedDate) + let daysRemaining = expirationDate.numberOfCalendarDays(since: self.entry.date) + + let progress = Double(daysRemaining) / Double(totalDays) + + ZStack(alignment: .center) { + ProgressRing(progress: progress) { + if daysRemaining < 0 + { + Text("Expired") + .font(.system(size: 10, weight: .bold)) + } + else + { + VStack(spacing: -1) { + Text("\(daysRemaining)") + .font(.system(size: 20, weight: .bold, design: .rounded)) + + Text(daysRemaining == 1 ? "DAY" : "DAYS") + .font(.caption) + } + .offset(y: -1) + } + } + } + .unredacted() + } +} + +@available(iOS 16, *) +struct ComplicationView_Previews: PreviewProvider { + static var previews: some View { + let shortRefreshedDate = Calendar.current.date(byAdding: .day, value: -2, to: Date()) ?? Date() + let shortExpirationDate = Calendar.current.date(byAdding: .day, value: 7, to: shortRefreshedDate) ?? Date() + + let longRefreshedDate = Calendar.current.date(byAdding: .day, value: -100, to: Date()) ?? Date() + let longExpirationDate = Calendar.current.date(byAdding: .day, value: 365, to: longRefreshedDate) ?? Date() + + let expiredDate = shortExpirationDate.addingTimeInterval(1 * 60 * 60 * 24) + + let weekAltstore = AppSnapshot(name: "AltStore", + bundleIdentifier: "com.rileytestut.AltStore", + expirationDate: shortExpirationDate, + refreshedDate: shortRefreshedDate, + tintColor: .altPrimary, + icon: UIImage(named: "AltStore")) + + let yearAltstore = AppSnapshot(name: "AltStore", + bundleIdentifier: "com.rileytestut.AltStore", + expirationDate: longExpirationDate, + refreshedDate: longRefreshedDate, + tintColor: .altPrimary, + icon: UIImage(named: "AltStore")) + + return Group { + ComplicationView(entry: AppEntry(date: Date(), app: weekAltstore)) + .previewContext(WidgetPreviewContext(family: .accessoryCircular)) + + ComplicationView(entry: AppEntry(date: expiredDate, app: weekAltstore)) + .previewContext(WidgetPreviewContext(family: .accessoryCircular)) + + ComplicationView(entry: AppEntry(date: longRefreshedDate, app: yearAltstore)) + .previewContext(WidgetPreviewContext(family: .accessoryCircular)) + } + } +} diff --git a/AltWidget/ProgressRing.swift b/AltWidget/ProgressRing.swift new file mode 100644 index 00000000..4464e20f --- /dev/null +++ b/AltWidget/ProgressRing.swift @@ -0,0 +1,54 @@ +// +// ProgressRing.swift +// AltWidgetExtension +// +// Created by Riley Testut on 8/17/22. +// Copyright © 2022 Riley Testut. All rights reserved. +// + +import SwiftUI +import WidgetKit + +struct ProgressRing: View +{ + let progress: Double + + private let content: Content + + init(progress: Double, @ViewBuilder content: () -> Content) + { + self.progress = progress + self.content = content() + } + + var body: some View { + ZStack(alignment: .center) { + ring(progress: 1.0) + .opacity(0.3) + + ring(progress: self.progress) + + content + } + } + + @ViewBuilder + private func ring(progress: Double) -> some View { + let strokeStyle = StrokeStyle(lineWidth: 4.0, lineCap: .round, lineJoin: .round) + + Circle() + .inset(by: 2.0) + .trim(from: 0.0, to: progress) + .rotation(Angle(degrees: -90), anchor: .center) + .stroke(style: strokeStyle) + } +} + +struct ProgressRing_Previews: PreviewProvider { + static var previews: some View { + ProgressRing(progress: 0.5) { + EmptyView() + } + .previewContext(WidgetPreviewContext(family: .systemSmall)) + } +} From fadb95ca6819a75bd0a456c4539a783a1f602ae1 Mon Sep 17 00:00:00 2001 From: JJTech Date: Fri, 19 Aug 2022 11:35:31 -0400 Subject: [PATCH 8/9] Use Xcode 14 (#55) New iOS 16 features require Xcode 14 Xcode 14 is only available on macOS 12 runners Signed-off-by: JJTech --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 01a45e86..27996217 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,12 +3,16 @@ on: [push, pull_request] jobs: build: name: Build and upload SideStore - runs-on: macos-11 + runs-on: macos-12 steps: - name: Checkout code uses: actions/checkout@v2 with: submodules: recursive + - name: Setup Xcode 14 + uses: maxim-lobanov/setup-xcode@v1.4.1 + with: + xcode-version: '14.0-beta' - name: Build SideStore run: | rm -rf ~/Library/Developer/Xcode/DerivedData/ From ea8e99f7d27b86f355a3cde7fe3107dfd303ff62 Mon Sep 17 00:00:00 2001 From: JJTech Date: Tue, 23 Aug 2022 18:13:20 -0400 Subject: [PATCH 9/9] Convert to build matrix (#56) * Convert to build matrix * turn off fail-fast strategy we don't want all the jobs cancelled just because it didn't build in an old version of Xcode * only trigger push build when pushing to master or develop Signed-off-by: JJTech --- .github/workflows/build.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27996217..138f04ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,18 +1,35 @@ name: Build and Upload SideStore -on: [push, pull_request] +on: + push: + branches: + - master + - develop + pull_request: + jobs: build: name: Build and upload SideStore - runs-on: macos-12 + strategy: + fail-fast: false + matrix: + include: + - os: 'macos-12' + version: '14.0-beta' + - os: 'macos-12' + version: '13.4.1' + - os: 'macos-11' + version: '13.2.1' + + runs-on: ${{ matrix.os }} steps: - name: Checkout code uses: actions/checkout@v2 with: submodules: recursive - - name: Setup Xcode 14 + - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1.4.1 with: - xcode-version: '14.0-beta' + xcode-version: ${{ matrix.version }} - name: Build SideStore run: | rm -rf ~/Library/Developer/Xcode/DerivedData/