diff --git a/Sources/PrivateFrameworks/CommerceKit/CKDownloadDirectory.h b/Sources/PrivateFrameworks/CommerceKit/CKDownloadDirectory.h index e3ad766b6..bb3e31678 100644 --- a/Sources/PrivateFrameworks/CommerceKit/CKDownloadDirectory.h +++ b/Sources/PrivateFrameworks/CommerceKit/CKDownloadDirectory.h @@ -5,8 +5,4 @@ // Copyright © 2018 mas-cli. All rights reserved. // -NS_ASSUME_NONNULL_BEGIN - -NSString *CKDownloadDirectory(NSString * _Nullable target); - -NS_ASSUME_NONNULL_END +NSString * _Nonnull CKDownloadDirectory(NSString * _Nullable target); diff --git a/Sources/PrivateFrameworks/CommerceKit/CKDownloadQueue.h b/Sources/PrivateFrameworks/CommerceKit/CKDownloadQueue.h index e665179e3..1d6a0eebe 100644 --- a/Sources/PrivateFrameworks/CommerceKit/CKDownloadQueue.h +++ b/Sources/PrivateFrameworks/CommerceKit/CKDownloadQueue.h @@ -5,8 +5,6 @@ // - LC_SOURCE_VERSION: 715.5.1.0.0 // -NS_ASSUME_NONNULL_BEGIN - @interface CKDownloadQueue : CKServiceInterface { NSMutableDictionary *_downloadsByItemID; NSLock *_downloadsLock; @@ -14,32 +12,30 @@ NS_ASSUME_NONNULL_BEGIN NSLock *_tokenLock NS_AVAILABLE_MAC(13); } -+ (instancetype)sharedDownloadQueue; ++ (nonnull instancetype)sharedDownloadQueue; -@property(retain, nonatomic) NSMutableDictionary *downloadQueueObservers; -@property(readonly, nonatomic) NSArray *downloads; -@property(retain, nonatomic) CKDownloadQueueClient *sharedObserver; +@property(retain, nonatomic, nullable) NSMutableDictionary * downloadQueueObservers; // +@property(readonly, nonatomic, nullable) NSArray *downloads; // Unverified generic type +@property(retain, nonatomic, nullable) CKDownloadQueueClient *sharedObserver; -- (void)addDownload:(SSDownload *)download; -- (id)addObserver:(id)observer; -- (id)addObserver:(id)observer forDownloadTypes:(long long)downloadTypes; -- (id)addObserverForDownloadTypes:(long long)downloadTypes withBlock:(UnknownBlock *)block; -- (BOOL)cacheReceiptDataForDownload:(SSDownload *)download; -- (void)cancelDownload:(SSDownload *)download promptToConfirm:(BOOL)promptToConfirm askToDelete:(BOOL)askToDelete; -- (void)checkStoreDownloadQueueForAccount:(ISStoreAccount *)account; +- (void)addDownload:(nonnull SSDownload *)download; +- (nonnull NSString *)addObserver:(nullable id)observer; +- (nonnull NSString *)addObserver:(nullable id)observer forDownloadTypes:(long long)downloadTypes; +- (nonnull NSString *)addObserverForDownloadTypes:(long long)downloadTypes withBlock:(nullable UnknownBlock)block; +- (BOOL)cacheReceiptDataForDownload:(nullable SSDownload *)download; +- (void)cancelDownload:(nullable SSDownload *)download promptToConfirm:(BOOL)promptToConfirm askToDelete:(BOOL)askToDelete; +- (void)checkStoreDownloadQueueForAccount:(nullable ISStoreAccount *)account; // Unverified account type - (void)connectionWasInterrupted; -- (SSDownload *)downloadForItemIdentifier:(unsigned long long)identifier; -- (void)fetchIconForItemIdentifier:(unsigned long long)identifier atURL:(NSURL *)url replyBlock:(UnknownBlock *)block; -- (instancetype)initWithStoreClient:(ISStoreClient *)client; -- (void)lockApplicationsForBundleID:(NSString *)bundleID; -- (void)lockedApplicationTriedToLaunchAtPath:(NSString *)path; +- (nullable SSDownload *)downloadForItemIdentifier:(unsigned long long)identifier; // Unverified return type +- (void)fetchIconForItemIdentifier:(unsigned long long)identifier atURL:(nullable NSURL *)url replyBlock:(nonnull UnknownBlock)block; +- (nonnull instancetype)initWithStoreClient:(nullable ISStoreClient *)client; // Unverified client type +- (void)lockApplicationsForBundleID:(nullable NSString *)bundleID; // Unverified bundleID type +- (void)lockedApplicationTriedToLaunchAtPath:(nullable NSString *)path; // Unverified path type - (void)pauseDownloadWithItemIdentifier:(unsigned long long)identifier; - (void)performedIconAnimationForDownloadWithIdentifier:(unsigned long long)identifier; - (void)removeDownloadWithItemIdentifier:(unsigned long long)identifier; -- (void)removeObserver:(id)observer; +- (void)removeObserver:(nullable NSString *)observer; // Unverified observer type - (void)resumeDownloadWithItemIdentifier:(unsigned long long)identifier; -- (void)unlockApplicationsWithBundleIdentifier:(NSString *)bundleID; +- (void)unlockApplicationsWithBundleIdentifier:(nullable NSString *)bundleID; // Unverified bundleID type @end - -NS_ASSUME_NONNULL_END diff --git a/Sources/PrivateFrameworks/CommerceKit/CKDownloadQueueObserver-Protocol.h b/Sources/PrivateFrameworks/CommerceKit/CKDownloadQueueObserver-Protocol.h index 89f72491a..cb59cf5ac 100644 --- a/Sources/PrivateFrameworks/CommerceKit/CKDownloadQueueObserver-Protocol.h +++ b/Sources/PrivateFrameworks/CommerceKit/CKDownloadQueueObserver-Protocol.h @@ -5,18 +5,14 @@ // Copyright © 2018 mas-cli. All rights reserved. // -NS_ASSUME_NONNULL_BEGIN - @protocol CKDownloadQueueObserver @required -- (void)downloadQueue:(CKDownloadQueue *)downloadQueue changedWithAddition:(SSDownload *)download; -- (void)downloadQueue:(CKDownloadQueue *)downloadQueue changedWithRemoval:(SSDownload *)download; -- (void)downloadQueue:(CKDownloadQueue *)downloadQueue statusChangedForDownload:(SSDownload *)download; +- (void)downloadQueue:(nonnull CKDownloadQueue *)queue changedWithAddition:(nonnull SSDownload *)download; +- (void)downloadQueue:(nonnull CKDownloadQueue *)queue changedWithRemoval:(nonnull SSDownload *)download; +- (void)downloadQueue:(nonnull CKDownloadQueue *)queue statusChangedForDownload:(nonnull SSDownload *)download; @optional @end - -NS_ASSUME_NONNULL_END diff --git a/Sources/PrivateFrameworks/CommerceKit/CKPurchaseController.h b/Sources/PrivateFrameworks/CommerceKit/CKPurchaseController.h index a3ec1a3c8..c7a52c121 100644 --- a/Sources/PrivateFrameworks/CommerceKit/CKPurchaseController.h +++ b/Sources/PrivateFrameworks/CommerceKit/CKPurchaseController.h @@ -5,9 +5,7 @@ // - LC_SOURCE_VERSION: 715.5.1.0.0 // -NS_ASSUME_NONNULL_BEGIN - -typedef void (^SSPurchaseCompletion)(SSPurchase * _Nullable purchase, BOOL completed, NSError * _Nullable error, SSPurchaseResponse * _Nullable response); +typedef void (^SSPurchaseCompletion)(SSPurchase * _Nonnull purchase, BOOL completed, NSError * _Nullable error, SSPurchaseResponse * _Nullable response); @interface CKPurchaseController : CKServiceInterface { NSArray *_adoptionEligibleItems; @@ -18,21 +16,19 @@ typedef void (^SSPurchaseCompletion)(SSPurchase * _Nullable purchase, BOOL compl } + (void)setNeedsSilentMachineAuthorization:(BOOL)needsSilentMachineAuthorization; -+ (instancetype)sharedPurchaseController; ++ (nonnull instancetype)sharedPurchaseController; -@property(copy) UnknownBlock *dialogHandler; +@property(copy, nullable) void (^dialogHandler)(CKDialog * _Nullable); // Unverified type - (void)_performVPPReceiptRenewal; -- (BOOL)adoptionCompletedForBundleID:(NSString *)bundleID; -- (void)cancelPurchaseWithProductID:(NSNumber *)productID; +- (BOOL)adoptionCompletedForBundleID:(nullable NSString *)bundleID; +- (void)cancelPurchaseWithProductID:(nullable NSNumber *)productID; - (void)checkServerDownloadQueue; -- (void)performPurchase:(SSPurchase *)purchase withOptions:(unsigned long long)options completionHandler:(nullable SSPurchaseCompletion)handler; -- (SSPurchase *)purchaseInProgressForProductID:(NSNumber *)productID; -- (NSArray *)purchasesInProgress; -- (void)resumeDownloadForPurchasedProductID:(NSNumber *)productID; -- (void)startPurchases:(NSArray *)purchases shouldStartDownloads:(BOOL)shouldStartDownloads eventHandler:(UnknownBlock *)handler; -- (void)startPurchases:(NSArray *)purchases withOptions:(unsigned long long)options completionHandler:(UnknownBlock *)handler; +- (void)performPurchase:(nonnull SSPurchase *)purchase withOptions:(unsigned long long)options completionHandler:(nullable SSPurchaseCompletion)handler; +- (nullable SSPurchase *)purchaseInProgressForProductID:(nullable NSNumber *)productID; // Unverified return type +- (nullable NSArray *)purchasesInProgress; // Unverified return type +- (void)resumeDownloadForPurchasedProductID:(nullable NSNumber *)productID; // Unverified productID type +- (void)startPurchases:(nullable NSArray *)purchases shouldStartDownloads:(BOOL)shouldStartDownloads eventHandler:(nullable void (^)(NSArray * _Nonnull))handler; // Unverified purchases generic type / handler type +- (void)startPurchases:(nullable NSArray *)purchases withOptions:(unsigned long long)options completionHandler:(nullable void (^)(NSArray * _Nonnull))handler; // Unverified purchases type / handler parameter type @end - -NS_ASSUME_NONNULL_END diff --git a/Sources/PrivateFrameworks/CommerceKit/CKServiceInterface.h b/Sources/PrivateFrameworks/CommerceKit/CKServiceInterface.h index 4a2110b6b..45f6b4ce3 100644 --- a/Sources/PrivateFrameworks/CommerceKit/CKServiceInterface.h +++ b/Sources/PrivateFrameworks/CommerceKit/CKServiceInterface.h @@ -5,10 +5,6 @@ // - LC_SOURCE_VERSION: 715.5.1.0.0 // -NS_ASSUME_NONNULL_BEGIN - @interface CKServiceInterface : ISServiceProxy @end - -NS_ASSUME_NONNULL_END diff --git a/Sources/PrivateFrameworks/CommerceKit/CommerceKit.h b/Sources/PrivateFrameworks/CommerceKit/CommerceKit.h index 8893138ea..ede02ef9e 100644 --- a/Sources/PrivateFrameworks/CommerceKit/CommerceKit.h +++ b/Sources/PrivateFrameworks/CommerceKit/CommerceKit.h @@ -7,7 +7,7 @@ @import StoreFoundation; -@class CKDownloadQueueClient; +@class CKDialog, CKDownloadQueueClient; @protocol CKDownloadQueueObserver; diff --git a/Sources/PrivateFrameworks/StoreFoundation/ISAccountService-Protocol.h b/Sources/PrivateFrameworks/StoreFoundation/ISAccountService-Protocol.h index 7a38e6361..cda84aa71 100644 --- a/Sources/PrivateFrameworks/StoreFoundation/ISAccountService-Protocol.h +++ b/Sources/PrivateFrameworks/StoreFoundation/ISAccountService-Protocol.h @@ -5,54 +5,50 @@ // - LC_SOURCE_VERSION: 715.5.1.0.0 // -NS_ASSUME_NONNULL_BEGIN - @protocol ISAccountService @required -- (void)accountWithAppleID:(NSString *)appleID replyBlock:(void (^)(ISStoreAccount *))block; -- (void)accountWithDSID:(NSNumber *)dsID replyBlock:(void (^)(ISStoreAccount *))block; -- (void)addAccount:(ISStoreAccount *)account; -- (void)addAccountStoreObserver:(id)observer; -- (void)addAccountWithAuthenticationResponse:(ISAuthenticationResponse *)authenticationResponse makePrimary:(BOOL)makePrimary replyBlock:(void (^)(ISStoreAccount *))block NS_DEPRECATED_MAC(10_9, 12); -- (void)addURLBagObserver:(id)observer; -- (void)authIsExpiredWithReplyBlock:(void (^)(BOOL))block; -- (void)dictionaryForDSID:(NSNumber *)dsID withReplyBlock:(void (^)(NSDictionary *))block NS_AVAILABLE_MAC(13); -- (void)dictionaryWithReplyBlock:(void (^)(NSDictionary *))block; -- (void)generateTouchIDHeadersForDSID:(NSNumber *)dsID challenge:(NSString *)challenge caller:(id)caller replyBlock:(void (^)(NSDictionary *, NSError *))block; -- (void)getTouchIDPreferenceWithReplyBlock:(void (^)(BOOL, ISStoreAccount *, NSError *))block; -- (void)httpHeadersForURL:(NSURL *)url forDSID:(NSNumber *)dsID includeADIHeaders:(BOOL)includeADIHeaders withReplyBlock:(void (^)(NSDictionary *))block; -- (void)iCloudDSIDReplyBlock:(void (^)(NSString *))block; +- (void)accountWithAppleID:(nullable NSString *)appleID replyBlock:(nonnull void (^)(ISStoreAccount * _Nullable))block; // Unverified appleID type / block parameter types +- (void)accountWithDSID:(nullable NSNumber *)dsID replyBlock:(nonnull void (^)(ISStoreAccount * _Nullable))block; // Unverified dsID type / block parameter types +- (void)addAccount:(nullable ISStoreAccount *)account; // Unverified account type +- (void)addAccountStoreObserver:(nullable id)observer; // Unverified observer type +- (void)addAccountWithAuthenticationResponse:(nullable ISAuthenticationResponse *)authenticationResponse makePrimary:(BOOL)makePrimary replyBlock:(nonnull void (^)(ISStoreAccount * _Nullable))block NS_DEPRECATED_MAC(10_9, 12); // Unverified +- (void)addURLBagObserver:(nullable id)observer; +- (void)authIsExpiredWithReplyBlock:(nonnull void (^)(BOOL))block; // Unverified block parameter types +- (void)dictionaryForDSID:(nullable NSNumber *)dsID withReplyBlock:(nonnull void (^)(NSDictionary * _Nullable))block NS_AVAILABLE_MAC(13); // Unverified dsID type / block parameter types +- (void)dictionaryWithReplyBlock:(nonnull void (^)(NSDictionary * _Nonnull))block; // Unverified block parameter types +- (void)generateTouchIDHeadersForDSID:(nullable NSNumber *)dsID challenge:(nullable NSString *)challenge caller:(nullable id)caller replyBlock:(nonnull void (^)(NSDictionary * _Nonnull, NSError * _Nullable))block; // Unverified dsID type / challenge type / caller type / block parameter types +- (void)getTouchIDPreferenceWithReplyBlock:(nonnull void (^)(BOOL, ISStoreAccount * _Nullable, NSError * _Nullable))block; // Unverified block parameter types +- (void)httpHeadersForURL:(nullable NSURL *)url forDSID:(nullable NSNumber *)dsID includeADIHeaders:(BOOL)includeADIHeaders withReplyBlock:(nonnull void (^)(NSDictionary * _Nonnull))block; // Unverified url type / dsID type / block parameter types +- (void)iCloudDSIDReplyBlock:(nonnull void (^)(NSString * _Nullable))block; // Unverified block parameter types - (void)invalidateAllBags; -- (void)isValidWithReplyBlock:(void (^)(BOOL))block; -- (void)loadURLBagWithType:(unsigned long long)type replyBlock:(void (^)(BOOL, BOOL, NSError *))block; -- (void)needsSilentADIActionForURL:(NSURL *)url dsID:(NSNumber *)dsID withReplyBlock:(void (^)(BOOL))block NS_AVAILABLE_MAC(13); -- (void)needsSilentADIActionForURL:(NSURL *)url withReplyBlock:(void (^)(BOOL))block; -- (void)parseCreditStringForProtocol:(NSDictionary *)dictionary NS_DEPRECATED_MAC(10_9, 12); -- (void)primaryAccountWithReplyBlock:(void (^)(ISStoreAccount *))block; -- (void)processURLResponse:(NSURLResponse *)urlResponse forRequest:(NSURLRequest *)request; -- (void)processURLResponse:(NSURLResponse *)urlResponse forRequest:(NSURLRequest *)request dsID:(NSNumber *)dsID NS_AVAILABLE_MAC(13); -- (void)recommendedAppleIDForAccountSignIn:(void (^)(NSString *))accountSignIn NS_DEPRECATED_MAC(10_9, 12); -- (void)regexWithKey:(NSString *)key dsID:(NSNumber *)dsID matchesString:(NSString *)string replyBlock:(void (^)(BOOL))block NS_AVAILABLE_MAC(13); -- (void)regexWithKey:(NSString *)key matchesString:(NSString *)string replyBlock:(void (^)(BOOL))block; -- (void)removeAccountStoreObserver:(id)observer; -- (void)removeURLBagObserver:(id)observer; -- (void)retailStoreDemoModeReplyBlock:(void (^)(BOOL, NSString *, NSString *, BOOL))block; -- (void)setStoreFrontID:(NSString *)storefrontID; -- (void)setTouchIDState:(long long)touchIDState forDSID:(NSNumber *)dsID replyBlock:(void (^)(BOOL, NSError *))block; -- (void)shouldSendGUIDWithRequestForURL:(NSURL *)url withReplyBlock:(void (^)(BOOL))block; -- (void)signInWithContext:(ISAuthenticationContext *)context replyBlock:(void (^)(BOOL, ISStoreAccount * _Nullable, NSError * _Nullable))block NS_DEPRECATED_MAC(10_9, 10_12); +- (void)isValidWithReplyBlock:(nonnull void (^)(BOOL))block; // Unverified block parameter types +- (void)loadURLBagWithType:(unsigned long long)type replyBlock:(nonnull void (^)(BOOL, BOOL, NSError * _Nullable))block; // Unverified block parameter types +- (void)needsSilentADIActionForURL:(nullable NSURL *)url dsID:(nullable NSNumber *)dsID withReplyBlock:(nonnull void (^)(BOOL))block NS_AVAILABLE_MAC(13); // Unverified url type / dsID type / block parameter types +- (void)needsSilentADIActionForURL:(nullable NSURL *)url withReplyBlock:(nonnull void (^)(BOOL))block; // Unverified url type / block parameter types +- (void)parseCreditStringForProtocol:(nullable NSDictionary *)dictionary NS_DEPRECATED_MAC(10_9, 12); // Unverified dictionary type +- (void)primaryAccountWithReplyBlock:(nonnull void (^)(ISStoreAccount * _Nullable))block; // Unverified block parameter types +- (void)processURLResponse:(nullable NSURLResponse *)urlResponse forRequest:(nullable NSURLRequest *)request; // Unverified urlResponse type / request type +- (void)processURLResponse:(nullable NSURLResponse *)urlResponse forRequest:(nullable NSURLRequest *)request dsID:(nullable NSNumber *)dsID NS_AVAILABLE_MAC(13); // Unverified urlResponse type / request type / dsID type +- (void)recommendedAppleIDForAccountSignIn:(nonnull void (^)(NSString * _Nullable))appleID NS_DEPRECATED_MAC(10_9, 12); // Unverified +- (void)regexWithKey:(nullable NSString *)key dsID:(nullable NSNumber *)dsID matchesString:(nullable NSString *)string replyBlock:(nonnull void (^)(BOOL))block NS_AVAILABLE_MAC(13); // Unverified key type / dsID type / string type / block parameter types +- (void)regexWithKey:(nullable NSString *)key matchesString:(nullable NSString *)string replyBlock:(nonnull void (^)(BOOL))block; // Unverified key type / string type / block parameter types +- (void)removeAccountStoreObserver:(nullable id)observer; // Unverified observer type +- (void)removeURLBagObserver:(nullable id)observer; // Unverified observer type +- (void)retailStoreDemoModeReplyBlock:(nonnull void (^)(BOOL, NSString * _Nullable, NSString * _Nullable, BOOL))block; // Unverified block parameter types +- (void)setStoreFrontID:(nullable NSString *)storefrontID; // Unverified storefrontID type +- (void)setTouchIDState:(long long)touchIDState forDSID:(nullable NSNumber *)dsID replyBlock:(nonnull void (^)(BOOL, NSError * _Nullable))block; // Unverified dsID type / block parameter types +- (void)shouldSendGUIDWithRequestForURL:(nullable NSURL *)url withReplyBlock:(nonnull void (^)(BOOL))block; // Unverified url type / block parameter types +- (void)signInWithContext:(nullable ISAuthenticationContext *)context replyBlock:(nonnull void (^)(BOOL, ISStoreAccount * _Nullable, NSError * _Nullable))block NS_DEPRECATED_MAC(10_9, 10_12); // Unverified - (void)signOut; -- (void)storeFrontWithReplyBlock:(void (^)(NSString *))block; -- (void)updateTouchIDSettingsForDSID:(NSNumber *)dsID replyBlock:(void (^)(BOOL, NSError *))block; -- (void)urlIsTrustedByURLBag:(NSURL *)urlBag dsID:(NSNumber *)dsID withReplyBlock:(void (^)(BOOL))block NS_AVAILABLE_MAC(13); -- (void)urlIsTrustedByURLBag:(NSURL *)urlBag withReplyBlock:(void (^)(BOOL))block; -- (void)valueForURLBagKey:(NSString *)bagKey dsID:(NSNumber *)dsID withReplyBlock:(void (^)(NSURL *))block NS_AVAILABLE_MAC(13); -- (void)valueForURLBagKey:(NSString *)bagKey withReplyBlock:(void (^)(NSURL *))block; +- (void)storeFrontWithReplyBlock:(nonnull void (^)(NSString * _Nonnull))block; // Unverified block parameter types +- (void)updateTouchIDSettingsForDSID:(nullable NSNumber *)dsID replyBlock:(nonnull void (^)(BOOL, NSError * _Nullable))block; // Unverified dsID type / block parameter types +- (void)urlIsTrustedByURLBag:(nullable NSURL *)urlBag dsID:(nullable NSNumber *)dsID withReplyBlock:(nonnull void (^)(BOOL))block NS_AVAILABLE_MAC(13); // Unverified urlBag type / dsID type / block parameter types +- (void)urlIsTrustedByURLBag:(nullable NSURL *)urlBag withReplyBlock:(nonnull void (^)(BOOL))block; // Unverified urlBag type / block parameter types +- (void)valueForURLBagKey:(nullable NSString *)bagKey dsID:(nullable NSNumber *)dsID withReplyBlock:(nonnull void (^)(NSURL * _Nullable))block NS_AVAILABLE_MAC(13); // Unverified bagKey type / dsID type / block parameter types +- (void)valueForURLBagKey:(nullable NSString *)bagKey withReplyBlock:(nonnull void (^)(NSURL * _Nullable))block; // Unverified bagKey type / block parameter types @optional @end - -NS_ASSUME_NONNULL_END diff --git a/Sources/PrivateFrameworks/StoreFoundation/ISServiceProxy.h b/Sources/PrivateFrameworks/StoreFoundation/ISServiceProxy.h index b005816e6..3d0aca67b 100644 --- a/Sources/PrivateFrameworks/StoreFoundation/ISServiceProxy.h +++ b/Sources/PrivateFrameworks/StoreFoundation/ISServiceProxy.h @@ -5,42 +5,38 @@ // - LC_SOURCE_VERSION: 715.5.1.0.0 // -NS_ASSUME_NONNULL_BEGIN - @interface ISServiceProxy : NSObject -+ (instancetype)genericSharedProxy; ++ (nonnull instancetype)genericSharedProxy; + (void)initialize; -@property(readonly, nonatomic) id accountService; -@property(readonly, nonatomic) id assetService; -@property(readonly, nonatomic) id downloadService; -@property(readonly, nonatomic, weak) id exportedObject; -@property(readonly, nonatomic) Protocol *exportedProtocol; -@property(readonly, nonatomic) id inAppService NS_DEPRECATED_MAC(10_9, 12); -@property(retain, nonatomic) ISStoreClient *storeClient; -@property(readonly, nonatomic) id transactionService; -@property(readonly, nonatomic) id uiService; +@property(readonly, nonatomic, nonnull) id accountService; +@property(readonly, nonatomic, nonnull) id assetService; +@property(readonly, nonatomic, nonnull) id downloadService; +@property(readonly, nonatomic, weak, nullable) id exportedObject; +@property(readonly, nonatomic, nullable) Protocol *exportedProtocol; +@property(readonly, nonatomic, nonnull) id inAppService NS_DEPRECATED_MAC(10_9, 12); +@property(retain, nonatomic, nullable) ISStoreClient *storeClient; +@property(readonly, nonatomic, nonnull) id transactionService; +@property(readonly, nonatomic, nonnull) id uiService; -- (void)accountServiceSynchronousBlock:(UnknownBlock *)block; -- (id)accountServiceWithErrorHandler:(UnknownBlock *)handler; -- (void)assetServiceSynchronousBlock:(UnknownBlock *)block; -- (id)assetServiceWithErrorHandler:(UnknownBlock *)handler; +- (void)accountServiceSynchronousBlock:(nonnull UnknownBlock)block; +- (nonnull id)accountServiceWithErrorHandler:(nullable UnknownBlock)handler; +- (void)assetServiceSynchronousBlock:(nonnull UnknownBlock)block; +- (nonnull id)assetServiceWithErrorHandler:(nullable UnknownBlock)handler; - (void)connectionWasInterrupted; -- (id)connectionWithServiceName:(NSString *)serviceName protocol:(id)protocol isMachService:(BOOL)isMachService; -- (void)downloadServiceSynchronousBlock:(UnknownBlock *)block; -- (id)downloadServiceWithErrorHandler:(UnknownBlock *)handler; -- (void)inAppServiceSynchronousBlock:(UnknownBlock *)block NS_DEPRECATED_MAC(10_9, 12); -- (id)inAppServiceWithErrorHandler:(UnknownBlock *)handler NS_DEPRECATED_MAC(10_9, 12); -- (instancetype)initWithStoreClient:(ISStoreClient *)client; -- (id)objectProxyForServiceName:(NSString *)serviceName protocol:(id)protocol interfaceClassName:(NSString *)interfaceClassName isMachService:(BOOL)isMachService errorHandler:(UnknownBlock *)handler; -- (void)performSynchronousBlock:(UnknownBlock *)block withServiceName:(NSString *)serviceName protocol:(id)protocol isMachService:(BOOL)isMachService interfaceClassName:(NSString *)interfaceClassName; +- (nonnull NSXPCConnection *)connectionWithServiceName:(nonnull NSString *)serviceName protocol:(nonnull Protocol *)protocol isMachService:(BOOL)isMachService; +- (void)downloadServiceSynchronousBlock:(nonnull UnknownBlock)block; +- (nonnull id)downloadServiceWithErrorHandler:(nullable UnknownBlock)handler; +- (void)inAppServiceSynchronousBlock:(nonnull UnknownBlock)block NS_DEPRECATED_MAC(10_9, 12); +- (nonnull id)inAppServiceWithErrorHandler:(nullable UnknownBlock)handler NS_DEPRECATED_MAC(10_9, 12); +- (nonnull instancetype)initWithStoreClient:(nullable ISStoreClient *)client; // Unverified client type +- (nonnull id)objectProxyForServiceName:(nonnull NSString *)serviceName protocol:(nonnull id)protocol interfaceClassName:(nullable NSString *)interfaceClassName isMachService:(BOOL)isMachService errorHandler:(nullable UnknownBlock)handler; +- (void)performSynchronousBlock:(nonnull UnknownBlock)block withServiceName:(nonnull NSString *)serviceName protocol:(nonnull Protocol *)protocol isMachService:(BOOL)isMachService interfaceClassName:(nullable NSString *)interfaceClassName; - (void)registerForInterrptionNotification; -- (void)transactionServiceSynchronousBlock:(UnknownBlock *)block; -- (id)transactionServiceWithErrorHandler:(UnknownBlock *)handler; -- (void)uiServiceSynchronousBlock:(UnknownBlock *)block; -- (id)uiServiceWithErrorHandler:(UnknownBlock *)handler; +- (void)transactionServiceSynchronousBlock:(nonnull UnknownBlock)block; +- (nonnull id)transactionServiceWithErrorHandler:(nullable UnknownBlock)handler; +- (void)uiServiceSynchronousBlock:(nonnull UnknownBlock)block; +- (nonnull id)uiServiceWithErrorHandler:(nullable UnknownBlock)handler; @end - -NS_ASSUME_NONNULL_END diff --git a/Sources/PrivateFrameworks/StoreFoundation/ISStoreAccount.h b/Sources/PrivateFrameworks/StoreFoundation/ISStoreAccount.h index 941fdffd8..fbc0c55bc 100644 --- a/Sources/PrivateFrameworks/StoreFoundation/ISStoreAccount.h +++ b/Sources/PrivateFrameworks/StoreFoundation/ISStoreAccount.h @@ -5,43 +5,39 @@ // - LC_SOURCE_VERSION: 715.5.1.0.0 // -NS_ASSUME_NONNULL_BEGIN - @interface ISStoreAccount : NSObject { NSTimer *_tokenInvalidTimer; } -+ (NSNumber *)dsidFromPlistValue:(id)value; -+ (NSDictionary *)migratePersistedStoreDictionary:(NSDictionary *)dictionary; ++ (nullable NSNumber *)dsidFromPlistValue:(nullable id)value; ++ (nonnull NSDictionary *)migratePersistedStoreDictionary:(nullable NSDictionary *)dictionary; + (BOOL)supportsSecureCoding; @property long long URLBagType; @property(readonly, getter=isAuthenticated) BOOL authenticated; -@property(copy) NSString *creditString; -@property(copy) NSNumber *dsID; -@property(copy) NSString *identifier; +@property(copy, nullable) NSString *creditString; +@property(copy, nullable) NSNumber *dsID; +@property(copy, nullable) NSString *identifier; @property BOOL isManagedStudent; @property BOOL isSignedIn; @property long long kind; -@property(copy) NSString *password; +@property(copy, nullable) NSString *password; @property(readonly, getter=isPrimary) BOOL primary; -@property(retain) NSString *storeFront; -@property(copy) NSString *token; -@property(retain) NSTimer *tokenExpirationTimer; -@property(retain) NSDate *tokenIssuedDate; +@property(retain, nullable) NSString *storeFront; +@property(copy, nullable) NSString *token; +@property(retain, nullable) NSTimer *tokenExpirationTimer; +@property(retain, nullable) NSDate *tokenIssuedDate; @property long long touchIDState; -- (NSString *)description; -- (void)encodeWithCoder:(NSCoder *)coder; +- (nonnull NSString *)description; +- (void)encodeWithCoder:(nullable NSCoder *)coder; - (long long)getTouchIDState; - (BOOL)hasValidStrongToken; -- (instancetype)initWithCoder:(NSCoder *)coder; -- (instancetype)initWithPersistedStoreDictionary:(NSDictionary *)dictionary; -- (void)mergeValuesFromAuthenticationResponse:(ISAuthenticationResponse *)response; -- (NSDictionary *)persistedStoreDictionary; +- (nonnull instancetype)initWithCoder:(nullable NSCoder *)coder; +- (nonnull instancetype)initWithPersistedStoreDictionary:(nullable NSDictionary *)dictionary; +- (void)mergeValuesFromAuthenticationResponse:(nullable ISAuthenticationResponse *)response; +- (nonnull NSDictionary *)persistedStoreDictionary; - (void)resetTouchIDState; - (double)strongTokenValidForSecond; @end - -NS_ASSUME_NONNULL_END diff --git a/Sources/PrivateFrameworks/StoreFoundation/SSDownload.h b/Sources/PrivateFrameworks/StoreFoundation/SSDownload.h index 9e66699ae..c46ee148f 100644 --- a/Sources/PrivateFrameworks/StoreFoundation/SSDownload.h +++ b/Sources/PrivateFrameworks/StoreFoundation/SSDownload.h @@ -5,46 +5,42 @@ // - LC_SOURCE_VERSION: 715.5.1.0.0 // -NS_ASSUME_NONNULL_BEGIN - @interface SSDownload : NSObject { BOOL _needsPreInstallValidation; } + (BOOL)supportsSecureCoding; -@property(copy) NSNumber *accountDSID; -@property(copy, nonatomic) NSArray *assets; -@property(copy) NSString *cancelURLString; -@property(copy) NSString *customDownloadPath; +@property(copy, nullable) NSNumber *accountDSID; +@property(copy, nonatomic, nullable) NSArray *assets; // Unverified generic type +@property(copy, nullable) NSString *cancelURLString; +@property(copy, nullable) NSString *customDownloadPath; @property BOOL didAutoUpdate; @property unsigned long long downloadType; @property BOOL installAfterLogout; -@property(copy) NSString *installPath; +@property(copy, nullable) NSString *installPath; @property BOOL isInServerQueue; -@property(copy, nonatomic) SSDownloadMetadata *metadata; +@property(copy, nonatomic, nullable) SSDownloadMetadata *metadata; @property BOOL needsDisplayInDock; -@property(copy) NSURL *relaunchAppWithBundleURL; +@property(copy, nullable) NSURL *relaunchAppWithBundleURL; @property BOOL skipAssetDownloadIfNotAlreadyOnDisk; @property BOOL skipInstallPhase; -@property(retain, nonatomic) SSDownloadStatus *status; +@property(retain, nonatomic, nullable) SSDownloadStatus *status; - (void)cancel; - (void)cancelWithPrompt:(BOOL)prompt; -- (void)cancelWithPrompt:(BOOL)prompt storeClient:(ISStoreClient *)client; -- (void)cancelWithStoreClient:(ISStoreClient *)client; -- (void)encodeWithCoder:(NSCoder *)coder; -- (instancetype)init; -- (instancetype)initWithAssets:(NSArray *)assets metadata:(SSDownloadMetadata *)metadata; -- (instancetype)initWithCoder:(NSCoder *)coder; +- (void)cancelWithPrompt:(BOOL)prompt storeClient:(nullable ISStoreClient *)client; +- (void)cancelWithStoreClient:(nullable ISStoreClient *)client; +- (void)encodeWithCoder:(nullable NSCoder *)coder; +- (nonnull instancetype)init; +- (nonnull instancetype)initWithAssets:(nullable NSArray *)assets metadata:(nullable SSDownloadMetadata *)metadata; // Unverified assets type / metadata type +- (nonnull instancetype)initWithCoder:(nullable NSCoder *)coder; - (BOOL)isEqual:(nullable id)object; - (void)pause; -- (void)pauseWithStoreClient:(ISStoreClient *)client; -- (ISAsset *)primaryAsset; +- (void)pauseWithStoreClient:(nullable ISStoreClient *)client; +- (nullable SSDownloadAsset *)primaryAsset; - (void)resume; -- (void)resumeWithStoreClient:(ISStoreClient *)client; +- (void)resumeWithStoreClient:(nullable ISStoreClient *)client; - (void)setUseUniqueDownloadFolder:(BOOL)useUniqueDownloadFolder; @end - -NS_ASSUME_NONNULL_END diff --git a/Sources/PrivateFrameworks/StoreFoundation/SSDownloadMetadata.h b/Sources/PrivateFrameworks/StoreFoundation/SSDownloadMetadata.h index 380570857..62ed11a61 100644 --- a/Sources/PrivateFrameworks/StoreFoundation/SSDownloadMetadata.h +++ b/Sources/PrivateFrameworks/StoreFoundation/SSDownloadMetadata.h @@ -5,26 +5,24 @@ // - LC_SOURCE_VERSION: 715.5.1.0.0 // -NS_ASSUME_NONNULL_BEGIN - @interface SSDownloadMetadata : NSObject { NSLock *_lock; } + (BOOL)supportsSecureCoding; -@property(readonly, nullable) NSNumber *ageRestriction; +@property(readonly, nonnull) NSNumber *ageRestriction; @property BOOL animationExpected; @property(retain, nullable) NSString *appleID; -@property(readonly, nullable) NSString *applicationIdentifier; +@property(readonly, nonnull) NSString *applicationIdentifier; @property BOOL artworkIsPrerendered; -@property(readonly, nullable) NSArray *assets; +@property(readonly, nonnull) NSArray *assets; // Unverified generic type @property(readonly, nullable) NSString *bundleDisplayName; @property(retain, nullable) NSString *bundleIdentifier; @property(readonly, nullable) NSString *bundleShortVersionString; @property(retain, nullable) NSString *bundleVersion; @property(retain, nullable) NSString *buyParameters; -@property(readonly) NSNumber *collectionID NS_AVAILABLE_MAC(13); +@property(readonly, nullable) NSNumber *collectionID NS_AVAILABLE_MAC(13); @property(retain, nullable) NSString *collectionName; @property(retain, nullable) NSDictionary *dictionary; @property(retain, nullable) NSString *downloadKey; @@ -42,36 +40,34 @@ NS_ASSUME_NONNULL_BEGIN @property BOOL isMDMProvided; @property unsigned long long itemIdentifier; @property(retain, nullable) NSString *kind; -@property(retain) NSString *managedAppUUIDString NS_AVAILABLE_MAC(13); +@property(retain, nullable) NSString *managedAppUUIDString NS_AVAILABLE_MAC(13); @property(readonly) BOOL needsSoftwareInstallOperation; @property(retain, nullable) NSURL *preflightPackageURL; @property(retain, nullable) NSString *productType; @property(readonly, nullable) NSString *purchaseDate; @property(getter=isRental) BOOL rental; @property(readonly, getter=isSample) BOOL sample; -@property(retain, nullable) NSArray *sinfs; +@property(retain, nullable) NSArray *> *sinfs; @property(readonly, nullable) NSString *sortArtist NS_AVAILABLE_MAC(13); @property(readonly, nullable) NSString *sortName NS_AVAILABLE_MAC(13); @property(retain, nullable) NSString *subtitle; @property(retain, nullable) NSURL *thumbnailImageURL; -@property(retain) NSString *title; +@property(retain, nullable) NSString *title; @property(retain, nullable) NSString *transactionIdentifier; @property(readonly, nullable) NSNumber *uncompressedSize; -@property(retain) NSNumber *version NS_AVAILABLE_MAC(13); +@property(retain, nullable) NSNumber *version NS_AVAILABLE_MAC(13); -- (nullable id)_valueForFirstAvailableKey:(NSString *)key; -- (instancetype)copyWithZone:(nullable struct _NSZone *)zone; -- (nullable id)deltaPackages; -- (void)encodeWithCoder:(NSCoder *)coder; -- (instancetype)init; -- (instancetype)initWithCoder:(NSCoder *)coder; -- (nullable instancetype)initWithDictionary:(NSDictionary *)dictionary; -- (nullable instancetype)initWithKind:(NSString *)kind; +- (nullable id)_valueForFirstAvailableKey:(nullable id)key; +- (nonnull instancetype)copyWithZone:(nullable struct _NSZone *)zone; +- (nullable NSDictionary *)deltaPackages; // Unverified return type +- (void)encodeWithCoder:(nullable NSCoder *)coder; +- (nonnull instancetype)init; +- (nonnull instancetype)initWithCoder:(nullable NSCoder *)coder; +- (nonnull instancetype)initWithDictionary:(nullable NSDictionary *)dictionary; +- (nonnull instancetype)initWithKind:(nullable NSString *)kind; - (nullable id)localServerInfo; - (void)setExtractionCanBeStreamed:(BOOL)extractionCanBeStreamed NS_DEPRECATED_MAC(10_9, 12); -- (void)setUncompressedSize:(NSNumber *)uncompressedSize NS_DEPRECATED_MAC(10_9, 12); -- (void)setValue:(nullable id)value forMetadataKey:(NSString *)key; +- (void)setUncompressedSize:(nullable NSNumber *)uncompressedSize NS_DEPRECATED_MAC(10_9, 12); +- (void)setValue:(nullable id)value forMetadataKey:(nonnull NSString *)key; // Unverified key type @end - -NS_ASSUME_NONNULL_END diff --git a/Sources/PrivateFrameworks/StoreFoundation/SSDownloadPhase.h b/Sources/PrivateFrameworks/StoreFoundation/SSDownloadPhase.h index 1a6629ceb..fcfa3fe8d 100644 --- a/Sources/PrivateFrameworks/StoreFoundation/SSDownloadPhase.h +++ b/Sources/PrivateFrameworks/StoreFoundation/SSDownloadPhase.h @@ -5,26 +5,22 @@ // - LC_SOURCE_VERSION: 715.5.1.0.0 // -NS_ASSUME_NONNULL_BEGIN - @interface SSDownloadPhase : NSObject + (BOOL)supportsSecureCoding; @property(readonly) double estimatedSecondsRemaining; -@property(readonly) SSOperationProgress *operationProgress; +@property(readonly, nullable) SSOperationProgress *operationProgress; @property(readonly) long long phaseType; @property(readonly) float progressChangeRate; @property(readonly) long long progressUnits; @property(readonly) long long progressValue; @property(readonly) long long totalProgressValue; -- (instancetype)copyWithZone:(nullable struct _NSZone *)zone; -- (void)encodeWithCoder:(NSCoder *)coder; -- (instancetype)init; -- (instancetype)initWithCoder:(NSCoder *)coder; -- (instancetype)initWithOperationProgress:(SSOperationProgress *)progress; +- (nonnull instancetype)copyWithZone:(nullable struct _NSZone *)zone; +- (void)encodeWithCoder:(nullable NSCoder *)coder; +- (nonnull instancetype)init; +- (nonnull instancetype)initWithCoder:(nullable NSCoder *)coder; // Unverified coder type +- (nonnull instancetype)initWithOperationProgress:(nullable SSOperationProgress *)progress; // Unverified progress type @end - -NS_ASSUME_NONNULL_END diff --git a/Sources/PrivateFrameworks/StoreFoundation/SSDownloadStatus.h b/Sources/PrivateFrameworks/StoreFoundation/SSDownloadStatus.h index 9e065c6d2..b927f282c 100644 --- a/Sources/PrivateFrameworks/StoreFoundation/SSDownloadStatus.h +++ b/Sources/PrivateFrameworks/StoreFoundation/SSDownloadStatus.h @@ -5,15 +5,13 @@ // - LC_SOURCE_VERSION: 715.5.1.0.0 // -NS_ASSUME_NONNULL_BEGIN - @interface SSDownloadStatus : NSObject + (BOOL)supportsSecureCoding; -@property(readonly, nonatomic) SSDownloadPhase *activePhase; +@property(readonly, nonatomic, nullable) SSDownloadPhase *activePhase; @property(nonatomic, getter=isCancelled) BOOL cancelled; -@property(retain, nonatomic) NSError *error; +@property(retain, nonatomic, nullable) NSError *error; @property(nonatomic, getter=isFailed) BOOL failed; @property(readonly, nonatomic, getter=isPausable) BOOL pausable; @property(nonatomic, getter=isPaused) BOOL paused; @@ -22,11 +20,9 @@ NS_ASSUME_NONNULL_BEGIN @property(readonly, nonatomic) long long phaseTimeRemaining; @property BOOL waiting; -- (instancetype)copyWithZone:(nullable struct _NSZone *)zone; -- (void)encodeWithCoder:(NSCoder *)coder; -- (instancetype)initWithCoder:(NSCoder *)coder; -- (void)setOperationProgress:(SSOperationProgress *)progress; +- (nonnull instancetype)copyWithZone:(nullable struct _NSZone *)zone; +- (void)encodeWithCoder:(nullable NSCoder *)coder; +- (nonnull instancetype)initWithCoder:(nullable NSCoder *)coder; +- (void)setOperationProgress:(nullable SSOperationProgress *)progress; // Unverified progress type @end - -NS_ASSUME_NONNULL_END diff --git a/Sources/PrivateFrameworks/StoreFoundation/SSPurchase.h b/Sources/PrivateFrameworks/StoreFoundation/SSPurchase.h index 0dd806af5..9eab3d67a 100644 --- a/Sources/PrivateFrameworks/StoreFoundation/SSPurchase.h +++ b/Sources/PrivateFrameworks/StoreFoundation/SSPurchase.h @@ -5,21 +5,19 @@ // - LC_SOURCE_VERSION: 715.5.1.0.0 // -NS_ASSUME_NONNULL_BEGIN - @interface SSPurchase : NSObject -+ (instancetype)purchaseWithBuyParameters:(NSString *)buyParameters; -+ (NSDictionary *)purchasesGroupedByAccountIdentifierWithPurchases:(NSArray *)purchases; ++ (nonnull instancetype)purchaseWithBuyParameters:(nullable NSString *)buyParameters; // Unverified buyParameters type ++ (nonnull NSArray *> *)purchasesGroupedByAccountIdentifierWithPurchases:(nullable NSArray *)purchases; + (BOOL)supportsSecureCoding; -@property(retain, nonatomic) NSNumber *accountIdentifier; -@property(retain, nonatomic) NSString *appleID; -@property(copy) UnknownBlock *authFallbackHandler; -@property(copy, nonatomic) NSString *buyParameters; +@property(retain, nonatomic, nullable) NSNumber *accountIdentifier; +@property(retain, nonatomic, nullable) NSString *appleID; +@property(copy, nullable) UnknownBlock authFallbackHandler; // Unverified value type +@property(copy, nonatomic, nullable) NSString *buyParameters; @property BOOL checkPreflightAterPurchase; -@property(copy, nonatomic) SSDownloadMetadata *downloadMetadata; -@property(retain) NSDictionary *dsidLessOptions; +@property(copy, nonatomic, nullable) SSDownloadMetadata *downloadMetadata; +@property(retain, nullable) NSDictionary *dsidLessOptions; @property BOOL isCancelled; @property BOOL isDSIDLessPurchase; @property BOOL isRecoveryPurchase; @@ -27,25 +25,23 @@ NS_ASSUME_NONNULL_BEGIN @property BOOL isUpdate; @property BOOL isVPP; @property unsigned long long itemIdentifier; -@property(retain, nonatomic) NSString *managedAppUUIDString NS_AVAILABLE_MAC(13); +@property(retain, nonatomic, nullable) NSString *managedAppUUIDString NS_AVAILABLE_MAC(13); @property(readonly) BOOL needsAuthentication; -@property(retain, nonatomic) NSString *parentalControls; -@property(weak) ISOperation *purchaseOperation; +@property(retain, nonatomic, nullable) NSString *parentalControls; +@property(weak, nullable) ISOperation *purchaseOperation; @property(nonatomic) long long purchaseType; -@property(retain, nonatomic) NSData *receiptData; -@property(copy) NSDictionary *responseDialog; +@property(retain, nonatomic, nullable) NSData *receiptData; +@property(copy, nullable) NSDictionary *responseDialog; @property BOOL shouldBeInstalledAfterLogout; -@property(readonly, nonatomic) NSString *sortableAccountIdentifier; -@property(readonly, nonatomic) NSString *uniqueIdentifier; +@property(readonly, nonatomic, nullable) NSString *sortableAccountIdentifier; +@property(readonly, nonatomic, nonnull) NSString *uniqueIdentifier; -- (NSString *)_sortableAccountIdentifier; -- (instancetype)copyWithZone:(nullable struct _NSZone *)zone; -- (NSString *)description; -- (void)encodeWithCoder:(NSCoder *)coder; -- (instancetype)initWithCoder:(NSCoder *)coder; -- (NSNumber *)productID; +- (nullable NSString *)_sortableAccountIdentifier; +- (nonnull instancetype)copyWithZone:(nullable struct _NSZone *)zone; +- (nonnull NSString *)description; +- (void)encodeWithCoder:(nullable NSCoder *)coder; +- (nonnull instancetype)initWithCoder:(nullable NSCoder *)coder; +- (nonnull NSNumber *)productID; - (BOOL)purchaseDSIDMatchesPrimaryAccount; @end - -NS_ASSUME_NONNULL_END diff --git a/Sources/PrivateFrameworks/StoreFoundation/SSPurchaseResponse.h b/Sources/PrivateFrameworks/StoreFoundation/SSPurchaseResponse.h index adfa5abf1..1d3b1d65a 100644 --- a/Sources/PrivateFrameworks/StoreFoundation/SSPurchaseResponse.h +++ b/Sources/PrivateFrameworks/StoreFoundation/SSPurchaseResponse.h @@ -5,22 +5,18 @@ // - LC_SOURCE_VERSION: 715.5.1.0.0 // -NS_ASSUME_NONNULL_BEGIN - @interface SSPurchaseResponse : NSObject { NSDictionary *_rawResponse; } + (BOOL)supportsSecureCoding; -@property(retain) NSArray *downloads; -@property(retain) NSDictionary *metrics; +@property(retain, nullable) NSArray *downloads; +@property(retain, nullable) NSDictionary *metrics; -- (NSArray *)_newDownloadsFromItems:(NSArray *)items withDSID:(NSNumber *)dsID; -- (void)encodeWithCoder:(NSCoder *)coder; -- (instancetype)initWithCoder:(NSCoder *)coder; -- (instancetype)initWithDictionary:(NSDictionary *)dictionary userIdentifier:(NSString *)userIdentifier; +- (nonnull NSMutableArray *)_newDownloadsFromItems:(nullable NSArray *)items withDSID:(nullable NSNumber *)dsID; // Unverified items element generic types / dsID type +- (void)encodeWithCoder:(nullable NSCoder *)coder; +- (nonnull instancetype)initWithCoder:(nullable NSCoder *)coder; +- (nonnull instancetype)initWithDictionary:(nullable NSDictionary *)dictionary userIdentifier:(nullable NSString *)userIdentifier; // Unverified dictionary generic types / userIdentifier type @end - -NS_ASSUME_NONNULL_END diff --git a/Sources/PrivateFrameworks/StoreFoundation/StoreFoundation.h b/Sources/PrivateFrameworks/StoreFoundation/StoreFoundation.h index fbd3b52c9..392ae56b7 100644 --- a/Sources/PrivateFrameworks/StoreFoundation/StoreFoundation.h +++ b/Sources/PrivateFrameworks/StoreFoundation/StoreFoundation.h @@ -7,10 +7,12 @@ @import Foundation; -@class ISAsset, ISAuthenticationContext, ISAuthenticationResponse, ISOperation, ISStoreClient, SSOperationProgress, UnknownBlock; +@class ISAuthenticationContext, ISAuthenticationResponse, ISOperation, ISStoreClient, SSDownloadAsset, SSOperationProgress; @protocol ISAccountStoreObserver, ISAssetService, ISDownloadService, ISInAppService, ISServiceRemoteObject, ISTransactionService, ISUIService, ISURLBagObserver; +typedef void (^UnknownBlock)(); + #import #import #import diff --git a/Sources/mas/AppStore/AppleAccount.swift b/Sources/mas/AppStore/AppleAccount.swift index bfda91f56..5be997dc0 100644 --- a/Sources/mas/AppStore/AppleAccount.swift +++ b/Sources/mas/AppStore/AppleAccount.swift @@ -9,8 +9,8 @@ internal import Foundation private import StoreFoundation struct AppleAccount: Sendable { - let emailAddress: String - let dsID: NSNumber // swiftlint:disable:this legacy_objc_type + let emailAddress: String? + let dsID: NSNumber? // swiftlint:disable:this legacy_objc_type } @MainActor @@ -23,7 +23,7 @@ var appleAccount: AppleAccount { } return await withCheckedContinuation { continuation in ISServiceProxy.genericShared().accountService.primaryAccount { account in - continuation.resume(returning: AppleAccount(emailAddress: account.identifier, dsID: account.dsID)) + continuation.resume(returning: AppleAccount(emailAddress: account?.identifier, dsID: account?.dsID)) } } } diff --git a/Sources/mas/AppStore/Downloader.swift b/Sources/mas/AppStore/Downloader.swift index 600a29a55..832532852 100644 --- a/Sources/mas/AppStore/Downloader.swift +++ b/Sources/mas/AppStore/Downloader.swift @@ -21,7 +21,7 @@ struct Downloader { CKPurchaseController.shared().perform(purchase, withOptions: 0) { _, _, error, response in if let error { continuation.resume(throwing: error) - } else if response?.downloads.isEmpty == false { + } else if response?.downloads?.isEmpty == false { Task { do { try await PurchaseDownloadObserver(appID: appID, printer: printer).observeDownloadQueue() diff --git a/Sources/mas/AppStore/PurchaseDownloadObserver.swift b/Sources/mas/AppStore/PurchaseDownloadObserver.swift index dc2da74c8..ab74b9809 100644 --- a/Sources/mas/AppStore/PurchaseDownloadObserver.swift +++ b/Sources/mas/AppStore/PurchaseDownloadObserver.swift @@ -30,15 +30,18 @@ class PurchaseDownloadObserver: CKDownloadQueueObserver { } func downloadQueue(_ queue: CKDownloadQueue, statusChangedFor download: SSDownload) { - guard download.metadata.itemIdentifier == appID else { + guard + let metadata = download.metadata, + metadata.itemIdentifier == appID, + let status = download.status + else { return } - let status = download.status if status.isFailed || status.isCancelled { - queue.removeDownload(withItemIdentifier: download.metadata.itemIdentifier) + queue.removeDownload(withItemIdentifier: metadata.itemIdentifier) } else { - prevPhaseType = printer.progress(of: download, prevPhaseType: prevPhaseType) + prevPhaseType = printer.progress(for: metadata.appNameAndVersion, status: status, prevPhaseType: prevPhaseType) } } @@ -47,18 +50,21 @@ class PurchaseDownloadObserver: CKDownloadQueueObserver { } func downloadQueue(_: CKDownloadQueue, changedWithRemoval download: SSDownload) { - guard download.metadata.itemIdentifier == appID else { + guard + let metadata = download.metadata, + metadata.itemIdentifier == appID, + let status = download.status + else { return } printer.terminateEphemeral() - let status = download.status if status.isFailed { - errorHandler?(status.error) + errorHandler?(status.error ?? MASError.runtimeError("Failed to download \(metadata.appNameAndVersion)")) } else if status.isCancelled { errorHandler?(MASError.cancelled) } else { - printer.notice("Installed", download.progressDescription) + printer.notice("Installed", metadata.appNameAndVersion) completionHandler?() } } @@ -74,27 +80,27 @@ private struct ProgressState { } } -private extension SSDownload { - var progressDescription: String { - "\(metadata.title) (\(metadata.bundleVersion ?? "unknown version"))" +private extension SSDownloadMetadata { + var appNameAndVersion: String { + "\(title ?? "unknown app") (\(bundleVersion ?? "unknown version"))" } } private extension Printer { - func progress(of download: SSDownload, prevPhaseType: Int64?) -> Int64 { - let currPhaseType = download.status.activePhase.phaseType + func progress(for appNameAndVersion: String, status: SSDownloadStatus, prevPhaseType: Int64?) -> Int64? { + let currPhaseType = status.activePhase?.phaseType if prevPhaseType != currPhaseType { switch currPhaseType { case downloadingPhaseType: if prevPhaseType == initialPhaseType { - progressHeader(for: download) + progressHeader(for: appNameAndVersion, status: status) } case downloadedPhaseType: if prevPhaseType == downloadingPhaseType { - progressHeader(for: download) + progressHeader(for: appNameAndVersion, status: status) } case installingPhaseType: - progressHeader(for: download) + progressHeader(for: appNameAndVersion, status: status) default: break } @@ -102,7 +108,7 @@ private extension Printer { if isatty(fileno(stdout)) != 0 { // Only output the progress bar if connected to a terminal - let progressState = download.status.progressState + let progressState = status.progressState let totalLength = 60 let completedLength = Int(progressState.percentComplete * Float(totalLength)) ephemeral( @@ -120,15 +126,19 @@ private extension Printer { return currPhaseType } - private func progressHeader(for download: SSDownload) { + private func progressHeader(for appNameAndVersion: String, status: SSDownloadStatus) { terminateEphemeral() - notice(download.status.activePhase.phaseDescription, download.progressDescription) + notice(status.activePhaseDescription, appNameAndVersion) } } private extension SSDownloadStatus { + var activePhaseDescription: String { + activePhase?.phaseDescription ?? "Processing" + } + var progressState: ProgressState { - ProgressState(percentComplete: percentComplete, phase: activePhase.phaseDescription) + ProgressState(percentComplete: percentComplete, phase: activePhaseDescription) } } @@ -151,7 +161,7 @@ extension PurchaseDownloadObserver { func observeDownloadQueue(_ queue: CKDownloadQueue = .shared()) async throws { let observerID = queue.add(self) defer { - queue.remove(observerID) + queue.removeObserver(observerID) } try await withCheckedThrowingContinuation { continuation in diff --git a/Sources/mas/AppStore/SSPurchase.swift b/Sources/mas/AppStore/SSPurchase.swift index d362a10d5..d5b175be4 100644 --- a/Sources/mas/AppStore/SSPurchase.swift +++ b/Sources/mas/AppStore/SSPurchase.swift @@ -9,33 +9,22 @@ private import StoreFoundation extension SSPurchase { convenience init(appID: AppID, purchasing: Bool) async { - self.init() + self.init( + buyParameters: """ + productType=C&price=0&salableAdamId=\(appID)&pg=default&appExtVrsId=0&pricingParameters=\ + \(purchasing ? "STDQ&macappinstalledconfirmed=1" : "STDRDL") + """ + ) - var parameters = - [ - "productType": "C", - "price": 0, - "salableAdamId": appID, - "pg": "default", - "appExtVrsId": 0, - ] as [String: Any] - - if purchasing { - parameters["macappinstalledconfirmed"] = 1 - parameters["pricingParameters"] = "STDQ" - // Possibly unnecessary… - isRedownload = false - } else { - parameters["pricingParameters"] = "STDRDL" - } - - buyParameters = parameters.map { "\($0)=\($1)" }.joined(separator: "&") + // Possibly unnecessary… + isRedownload = !purchasing itemIdentifier = appID - downloadMetadata = SSDownloadMetadata() + let downloadMetadata = SSDownloadMetadata() downloadMetadata.kind = "software" downloadMetadata.itemIdentifier = appID + self.downloadMetadata = downloadMetadata do { let appleAccount = try await appleAccount diff --git a/Sources/mas/Commands/Account.swift b/Sources/mas/Commands/Account.swift index 0157c055d..77532ab8c 100644 --- a/Sources/mas/Commands/Account.swift +++ b/Sources/mas/Commands/Account.swift @@ -20,7 +20,11 @@ extension MAS { } func run(printer: Printer) async throws { - printer.info(try await appleAccount.emailAddress) + guard let appleAccount = try await appleAccount.emailAddress else { + throw MASError.runtimeError("Not signed in to an Apple Account in the Mac App Store") + } + + printer.info(appleAccount) } } }