diff --git a/PKTListenResources.bundle/Assets.car b/PKTListenResources.bundle/Assets.car new file mode 100644 index 000000000..46477a500 Binary files /dev/null and b/PKTListenResources.bundle/Assets.car differ diff --git a/PKTListenResources.bundle/Info.plist b/PKTListenResources.bundle/Info.plist new file mode 100644 index 000000000..877890c0e Binary files /dev/null and b/PKTListenResources.bundle/Info.plist differ diff --git a/PKTListenResources.bundle/_CodeSignature/CodeDirectory b/PKTListenResources.bundle/_CodeSignature/CodeDirectory new file mode 100644 index 000000000..e7cf79f34 Binary files /dev/null and b/PKTListenResources.bundle/_CodeSignature/CodeDirectory differ diff --git a/PKTListenResources.bundle/_CodeSignature/CodeRequirements b/PKTListenResources.bundle/_CodeSignature/CodeRequirements new file mode 100644 index 000000000..8c6945110 Binary files /dev/null and b/PKTListenResources.bundle/_CodeSignature/CodeRequirements differ diff --git a/PKTListenResources.bundle/_CodeSignature/CodeRequirements-1 b/PKTListenResources.bundle/_CodeSignature/CodeRequirements-1 new file mode 100644 index 000000000..c72e90320 Binary files /dev/null and b/PKTListenResources.bundle/_CodeSignature/CodeRequirements-1 differ diff --git a/PKTListenResources.bundle/_CodeSignature/CodeResources b/PKTListenResources.bundle/_CodeSignature/CodeResources new file mode 100644 index 000000000..ee8998716 --- /dev/null +++ b/PKTListenResources.bundle/_CodeSignature/CodeResources @@ -0,0 +1,113 @@ + + + + + files + + Assets.car + + LlwMalR/AEkToD30JxkBpDr1HL0= + + + files2 + + Assets.car + + hash + + LlwMalR/AEkToD30JxkBpDr1HL0= + + hash2 + + o5qgiVDB/+KJTJ0tyJkEeFGE50tnB5zTNUJ6mzsO49Q= + + + + rules + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/PKTListenResources.bundle/_CodeSignature/CodeSignature b/PKTListenResources.bundle/_CodeSignature/CodeSignature new file mode 100644 index 000000000..afd5d7e72 Binary files /dev/null and b/PKTListenResources.bundle/_CodeSignature/CodeSignature differ diff --git a/Pocket.xcodeproj/project.pbxproj b/Pocket.xcodeproj/project.pbxproj index 5cb22470d..e070b2b2c 100644 --- a/Pocket.xcodeproj/project.pbxproj +++ b/Pocket.xcodeproj/project.pbxproj @@ -62,6 +62,7 @@ 658140EA29A5993C00346848 /* SnowplowMicro.swift in Sources */ = {isa = PBXBuildFile; fileRef = 658140E929A5993C00346848 /* SnowplowMicro.swift */; }; 658140EC29A59A0C00346848 /* HTTPDataDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 658140EB29A59A0C00346848 /* HTTPDataDownloader.swift */; }; 65BE918E29A5B9AF00B13BF1 /* AnyCodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65BE918D29A5B9AF00B13BF1 /* AnyCodable.swift */; }; + 65D3105229CEACF100952D64 /* PKTListenResources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 65D3105129CEACEE00952D64 /* PKTListenResources.bundle */; }; 65EC272728BA8AD50075E1DF /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65EC272628BA8AD50075E1DF /* UserNotifications.framework */; }; 65EC272928BA8AD50075E1DF /* UserNotificationsUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65EC272828BA8AD50075E1DF /* UserNotificationsUI.framework */; }; 65EC272C28BA8AD50075E1DF /* NotificationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EC272B28BA8AD50075E1DF /* NotificationViewController.swift */; }; @@ -226,6 +227,7 @@ 658140E929A5993C00346848 /* SnowplowMicro.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SnowplowMicro.swift; sourceTree = ""; }; 658140EB29A59A0C00346848 /* HTTPDataDownloader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPDataDownloader.swift; sourceTree = ""; }; 65BE918D29A5B9AF00B13BF1 /* AnyCodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnyCodable.swift; sourceTree = ""; }; + 65D3105129CEACEE00952D64 /* PKTListenResources.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = PKTListenResources.bundle; sourceTree = ""; }; 65EC272528BA8AD50075E1DF /* PushNotificationStoryExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = PushNotificationStoryExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 65EC272628BA8AD50075E1DF /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; }; 65EC272828BA8AD50075E1DF /* UserNotificationsUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotificationsUI.framework; path = System/Library/Frameworks/UserNotificationsUI.framework; sourceTree = SDKROOT; }; @@ -333,6 +335,7 @@ 166A81A32637406B0015AA1D = { isa = PBXGroup; children = ( + 65D3105129CEACEE00952D64 /* PKTListenResources.bundle */, 653DA73829C3BC1500123847 /* Pocket_iOS_Release.entitlements */, 653DA73729C3BC0A00123847 /* Pocket_iOS_Debug.entitlements */, 653DA73629C3BC0200123847 /* Pocket_iOS_Debug_AlphaNeue.entitlements */, @@ -705,6 +708,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 65D3105229CEACF100952D64 /* PKTListenResources.bundle in Resources */, 16E32B0226851AEB000CC36D /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Pocket.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Pocket.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 4398c5fb3..083da9459 100644 --- a/Pocket.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Pocket.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -158,8 +158,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio.git", "state" : { - "revision" : "45167b8006448c79dda4b7bd604e07a034c15c49", - "version" : "2.48.0" + "revision" : "9b2848d76f5caad08b97e71a04345aa5bdb23a06", + "version" : "2.49.0" } }, { diff --git a/PocketKit/Frameworks/PKTListen.xcframework/Info.plist b/PocketKit/Frameworks/PKTListen.xcframework/Info.plist new file mode 100644 index 000000000..540aef74c --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/Info.plist @@ -0,0 +1,44 @@ + + + + + AvailableLibraries + + + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libPKTListen.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libPKTListen.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/APIRequestGate.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/APIRequestGate.h new file mode 100644 index 000000000..9240702a2 --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/APIRequestGate.h @@ -0,0 +1,29 @@ +// +// APIRequestGate.h +// RIL +// +// Created by Steve Streza on 8/13/12. +// +// Used if you need an interstitial step before making API requests. + +#import + +@class PKTAPIRequest; + +NS_ASSUME_NONNULL_BEGIN + +@interface APIRequestGate : NSObject + +@property (atomic, strong, readonly) NSMutableArray *pendingRequests; + +- (void)addPendingRequest:(PKTAPIRequest *)request; +- (void)startPendingRequests; + +// implement these in subclasses +- (BOOL)canPerformRequest:(PKTAPIRequest *)request; +- (void)processGate; +- (BOOL)checkForRequest:(PKTAPIRequest *)request; + +@end + +NS_ASSUME_NONNULL_END diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/AVSpeechSynthesisVoice+Listen.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/AVSpeechSynthesisVoice+Listen.h new file mode 100644 index 000000000..b980c582c --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/AVSpeechSynthesisVoice+Listen.h @@ -0,0 +1,31 @@ +// +// AVSpeechSynthesisVoice+Listen.h +// Listen +// +// Created by David Skuza on 2/8/19. +// Copyright © 2019 PKT. All rights reserved. +// + +@import AVFoundation; + +NS_ASSUME_NONNULL_BEGIN + +/** + An AVSpeechSynthesisVoice caterogy that contains helper methods for tasks related to Listen settings. + */ +@interface AVSpeechSynthesisVoice (Listen) + +/** + @return An array of all available system voices sorted alphabetically (ascending). + */ ++ (NSArray *)sortedVoices; + +/** + The first voice matching the user's current system language after being sorted alphabetically (ascending). + @return An AVSpeechSynthesisVoice for the user's current language. + */ ++ (AVSpeechSynthesisVoice *)firstVoiceForCurrentLanguage; + +@end + +NS_ASSUME_NONNULL_END diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/Action+ScreenSize.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/Action+ScreenSize.h new file mode 100644 index 000000000..fbe259009 --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/Action+ScreenSize.h @@ -0,0 +1,25 @@ +// +// Action+ScreenSize.h +// PKTRuntime +// +// Created by David Skuza on 12/26/18. +// Copyright © 2018 Pocket. All rights reserved. +// + +#import "Action.h" + +UIKIT_EXTERN NSString *const PKTLastKnownScreenSizeActionKey; + +@interface Action (ScreenSize) + +/** + The action to send for the current screen size, or nil if no new action has to be sent. + + @return If the current screen size has not yet been sent, an action will be returned. + @return If the current screen size has already been sent, nil will be returned. + @return If the current screen size has been changed, but the session is the same, nil will be returned. + @return If the current screen size has been changed, and the session is different, an action will be returned. + */ ++ (instancetype)actionForCurrentScreenSize; + +@end diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/Action.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/Action.h new file mode 100644 index 000000000..f884d7503 --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/Action.h @@ -0,0 +1,52 @@ +// +// Action.h +// RIL +// +// Created by Nate Weiner on 10/18/11. +// Copyright (c) 2011 Pocket All rights reserved. +// + +@import Foundation; + +#import "PKTSharedEnums.h" + +@class PKTItem; + +NS_ASSUME_NONNULL_BEGIN + +@interface Action : NSObject + +@property (nonatomic, strong) NSDictionary *dictionary; +@property (nonatomic, assign, getter = actionId) ActionId actionId; + ++ (instancetype)fromDictionary:(NSDictionary *)dictionary; ++ (instancetype)action:(NSString *)action; ++ (instancetype)action:(NSString *)action data:(NSDictionary * _Nullable)data; ++ (instancetype)action:(NSString *)action data:(NSDictionary * _Nullable)data context:(NSDictionary * _Nullable)context; ++ (instancetype)action:(NSString *)action uniqueId:(NSNumber *)uniqueId + itemId:(NSNumber * _Nullable)itemId; + ++ (instancetype)action:(NSString *)action + uniqueId:(NSNumber *)uniqueId + itemId:(NSNumber * _Nullable)itemId + data:(NSDictionary * _Nullable)data + context:(NSDictionary * _Nullable)context; + +- (instancetype)initWithAction:(NSString *)action + uniqueId:(NSNumber *)uniqueId + itemId:(NSNumber *_Nullable)itemId + data:(NSDictionary * _Nullable)data + context:(NSDictionary * _Nullable)context; + +- (id)attr:(NSString *)key; +- (void)setObject:(id)object forKey:(id)aKey; + +- (NSDictionary *)JSONString; + +- (void)commitAction; +- (void)commitDelayedAction; + +@end + +NS_ASSUME_NONNULL_END + diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/ActionStore.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/ActionStore.h new file mode 100644 index 000000000..0b381a900 --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/ActionStore.h @@ -0,0 +1,35 @@ +// +// ActionStore.h +// PKTRuntime +// +// Created by David Skuza on 12/26/18. +// Copyright © 2018 Pocket. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class Action; + +@protocol ActionStore + +/** + Stores an action for a given key. + + @param action The action to store. + @param key The key to map the action to. + */ +- (void)setAction:(Action *)action forKey:(NSString *)key; + +/** + Returns a stored action for a given key. + + @param key The key to which an action is mapped. + @return The stored action, or nil if one does not exist for a given key. + */ +- (Action *_Nullable)actionForKey:(NSString *)key; + +@end + +NS_ASSUME_NONNULL_END diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/AppAsset.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/AppAsset.h new file mode 100644 index 000000000..80819c169 --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/AppAsset.h @@ -0,0 +1,23 @@ +// +// AppAsset.h +// RIL +// +// Created by Nate Weiner on 10/14/11. +// Copyright (c) 2011 Pocket All rights reserved. +// + +#import "Asset.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface AppAsset : Asset + ++ (instancetype)assetForLiteral:(NSString *)literal; ++ (NSURL *)preloadedURLForLiteral:(NSString *)literal; ++ (NSURL *)preloadedBaseURL; ++ (NSString *)localPathForLiteral:(NSString *)literal; ++ (NSString *)localPathHeadForLiteral:(NSString *)literal; + +@end + +NS_ASSUME_NONNULL_END diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/Asset.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/Asset.h new file mode 100644 index 000000000..1a1277527 --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/Asset.h @@ -0,0 +1,62 @@ +// +// Asset.h +// RIL +// +// Created by Nathan Weiner on 11/9/10. +// Copyright 2010 Idea Shower, LLC. All rights reserved. +// + +#import + +@class AssetManager; + +NS_ASSUME_NONNULL_BEGIN + +@interface Asset : NSObject + +@property (nonatomic, strong) AssetManager *assetManager; +@property (nonatomic, strong) NSMutableDictionary *info; +@property (nonatomic, strong) NSURL *baseURL; +@property (nonatomic, copy) NSString * _Nullable absolute; +@property (nonatomic, copy) NSString *domain; +@property (nonatomic, copy) NSString *localPath; +@property (nonatomic, copy) NSString *relativePath; +@property (nonatomic, copy) NSString *truncatedPath; +@property (nonatomic, copy) NSString *localPathHead; +@property (nonatomic, copy) NSString *filename; +@property (nonatomic, copy) NSString *extension; +@property (nonatomic, assign) BOOL checkedExists; +@property (nonatomic, assign) BOOL doesExist; +@property (nonatomic, assign) BOOL temporary; + ++ (instancetype)assetFromUrl:(NSString *)url; ++ (instancetype)assetFromUrl:(NSString *)url temporary:(BOOL)temporary; ++ (instancetype)assetFromLiteral:(NSString *)literal baseURL:(NSURL *)base forceType:(int)forceType; + +#pragma mark - + +- (instancetype)init; +- (instancetype)initWithLiteral:(NSString *)literal baseURL:(NSURL *)base forceType:(int)forceType; + +- (BOOL)parseLiteral:(NSString *)literal withBaseURL:(NSURL *)base forceType:(int)forceType; + +#pragma mark - + +- (id)objectForKey:(NSString *)key; +- (void)setObject:(id)object forKey:(NSString *)key; +- (BOOL)exists; + +- (NSString *)relativePath; +- (NSString *)truncatedPath; + +#pragma mark - + +- (void)remove; + +#pragma mark - + +- (void)addImageDimensionCheckData:(NSNumber *)imageId uniqueId:(NSNumber *)uniqueId currentSize:(CGSize)size; + +@end + +NS_ASSUME_NONNULL_END diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/AssetManager.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/AssetManager.h new file mode 100755 index 000000000..2c91e554b --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/AssetManager.h @@ -0,0 +1,68 @@ +// +// AssetManager.h +// RIL +// +// Created by Nathan Weiner on 10/24/09. +// Copyright 2009 Idea Shower, LLC. All rights reserved. +// + +#import +#import "PKTSharedEnums.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface AssetManager : NSObject + +@property (nonatomic, copy) NSString *PATH_PREFIX_NAME; +@property (nonatomic, copy) NSString *DEFAULT_FOLDER_NAME; +@property (nonatomic, copy) NSString *PAGES_FOLDER_NAME; +@property (nonatomic, copy) NSString *ASSETS_FOLDER_NAME; +@property (nonatomic, copy) NSString *TEMP_FOLDER_NAME; +@property (nonatomic, copy) NSString *SESSION_FOLDER_NAME; +@property (nonatomic, copy) NSString *PATH_RIL; +@property (nonatomic, copy) NSString *PATH_CACHE; +@property (nonatomic, copy) NSString *PATH_PAGES; +@property (nonatomic, copy) NSString *PATH_ASSETS; +@property (nonatomic, copy) NSString *PATH_TEMP; +@property (nonatomic, copy) NSString *PATH_TEMP_SESSION; +@property (nonatomic, assign) int ROOT_DIRECTORY; +@property (nonatomic, assign) BOOL usesPrefix; +@property (nonatomic, assign) RILCheck offlinePathHadToBeCreated; + ++ (AssetManager *)appCacheManager; ++ (AssetManager *)generalManager; ++ (NSString *)incrementOfflinePrefix; + +- (AssetManager *)initAndCheckForOfflinePath:(BOOL)checkForOfflinePath; +- (BOOL)setupPaths:(BOOL)checkForOfflinePath; +- (BOOL)assetExists:(NSString *)path; +- (NSString *)cleanPathName:(NSString *)path; +- (NSString *)folderPathForUniqueId:(NSNumber *)uniqueId; +- (NSString *)pathForWeb:(NSNumber *)uniqueId mime:(NSString *)mimeType; +- (NSString *)pathForText:(NSNumber *)uniqueId; +- (NSString *)folderPathForTempURL:(NSURL *)url; +- (void)removeFolderForUniqueIdInThread:(NSNumber *)uniqueId; +- (void)removeFolderForUniqueId:(NSNumber *)uniqueId; +- (void)removeAssetDomain:(NSString *)assetDomain; + +#pragma mark - + +- (BOOL)copyResource:(NSString *)resource toPath:(NSString *)path; +- (BOOL)copyResource:(NSString *)resource toPath:(NSString *)path replace:(BOOL)replace; +- (BOOL)copyFile:(NSString *)file toPath:(NSString *)path replace:(BOOL)replace; +- (BOOL)copyBundleResourceToDocuments:(NSString *)resource; +- (BOOL)copyBundleResourceToDocuments:(NSString *)resource replace:(BOOL)replace; +- (BOOL)copyBundleResourceToSharedContainer:(NSString *)resource replace:(BOOL)replace; + +- (nullable NSURL *)pathByCreatingTemporaryFileForData:(NSData *)data withFilename:(NSString *)filename; + ++ (NSString *)extensionForMimeType:(NSString *)mime; + +#pragma mark - + +- (void)clearOldCaches; +- (void)clearTemp; + +@end + +NS_ASSUME_NONNULL_END diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/CLIColor.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/CLIColor.h new file mode 100644 index 000000000..e93056623 --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/CLIColor.h @@ -0,0 +1,54 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +#if TARGET_OS_OSX + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class represents an NSColor replacement for CLI projects that don't link with AppKit + **/ +@interface CLIColor : NSObject + +/** + * Convenience method for creating a `CLIColor` instance from RGBA params + * + * @param red red channel, between 0 and 1 + * @param green green channel, between 0 and 1 + * @param blue blue channel, between 0 and 1 + * @param alpha alpha channel, between 0 and 1 + */ ++ (instancetype)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; + +/** + * Get the RGBA components from a `CLIColor` + * + * @param red red channel, between 0 and 1 + * @param green green channel, between 0 and 1 + * @param blue blue channel, between 0 and 1 + * @param alpha alpha channel, between 0 and 1 + */ +- (void)getRed:(nullable CGFloat *)red green:(nullable CGFloat *)green blue:(nullable CGFloat *)blue alpha:(nullable CGFloat *)alpha NS_SWIFT_NAME(get(red:green:blue:alpha:)); + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/CocoaLumberjack.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/CocoaLumberjack.h new file mode 100644 index 000000000..8082d6ec4 --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/CocoaLumberjack.h @@ -0,0 +1,104 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +/** + * Welcome to CocoaLumberjack! + * + * The project page has a wealth of documentation if you have any questions. + * https://github.com/CocoaLumberjack/CocoaLumberjack + * + * If you're new to the project you may wish to read "Getting Started" at: + * Documentation/GettingStarted.md + * + * Otherwise, here is a quick refresher. + * There are three steps to using the macros: + * + * Step 1: + * Import the header in your implementation or prefix file: + * + * #import + * + * Step 2: + * Define your logging level in your implementation file: + * + * // Log levels: off, error, warn, info, verbose + * static const DDLogLevel ddLogLevel = DDLogLevelVerbose; + * + * Step 2 [3rd party frameworks]: + * + * Define your LOG_LEVEL_DEF to a different variable/function than ddLogLevel: + * + * // #undef LOG_LEVEL_DEF // Undefine first only if needed + * #define LOG_LEVEL_DEF myLibLogLevel + * + * Define your logging level in your implementation file: + * + * // Log levels: off, error, warn, info, verbose + * static const DDLogLevel myLibLogLevel = DDLogLevelVerbose; + * + * Step 3: + * Replace your NSLog statements with DDLog statements according to the severity of the message. + * + * NSLog(@"Fatal error, no dohickey found!"); -> DDLogError(@"Fatal error, no dohickey found!"); + * + * DDLog works exactly the same as NSLog. + * This means you can pass it multiple variables just like NSLog. + **/ + +#import + +//! Project version number for CocoaLumberjack. +FOUNDATION_EXPORT double CocoaLumberjackVersionNumber; + +//! Project version string for CocoaLumberjack. +FOUNDATION_EXPORT const unsigned char CocoaLumberjackVersionString[]; + +// Disable legacy macros +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 +#endif + +// Core +#import + +// Main macros +#import +#import + +// Capture ASL +#import + +// Loggers +#import + +#import +#import +#import +#import + +// Extensions +#import +#import +#import +#import +#import + +// CLI +#import + +// etc +#import +#import +#import diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDASLLogCapture.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDASLLogCapture.h new file mode 100644 index 000000000..7c5d8e384 --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDASLLogCapture.h @@ -0,0 +1,46 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +@protocol DDLogger; + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class provides the ability to capture the ASL (Apple System Logs) + */ +API_DEPRECATED("Use DDOSLogger instead", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)) +@interface DDASLLogCapture : NSObject + +/** + * Start capturing logs + */ ++ (void)start; + +/** + * Stop capturing logs + */ ++ (void)stop; + +/** + * The current capture level. + * @note Default log level: DDLogLevelVerbose (i.e. capture all ASL messages). + */ +@property (class) DDLogLevel captureLevel; + +@end + +NS_ASSUME_NONNULL_END diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDASLLogger.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDASLLogger.h new file mode 100644 index 000000000..65bae5cc8 --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDASLLogger.h @@ -0,0 +1,63 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +// Disable legacy macros +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 +#endif + +#import + +NS_ASSUME_NONNULL_BEGIN + +// Custom key set on messages sent to ASL +extern const char* const kDDASLKeyDDLog; + +// Value set for kDDASLKeyDDLog +extern const char* const kDDASLDDLogValue; + +/** + * This class provides a logger for the Apple System Log facility. + * + * As described in the "Getting Started" page, + * the traditional NSLog() function directs its output to two places: + * + * - Apple System Log + * - StdErr (if stderr is a TTY) so log statements show up in Xcode console + * + * To duplicate NSLog() functionality you can simply add this logger and a tty logger. + * However, if you instead choose to use file logging (for faster performance), + * you may choose to use a file logger and a tty logger. + **/ +API_DEPRECATED("Use DDOSLogger instead", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)) +@interface DDASLLogger : DDAbstractLogger + +/** + * Singleton method + * + * @return the shared instance + */ +@property (nonatomic, class, readonly, strong) DDASLLogger *sharedInstance; + +// Inherited from DDAbstractLogger + +// - (id )logFormatter; +// - (void)setLogFormatter:(id )formatter; + +@end + +NS_ASSUME_NONNULL_END diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h new file mode 100644 index 000000000..281690e49 --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h @@ -0,0 +1,127 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +// Disable legacy macros +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 +#endif + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class provides an abstract implementation of a database logger. + * + * That is, it provides the base implementation for a database logger to build atop of. + * All that is needed for a concrete database logger is to extend this class + * and override the methods in the implementation file that are prefixed with "db_". + **/ +@interface DDAbstractDatabaseLogger : DDAbstractLogger { + +@protected + NSUInteger _saveThreshold; + NSTimeInterval _saveInterval; + NSTimeInterval _maxAge; + NSTimeInterval _deleteInterval; + BOOL _deleteOnEverySave; + + NSInteger _saveTimerSuspended; + NSUInteger _unsavedCount; + dispatch_time_t _unsavedTime; + dispatch_source_t _saveTimer; + dispatch_time_t _lastDeleteTime; + dispatch_source_t _deleteTimer; +} + +/** + * Specifies how often to save the data to disk. + * Since saving is an expensive operation (disk io) it is not done after every log statement. + * These properties allow you to configure how/when the logger saves to disk. + * + * A save is done when either (whichever happens first): + * + * - The number of unsaved log entries reaches saveThreshold + * - The amount of time since the oldest unsaved log entry was created reaches saveInterval + * + * You can optionally disable the saveThreshold by setting it to zero. + * If you disable the saveThreshold you are entirely dependent on the saveInterval. + * + * You can optionally disable the saveInterval by setting it to zero (or a negative value). + * If you disable the saveInterval you are entirely dependent on the saveThreshold. + * + * It's not wise to disable both saveThreshold and saveInterval. + * + * The default saveThreshold is 500. + * The default saveInterval is 60 seconds. + **/ +@property (assign, readwrite) NSUInteger saveThreshold; + +/** + * See the description for the `saveThreshold` property + */ +@property (assign, readwrite) NSTimeInterval saveInterval; + +/** + * It is likely you don't want the log entries to persist forever. + * Doing so would allow the database to grow infinitely large over time. + * + * The maxAge property provides a way to specify how old a log statement can get + * before it should get deleted from the database. + * + * The deleteInterval specifies how often to sweep for old log entries. + * Since deleting is an expensive operation (disk io) is is done on a fixed interval. + * + * An alternative to the deleteInterval is the deleteOnEverySave option. + * This specifies that old log entries should be deleted during every save operation. + * + * You can optionally disable the maxAge by setting it to zero (or a negative value). + * If you disable the maxAge then old log statements are not deleted. + * + * You can optionally disable the deleteInterval by setting it to zero (or a negative value). + * + * If you disable both deleteInterval and deleteOnEverySave then old log statements are not deleted. + * + * It's not wise to enable both deleteInterval and deleteOnEverySave. + * + * The default maxAge is 7 days. + * The default deleteInterval is 5 minutes. + * The default deleteOnEverySave is NO. + **/ +@property (assign, readwrite) NSTimeInterval maxAge; + +/** + * See the description for the `maxAge` property + */ +@property (assign, readwrite) NSTimeInterval deleteInterval; + +/** + * See the description for the `maxAge` property + */ +@property (assign, readwrite) BOOL deleteOnEverySave; + +/** + * Forces a save of any pending log entries (flushes log entries to disk). + **/ +- (void)savePendingLogEntries; + +/** + * Removes any log entries that are older than maxAge. + **/ +- (void)deleteOldLogEntries; + +@end + +NS_ASSUME_NONNULL_END diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDAssertMacros.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDAssertMacros.h new file mode 100644 index 000000000..f4b7d58ff --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDAssertMacros.h @@ -0,0 +1,30 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +/** + * NSAssert replacement that will output a log message even when assertions are disabled. + **/ +#define DDAssert(condition, frmt, ...) \ + if (!(condition)) { \ + NSString *description = [NSString stringWithFormat:frmt, ## __VA_ARGS__]; \ + DDLogError(@"%@", description); \ + NSAssert(NO, @"%@", description); \ + } +#define DDAssertCondition(condition) DDAssert(condition, @"Condition not satisfied: %s", #condition) + +/** + * Analog to `DDAssertionFailure` from DDAssert.swift for use in Objective C + */ +#define DDAssertionFailure(frmt, ...) DDAssert(NO, frmt, ##__VA_ARGS__) diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDContextFilterLogFormatter+Deprecated.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDContextFilterLogFormatter+Deprecated.h new file mode 100644 index 000000000..3dcc6af32 --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDContextFilterLogFormatter+Deprecated.h @@ -0,0 +1,119 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class provides a log formatter that filters log statements from a logging context not on the whitelist. + * @deprecated Use DDContextAllowlistFilterLogFormatter instead. + * + * A log formatter can be added to any logger to format and/or filter its output. + * You can learn more about log formatters here: + * Documentation/CustomFormatters.md + * + * You can learn more about logging context's here: + * Documentation/CustomContext.md + * + * But here's a quick overview / refresher: + * + * Every log statement has a logging context. + * These come from the underlying logging macros defined in DDLog.h. + * The default logging context is zero. + * You can define multiple logging context's for use in your application. + * For example, logically separate parts of your app each have a different logging context. + * Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context. + **/ +__attribute__((deprecated("Use DDContextAllowlistFilterLogFormatter instead"))) +typedef DDContextAllowlistFilterLogFormatter DDContextWhitelistFilterLogFormatter; + +@interface DDContextAllowlistFilterLogFormatter (Deprecated) + +/** + * Add a context to the whitelist + * @deprecated Use -addToAllowlist: instead. + * + * @param loggingContext the context + */ +- (void)addToWhitelist:(NSInteger)loggingContext __attribute__((deprecated("Use -addToAllowlist: instead"))); + +/** + * Remove context from whitelist + * @deprecated Use -removeFromAllowlist: instead. + * + * @param loggingContext the context + */ +- (void)removeFromWhitelist:(NSInteger)loggingContext __attribute__((deprecated("Use -removeFromAllowlist: instead"))); + +/** + * Return the whitelist + * @deprecated Use allowlist instead. + */ +@property (nonatomic, readonly, copy) NSArray *whitelist __attribute__((deprecated("Use allowlist instead"))); + +/** + * Check if a context is on the whitelist + * @deprecated Use -isOnAllowlist: instead. + * + * @param loggingContext the context + */ +- (BOOL)isOnWhitelist:(NSInteger)loggingContext __attribute__((deprecated("Use -isOnAllowlist: instead"))); + +@end + + +/** + * This class provides a log formatter that filters log statements from a logging context on the blacklist. + * @deprecated Use DDContextDenylistFilterLogFormatter instead. + **/ +__attribute__((deprecated("Use DDContextDenylistFilterLogFormatter instead"))) +typedef DDContextDenylistFilterLogFormatter DDContextBlacklistFilterLogFormatter; + +@interface DDContextDenylistFilterLogFormatter (Deprecated) + +/** + * Add a context to the blacklist + * @deprecated Use -addToDenylist: instead. + * + * @param loggingContext the context + */ +- (void)addToBlacklist:(NSInteger)loggingContext __attribute__((deprecated("Use -addToDenylist: instead"))); + +/** + * Remove context from blacklist + * @deprecated Use -removeFromDenylist: instead. + * + * @param loggingContext the context + */ +- (void)removeFromBlacklist:(NSInteger)loggingContext __attribute__((deprecated("Use -removeFromDenylist: instead"))); + +/** + * Return the blacklist + * @deprecated Use denylist instead. + */ +@property (readonly, copy) NSArray *blacklist __attribute__((deprecated("Use denylist instead"))); + +/** + * Check if a context is on the blacklist + * @deprecated Use -isOnDenylist: instead. + * + * @param loggingContext the context + */ +- (BOOL)isOnBlacklist:(NSInteger)loggingContext __attribute__((deprecated("Use -isOnDenylist: instead"))); + +@end + +NS_ASSUME_NONNULL_END diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDContextFilterLogFormatter.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDContextFilterLogFormatter.h new file mode 100644 index 000000000..61d37aa8f --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDContextFilterLogFormatter.h @@ -0,0 +1,117 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +// Disable legacy macros +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 +#endif + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class provides a log formatter that filters log statements from a logging context not on the allowlist. + * + * A log formatter can be added to any logger to format and/or filter its output. + * You can learn more about log formatters here: + * Documentation/CustomFormatters.md + * + * You can learn more about logging context's here: + * Documentation/CustomContext.md + * + * But here's a quick overview / refresher: + * + * Every log statement has a logging context. + * These come from the underlying logging macros defined in DDLog.h. + * The default logging context is zero. + * You can define multiple logging context's for use in your application. + * For example, logically separate parts of your app each have a different logging context. + * Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context. + **/ +@interface DDContextAllowlistFilterLogFormatter : NSObject + +/** + * Designated default initializer + */ +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** + * Add a context to the allowlist + * + * @param loggingContext the context + */ +- (void)addToAllowlist:(NSInteger)loggingContext; + +/** + * Remove context from allowlist + * + * @param loggingContext the context + */ +- (void)removeFromAllowlist:(NSInteger)loggingContext; + +/** + * Return the allowlist + */ +@property (nonatomic, readonly, copy) NSArray *allowlist; + +/** + * Check if a context is on the allowlist + * + * @param loggingContext the context + */ +- (BOOL)isOnAllowlist:(NSInteger)loggingContext; + +@end + + +/** + * This class provides a log formatter that filters log statements from a logging context on the denylist. + **/ +@interface DDContextDenylistFilterLogFormatter : NSObject + +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** + * Add a context to the denylist + * + * @param loggingContext the context + */ +- (void)addToDenylist:(NSInteger)loggingContext; + +/** + * Remove context from denylist + * + * @param loggingContext the context + */ +- (void)removeFromDenylist:(NSInteger)loggingContext; + +/** + * Return the denylist + */ +@property (readonly, copy) NSArray *denylist; + +/** + * Check if a context is on the denylist + * + * @param loggingContext the context + */ +- (BOOL)isOnDenylist:(NSInteger)loggingContext; + +@end + +NS_ASSUME_NONNULL_END diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDDispatchQueueLogFormatter.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDDispatchQueueLogFormatter.h new file mode 100644 index 000000000..618cc08eb --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDDispatchQueueLogFormatter.h @@ -0,0 +1,223 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +// Disable legacy macros +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 +#endif + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Log formatter mode + */ +__attribute__((deprecated("DDDispatchQueueLogFormatter is always shareable"))) +typedef NS_ENUM(NSUInteger, DDDispatchQueueLogFormatterMode){ + /** + * This is the default option, means the formatter can be reused between multiple loggers and therefore is thread-safe. + * There is, of course, a performance cost for the thread-safety + */ + DDDispatchQueueLogFormatterModeShareble = 0, + /** + * If the formatter will only be used by a single logger, then the thread-safety can be removed + * @note: there is an assert checking if the formatter is added to multiple loggers and the mode is non-shareble + */ + DDDispatchQueueLogFormatterModeNonShareble, +}; + +/** + * Quality of Service names. + * + * Since macOS 10.10 and iOS 8.0, pthreads, dispatch queues and NSOperations express their + * scheduling priority by using an abstract classification called Quality of Service (QOS). + * + * This formatter will add a representation of this QOS in the log message by using those + * string constants. + * For example: + * + * `2011-10-17 20:21:45.435 AppName[19928:5207 (QOS:DF)] Your log message here` + * + * Where QOS is one of: + * `- UI = User Interactive` + * `- IN = User Initiated` + * `- DF = Default` + * `- UT = Utility` + * `- BG = Background` + * `- UN = Unspecified` + * + * Note: QOS will be absent in the log messages if running on OS versions that don't support it. + **/ +typedef NSString * DDQualityOfServiceName NS_STRING_ENUM; + +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceUserInteractive NS_SWIFT_NAME(DDQualityOfServiceName.userInteractive) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceUserInitiated NS_SWIFT_NAME(DDQualityOfServiceName.userInitiated) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceDefault NS_SWIFT_NAME(DDQualityOfServiceName.default) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceUtility NS_SWIFT_NAME(DDQualityOfServiceName.utility) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceBackground NS_SWIFT_NAME(DDQualityOfServiceName.background) API_AVAILABLE(macos(10.10), ios(8.0)); +FOUNDATION_EXPORT DDQualityOfServiceName const DDQualityOfServiceUnspecified NS_SWIFT_NAME(DDQualityOfServiceName.unspecified) API_AVAILABLE(macos(10.10), ios(8.0)); + +/** + * This class provides a log formatter that prints the dispatch_queue label instead of the mach_thread_id. + * + * A log formatter can be added to any logger to format and/or filter its output. + * You can learn more about log formatters here: + * Documentation/CustomFormatters.md + * + * A typical `NSLog` (or `DDTTYLogger`) prints detailed info as `[:]`. + * For example: + * + * `2011-10-17 20:21:45.435 AppName[19928:5207] Your log message here` + * + * Where: + * `- 19928 = process id` + * `- 5207 = thread id (mach_thread_id printed in hex)` + * + * When using grand central dispatch (GCD), this information is less useful. + * This is because a single serial dispatch queue may be run on any thread from an internally managed thread pool. + * For example: + * + * `2011-10-17 20:32:31.111 AppName[19954:4d07] Message from my_serial_dispatch_queue` + * `2011-10-17 20:32:31.112 AppName[19954:5207] Message from my_serial_dispatch_queue` + * `2011-10-17 20:32:31.113 AppName[19954:2c55] Message from my_serial_dispatch_queue` + * + * This formatter allows you to replace the standard `[box:info]` with the dispatch_queue name. + * For example: + * + * `2011-10-17 20:32:31.111 AppName[img-scaling] Message from my_serial_dispatch_queue` + * `2011-10-17 20:32:31.112 AppName[img-scaling] Message from my_serial_dispatch_queue` + * `2011-10-17 20:32:31.113 AppName[img-scaling] Message from my_serial_dispatch_queue` + * + * If the dispatch_queue doesn't have a set name, then it falls back to the thread name. + * If the current thread doesn't have a set name, then it falls back to the mach_thread_id in hex (like normal). + * + * Note: If manually creating your own background threads (via `NSThread/alloc/init` or `NSThread/detachNeThread`), + * you can use `[[NSThread currentThread] setName:(NSString *)]`. + **/ +@interface DDDispatchQueueLogFormatter : NSObject + +/** + * Standard init method. + * Configure using properties as desired. + **/ +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** + * Initializer with ability to set the queue mode + * + * @param mode choose between DDDispatchQueueLogFormatterModeShareble and DDDispatchQueueLogFormatterModeNonShareble, depending if the formatter is shared between several loggers or not + */ +- (instancetype)initWithMode:(DDDispatchQueueLogFormatterMode)mode __attribute__((deprecated("DDDispatchQueueLogFormatter is always shareable"))); + +/** + * The minQueueLength restricts the minimum size of the [detail box]. + * If the minQueueLength is set to 0, there is no restriction. + * + * For example, say a dispatch_queue has a label of "diskIO": + * + * If the minQueueLength is 0: [diskIO] + * If the minQueueLength is 4: [diskIO] + * If the minQueueLength is 5: [diskIO] + * If the minQueueLength is 6: [diskIO] + * If the minQueueLength is 7: [diskIO ] + * If the minQueueLength is 8: [diskIO ] + * + * The default minQueueLength is 0 (no minimum, so [detail box] won't be padded). + * + * If you want every [detail box] to have the exact same width, + * set both minQueueLength and maxQueueLength to the same value. + **/ +@property (assign, atomic) NSUInteger minQueueLength; + +/** + * The maxQueueLength restricts the number of characters that will be inside the [detail box]. + * If the maxQueueLength is 0, there is no restriction. + * + * For example, say a dispatch_queue has a label of "diskIO": + * + * If the maxQueueLength is 0: [diskIO] + * If the maxQueueLength is 4: [disk] + * If the maxQueueLength is 5: [diskI] + * If the maxQueueLength is 6: [diskIO] + * If the maxQueueLength is 7: [diskIO] + * If the maxQueueLength is 8: [diskIO] + * + * The default maxQueueLength is 0 (no maximum, so [detail box] won't be truncated). + * + * If you want every [detail box] to have the exact same width, + * set both minQueueLength and maxQueueLength to the same value. + **/ +@property (assign, atomic) NSUInteger maxQueueLength; + +/** + * Sometimes queue labels have long names like "com.apple.main-queue", + * but you'd prefer something shorter like simply "main". + * + * This method allows you to set such preferred replacements. + * The above example is set by default. + * + * To remove/undo a previous replacement, invoke this method with nil for the 'shortLabel' parameter. + **/ +- (nullable NSString *)replacementStringForQueueLabel:(NSString *)longLabel; + +/** + * See the `replacementStringForQueueLabel:` description + */ +- (void)setReplacementString:(nullable NSString *)shortLabel forQueueLabel:(NSString *)longLabel; + +@end + +/** + * Category on `DDDispatchQueueLogFormatter` to make method declarations easier to extend/modify + **/ +@interface DDDispatchQueueLogFormatter (OverridableMethods) + +/** + * Date formatter default configuration + */ +- (void)configureDateFormatter:(NSDateFormatter *)dateFormatter; + +/** + * Formatter method to transfrom from date to string + */ +- (NSString *)stringFromDate:(NSDate *)date; + +/** + * Method to compute the queue thread label + */ +- (NSString *)queueThreadLabelForLogMessage:(DDLogMessage *)logMessage; + +@end + +#pragma mark - DDAtomicCountable + +__attribute__((deprecated("DDAtomicCountable is useless since DDDispatchQueueLogFormatter is always shareable now"))) +@protocol DDAtomicCountable + +- (instancetype)initWithDefaultValue:(int32_t)defaultValue; +- (int32_t)increment; +- (int32_t)decrement; +- (int32_t)value; + +@end + +__attribute__((deprecated("DDAtomicCountable is deprecated"))) +@interface DDAtomicCounter: NSObject +@end + +NS_ASSUME_NONNULL_END diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDFileLogger+Buffering.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDFileLogger+Buffering.h new file mode 100644 index 000000000..f4cfcfcf3 --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDFileLogger+Buffering.h @@ -0,0 +1,27 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface DDFileLogger (Buffering) + +- (instancetype)wrapWithBuffer; +- (instancetype)unwrapFromBuffer; + +@end + +NS_ASSUME_NONNULL_END diff --git a/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDFileLogger.h b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDFileLogger.h new file mode 100644 index 000000000..e18973ba5 --- /dev/null +++ b/PocketKit/Frameworks/PKTListen.xcframework/ios-arm64/Headers/CocoaLumberjack/DDFileLogger.h @@ -0,0 +1,532 @@ +// Software License Agreement (BSD License) +// +// Copyright (c) 2010-2022, Deusty, LLC +// All rights reserved. +// +// Redistribution and use of this software in source and binary forms, +// with or without modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Neither the name of Deusty nor the names of its contributors may be used +// to endorse or promote products derived from this software without specific +// prior written permission of Deusty, LLC. + +// Disable legacy macros +#ifndef DD_LEGACY_MACROS + #define DD_LEGACY_MACROS 0 +#endif + +#import + +@class DDLogFileInfo; + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class provides a logger to write log statements to a file. + **/ + + +// Default configuration and safety/sanity values. +// +// maximumFileSize -> kDDDefaultLogMaxFileSize +// rollingFrequency -> kDDDefaultLogRollingFrequency +// maximumNumberOfLogFiles -> kDDDefaultLogMaxNumLogFiles +// logFilesDiskQuota -> kDDDefaultLogFilesDiskQuota +// +// You should carefully consider the proper configuration values for your application. + +extern unsigned long long const kDDDefaultLogMaxFileSize; +extern NSTimeInterval const kDDDefaultLogRollingFrequency; +extern NSUInteger const kDDDefaultLogMaxNumLogFiles; +extern unsigned long long const kDDDefaultLogFilesDiskQuota; + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * The LogFileManager protocol is designed to allow you to control all aspects of your log files. + * + * The primary purpose of this is to allow you to do something with the log files after they have been rolled. + * Perhaps you want to compress them to save disk space. + * Perhaps you want to upload them to an FTP server. + * Perhaps you want to run some analytics on the file. + * + * A default LogFileManager is, of course, provided. + * The default LogFileManager simply deletes old log files according to the maximumNumberOfLogFiles property. + * + * This protocol provides various methods to fetch the list of log files. + * + * There are two variants: sorted and unsorted. + * If sorting is not necessary, the unsorted variant is obviously faster. + * The sorted variant will return an array sorted by when the log files were created, + * with the most recently created log file at index 0, and the oldest log file at the end of the array. + * + * You can fetch only the log file paths (full path including name), log file names (name only), + * or an array of `DDLogFileInfo` objects. + * The `DDLogFileInfo` class is documented below, and provides a handy wrapper that + * gives you easy access to various file attributes such as the creation date or the file size. + */ +@protocol DDLogFileManager +@required + +// Public properties + +/** + * The maximum number of archived log files to keep on disk. + * For example, if this property is set to 3, + * then the LogFileManager will only keep 3 archived log files (plus the current active log file) on disk. + * Once the active log file is rolled/archived, then the oldest of the existing 3 rolled/archived log files is deleted. + * + * You may optionally disable this option by setting it to zero. + **/ +@property (readwrite, assign, atomic) NSUInteger maximumNumberOfLogFiles; + +/** + * The maximum space that logs can take. On rolling logfile all old log files that exceed logFilesDiskQuota will + * be deleted. + * + * You may optionally disable this option by setting it to zero. + **/ +@property (readwrite, assign, atomic) unsigned long long logFilesDiskQuota; + +// Public methods + +/** + * Returns the logs directory (path) + */ +@property (nonatomic, readonly, copy) NSString *logsDirectory; + +/** + * Returns an array of `NSString` objects, + * each of which is the filePath to an existing log file on disk. + **/ +@property (nonatomic, readonly, strong) NSArray *unsortedLogFilePaths; + +/** + * Returns an array of `NSString` objects, + * each of which is the fileName of an existing log file on disk. + **/ +@property (nonatomic, readonly, strong) NSArray *unsortedLogFileNames; + +/** + * Returns an array of `DDLogFileInfo` objects, + * each representing an existing log file on disk, + * and containing important information about the log file such as it's modification date and size. + **/ +@property (nonatomic, readonly, strong) NSArray *unsortedLogFileInfos; + +/** + * Just like the `unsortedLogFilePaths` method, but sorts the array. + * The items in the array are sorted by creation date. + * The first item in the array will be the most recently created log file. + **/ +@property (nonatomic, readonly, strong) NSArray *sortedLogFilePaths; + +/** + * Just like the `unsortedLogFileNames` method, but sorts the array. + * The items in the array are sorted by creation date. + * The first item in the array will be the most recently created log file. + **/ +@property (nonatomic, readonly, strong) NSArray *sortedLogFileNames; + +/** + * Just like the `unsortedLogFileInfos` method, but sorts the array. + * The items in the array are sorted by creation date. + * The first item in the array will be the most recently created log file. + **/ +@property (nonatomic, readonly, strong) NSArray *sortedLogFileInfos; + +// Private methods (only to be used by DDFileLogger) + +/** + * Generates a new unique log file path, and creates the corresponding log file. + * This method is executed directly on the file logger's internal queue. + * The file has to exist by the time the method returns. + **/ +- (nullable NSString *)createNewLogFileWithError:(NSError **)error; + +@optional + +// Private methods (only to be used by DDFileLogger) +/** + * Creates a new log file ignoring any errors. Deprecated in favor of `-createNewLogFileWithError:`. + * Will only be called if `-createNewLogFileWithError:` is not implemented. + **/ +- (nullable NSString *)createNewLogFile __attribute__((deprecated("Use -createNewLogFileWithError:"))) NS_SWIFT_UNAVAILABLE("Use -createNewLogFileWithError:"); + +// Notifications from DDFileLogger + +/// Called when a log file was archived. Executed on global queue with default priority. +/// @param logFilePath The path to the log file that was archived. +/// @param wasRolled Whether or not the archiving happend after rolling the log file. +- (void)didArchiveLogFile:(NSString *)logFilePath wasRolled:(BOOL)wasRolled NS_SWIFT_NAME(didArchiveLogFile(atPath:wasRolled:)); + +// Deprecated APIs +/** + * Called when a log file was archived. Executed on global queue with default priority. + */ +- (void)didArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didArchiveLogFile(atPath:)) __attribute__((deprecated("Use -didArchiveLogFile:wasRolled:"))); + +/** + * Called when the roll action was executed and the log was archived. + * Executed on global queue with default priority. + */ +- (void)didRollAndArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didRollAndArchiveLogFile(atPath:)) __attribute__((deprecated("Use -didArchiveLogFile:wasRolled:"))); + +@end + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * Default log file manager. + * + * All log files are placed inside the logsDirectory. + * If a specific logsDirectory isn't specified, the default directory is used. + * On Mac, this is in `~/Library/Logs/`. + * On iPhone, this is in `~/Library/Caches/Logs`. + * + * Log files are named `"