├── Sources ├── NSTask │ └── NSTask.swift ├── CFrameworks │ ├── libarchive │ │ ├── libarchive.h │ │ └── archive_entry.h │ ├── MediaPlayer │ │ ├── MediaPlayerPrivate.h │ │ ├── MPArtworkColorAnalyzer.h │ │ └── MPArtworkColorAnalysis.h │ ├── CoreUI │ │ ├── CoreUI.h │ │ ├── CUIStructuredThemeStore.h │ │ ├── CSIBitmapWrapper.h │ │ ├── CUINamedLookup.h │ │ ├── CUICatalog.h │ │ ├── structs.h │ │ ├── CSIGenerator.h │ │ ├── CUICommonAssetStorage.h │ │ ├── CUIRenditionKey.h │ │ ├── CUIThemeRendition.h │ │ └── CoreUI.tbd │ ├── DiskImages2 │ │ ├── DIDeviceHandle.h │ │ ├── DiskImages2.h │ │ ├── DIAttachParams.h │ │ └── DiskImages2.tbd │ ├── module.modulemap │ ├── CoreSVG │ │ ├── CoreSVG.h │ │ └── CoreSVG.tbd │ ├── LaunchServices │ │ └── LaunchServices.h │ └── NSTask │ │ └── NSTask.h ├── FSOperations │ ├── RootHelperConfiguration.swift │ └── FSOperation.swift ├── DiskImagesWrapper │ ├── DeviceHandle.swift │ ├── Parameters.swift │ └── DiskImages.swift ├── AssetCatalogWrapper │ ├── CodableExtensions.swift │ └── AssetCatalogWrapper.swift ├── ApplicationsWrapper │ └── ApplicationsManager.swift ├── SVGWrapper │ └── SVGDocument.swift └── CompressionWrapper │ └── Compression.swift ├── README.md ├── .gitignore ├── Tests ├── CompressionTests │ ├── TestFile.swift │ ├── Subdirectory │ │ └── Plaintext │ └── Tests.swift ├── DiskImagesTests │ └── Tests.swift └── FSOperationsTests │ └── Tests.swift └── Package.swift /Sources/NSTask/NSTask.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSTask.swift 3 | // 4 | // 5 | // Created by Serena on 17/10/2022 6 | // 7 | 8 | 9 | @_exported import NSTaskBridge 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PrivateKit(s) 2 | 3 | Wrappers of iOS System Frameworks that are used by Santander, you can use these too, though there's almost no documentation, reach out to me on twitter (@fileintegrity) in case you want anything explained 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /*.xcodeproj 5 | xcuserdata/ 6 | DerivedData/ 7 | .swiftpm/config/registries.json 8 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata 9 | .netrc 10 | Output.zip 11 | .swiftpm/ 12 | -------------------------------------------------------------------------------- /Tests/CompressionTests/TestFile.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Serena on 22/10/2022 6 | // 7 | 8 | 9 | import Foundation 10 | 11 | // test data file 12 | fileprivate struct RandomFileStruct { 13 | let path: String 14 | let f: String 15 | } 16 | -------------------------------------------------------------------------------- /Sources/CFrameworks/libarchive/libarchive.h: -------------------------------------------------------------------------------- 1 | // 2 | // libarchive.h 3 | // 4 | // 5 | // Created by Serena on 21/10/2022 6 | // 7 | 8 | 9 | #ifndef libarchive_h 10 | #define libarchive_h 11 | 12 | #include "archive_entry.h" 13 | #include "archive.h" 14 | 15 | #endif /* libarchive_h */ 16 | -------------------------------------------------------------------------------- /Tests/CompressionTests/Subdirectory/Plaintext: -------------------------------------------------------------------------------- 1 | // this is just test data for the archiver/unarchiver 2 | @import Foundation; 3 | 4 | @interface RandomClass : NSObject 5 | -(void)kill; 6 | @end 7 | 8 | 9 | @implementation RandomClass 10 | -(void)kill { 11 | pid_t pid = getpid(); 12 | kill(pid, SIGTERM); 13 | } 14 | @end 15 | -------------------------------------------------------------------------------- /Sources/FSOperations/RootHelperConfiguration.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RootHelperConfiguration.swift 3 | // 4 | // 5 | // Created by Serena on 17/10/2022 6 | // 7 | 8 | 9 | import Foundation 10 | 11 | public protocol RootHelperConfiguration { 12 | var useRootHelper: Bool { get } 13 | 14 | func perform(_ operation: FSOperation) throws 15 | } 16 | -------------------------------------------------------------------------------- /Sources/CFrameworks/MediaPlayer/MediaPlayerPrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MediaPlayerPrivate.h 3 | // 4 | // 5 | // Created by Serena on 09/11/2022 6 | // 7 | 8 | 9 | #ifndef MediaPlayerPrivate_h 10 | #define MediaPlayerPrivate_h 11 | 12 | #include "MPArtworkColorAnalyzer.h" 13 | #include "MPArtworkColorAnalysis.h" 14 | 15 | #endif /* MediaPlayerPrivate_h */ 16 | -------------------------------------------------------------------------------- /Sources/CFrameworks/CoreUI/CoreUI.h: -------------------------------------------------------------------------------- 1 | // 2 | // CoreUI.h 3 | // Santander 4 | // 5 | // Created by Serena on 16/09/2022 6 | // 7 | 8 | 9 | #ifndef CoreUI_h 10 | #define CoreUI_h 11 | 12 | #include "CUIThemeRendition.h" 13 | #include "CUICatalog.h" 14 | #include "CUICommonAssetStorage.h" 15 | #include "CUINamedLookup.h" 16 | #include "CUIStructuredThemeStore.h" 17 | #include "CSIGenerator.h" 18 | #include "CSIBitmapWrapper.h" 19 | 20 | #endif /* CoreUI_h */ 21 | -------------------------------------------------------------------------------- /Sources/CFrameworks/CoreUI/CUIStructuredThemeStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // CUIStructuredThemeStore.h 3 | // Santander 4 | // 5 | // Created by Serena on 26/09/2022 6 | // 7 | 8 | 9 | #ifndef CUIStructuredThemeStore_h 10 | #define CUIStructuredThemeStore_h 11 | #include "CUIThemeRendition.h" 12 | 13 | @interface CUIStructuredThemeStore : NSObject 14 | - (NSData *)convertRenditionKeyToKeyData:(const struct renditionkeytoken *)arg1; 15 | @end 16 | 17 | #endif /* CUIStructuredThemeStore_h */ 18 | -------------------------------------------------------------------------------- /Sources/CFrameworks/DiskImages2/DIDeviceHandle.h: -------------------------------------------------------------------------------- 1 | // 2 | // Header.h 3 | // 4 | // 5 | // Created by Serena on 24/10/2022 6 | // 7 | 8 | 9 | #ifndef DIDeviceHandle_h 10 | #define DIDeviceHandle_h 11 | 12 | @import Foundation; 13 | 14 | @interface DIDeviceHandle : NSObject 15 | @property (nonnull, retain, nonatomic) NSString *BSDName; 16 | @property (readonly, nonatomic) NSUInteger regEntryID; 17 | @property (nonatomic) BOOL handleRefCount; 18 | @end 19 | 20 | #endif /* DIDeviceHandle_h */ 21 | -------------------------------------------------------------------------------- /Sources/CFrameworks/CoreUI/CSIBitmapWrapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // CSIBitmapWrapper.h 3 | // Santander 4 | // 5 | // Created by Serena on 28/09/2022 6 | // 7 | 8 | 9 | #ifndef CSIBitmapWrapper_h 10 | #define CSIBitmapWrapper_h 11 | @import CoreGraphics.CGContext; 12 | 13 | @interface CSIBitmapWrapper : NSObject 14 | - (CGContextRef *)bitmapContext; 15 | - (id)initWithPixelWidth:(unsigned int)arg1 pixelHeight:(unsigned int)arg2; 16 | 17 | - (unsigned int)sourceAlphaInfo; 18 | - (void)setSourceAlphaInfo:(CGImageAlphaInfo)arg1; 19 | @end 20 | 21 | #endif /* CSIBitmapWrapper_h */ 22 | -------------------------------------------------------------------------------- /Sources/CFrameworks/CoreUI/CUINamedLookup.h: -------------------------------------------------------------------------------- 1 | // 2 | // CUINamedLookup.h 3 | // Santander 4 | // 5 | // Created by Serena on 16/09/2022 6 | // 7 | 8 | 9 | #ifndef CUINamedLookup_h 10 | #define CUINamedLookup_h 11 | #include "CUIThemeRendition.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | @interface CUINamedLookup : NSObject 15 | @property (copy, nonatomic) NSString *name; 16 | @property (readonly, nonatomic) NSString *renditionName; 17 | @property (readonly, nonatomic) NSString *appearance; 18 | @property (readonly, nonatomic, getter=_rendition) CUIThemeRendition *rendition; 19 | @property (copy, nonatomic) CUIRenditionKey *key; 20 | @property (nonatomic) NSUInteger storageRef; 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | #endif /* CUINamedLookup_h */ 25 | -------------------------------------------------------------------------------- /Sources/CFrameworks/CoreUI/CUICatalog.h: -------------------------------------------------------------------------------- 1 | // 2 | // CUICatalog.h 3 | // Santander 4 | // 5 | // Created by Serena on 16/09/2022 6 | // 7 | 8 | 9 | #ifndef CUICatalog_h 10 | #define CUICatalog_h 11 | @import Foundation; 12 | 13 | #include "CUINamedLookup.h" 14 | #include "CUIStructuredThemeStore.h" 15 | 16 | #define SWIFT_THROWING __attribute__((__swift_error__(nonnull_error))) 17 | 18 | NS_ASSUME_NONNULL_BEGIN 19 | @interface CUICatalog : NSObject 20 | + (CUICatalog *)defaultUICatalogForBundle:(NSBundle *)bundle; 21 | - (id)initWithURL:(NSURL *)url error:(NSError **)error SWIFT_THROWING; 22 | - (void)enumerateNamedLookupsUsingBlock:(void (^)(CUINamedLookup *namedAsset))block; 23 | - (CUIStructuredThemeStore *)_themeStore; 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | #endif /* CUICatalog_h */ 28 | -------------------------------------------------------------------------------- /Sources/CFrameworks/DiskImages2/DiskImages2.h: -------------------------------------------------------------------------------- 1 | // 2 | // Header.h 3 | // 4 | // 5 | // Created by Serena on 24/10/2022 6 | // 7 | 8 | 9 | #ifndef DiskImages2_h 10 | #define DiskImages2_h 11 | 12 | @import Foundation; 13 | 14 | #include "DIAttachParams.h" 15 | #include "DIDeviceHandle.h" 16 | 17 | #define SWIFT_THROWS __attribute__((__swift_error__(nonnull_error))) 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | @interface DiskImages2 : NSObject 22 | // Prints the URL from which an attached disk came from 23 | +(NSURL * _Nonnull)imageURLFromDevice:(NSURL *)arg1 error:(NSError **)arg2 SWIFT_THROWS; 24 | +(BOOL)attachWithParams:(DIAttachParams *)param handle:(DIDeviceHandle * _Nullable * _Nullable)h error:(NSError **)err SWIFT_THROWS; 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | 29 | #endif /* DiskImages2_h */ 30 | -------------------------------------------------------------------------------- /Sources/CFrameworks/CoreUI/structs.h: -------------------------------------------------------------------------------- 1 | // 2 | // structs.h 3 | // Santander 4 | // 5 | // Created by Serena on 27/09/2022 6 | // 7 | 8 | 9 | #ifndef structs_h 10 | #define structs_h 11 | 12 | struct renditionkeytoken { 13 | unsigned short identifier; 14 | unsigned short value; 15 | }; 16 | 17 | struct rgbquad { 18 | unsigned int b:8; 19 | unsigned int g:8; 20 | unsigned int r:8; 21 | unsigned int a:8; 22 | }; 23 | 24 | struct cuithemerenditionrenditionflags { 25 | unsigned int isHeaderFlaggedFPO:1; 26 | unsigned int isExcludedFromContrastFilter:1; 27 | unsigned int isVectorBased:1; 28 | unsigned int isOpaque:1; 29 | unsigned int bitmapEncoding:4; 30 | unsigned int optOutOfThinning:1; 31 | unsigned int isFlippable:1; 32 | unsigned int isTintable:1; 33 | unsigned int preservedVectorRepresentation:1; 34 | unsigned int reserved:20; 35 | }; 36 | 37 | #endif /* structs_h */ 38 | -------------------------------------------------------------------------------- /Sources/CFrameworks/DiskImages2/DIAttachParams.h: -------------------------------------------------------------------------------- 1 | // 2 | // Header.h 3 | // 4 | // 5 | // Created by Serena on 24/10/2022 6 | // 7 | 8 | 9 | #ifndef DIAttachParams_h 10 | #define DIAttachParams_h 11 | 12 | @import Foundation; 13 | 14 | #define SWIFT_THROWS __attribute__((__swift_error__(nonnull_error))) 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface DIAttachParams : NSObject { 19 | 20 | BOOL _autoMount; 21 | BOOL _handleRefCount; 22 | long long _fileMode; 23 | 24 | } 25 | 26 | @property (assign, nonatomic) BOOL handleRefCount; 27 | @property (assign, nonatomic) long long fileMode; 28 | @property (assign) BOOL autoMount; 29 | @property (nonatomic) BOOL quarantine; 30 | 31 | -(id)initWithURL:(NSURL * _Nonnull)arg1 error:(NSError ** _Nonnull)arg2 SWIFT_THROWS; 32 | -(BOOL)autoMount; 33 | -(long long)fileMode; 34 | -(void)setFileMode:(long long)arg1 ; 35 | -(void)setAutoMount:(BOOL)arg1 ; 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | 40 | #endif /* DIAttachParams_h */ 41 | -------------------------------------------------------------------------------- /Sources/CFrameworks/DiskImages2/DiskImages2.tbd: -------------------------------------------------------------------------------- 1 | --- !tapi-tbd 2 | tbd-version: 4 3 | targets: [ x86_64-macos, arm64-macos, arm64e-macos, armv7-ios, armv7s-ios, arm64-ios, arm64e-ios ] 4 | install-name: '/System/Library/PrivateFrameworks/DiskImages2.framework/Versions/A/DiskImages2' 5 | current-version: 272 6 | exports: 7 | - targets: [ x86_64-macos, arm64-macos, arm64e-macos, armv7-ios, armv7s-ios, arm64-ios, arm64e-ios ] 8 | symbols: [ ] 9 | objc-classes: [ DIAttachParams, DIAttachedDeviceInfo, DIBaseParams, DIBlockDevice, 10 | DICommonAttach, DIConvertParams, DICreateASIFParams, DICreateParams, 11 | DICreateRAWParams, DICreateUDSBParams, DIDeviceHandle, DIDiskArb, 12 | DIError, DIHelpers, DIIOIterator, DIIOMedia, DIIOObject, DIImageInfoParams, 13 | DIResizeParams, DIStackParams, DIStatsParams, DIURL, DIUserDataParams, 14 | DIVerifyParams, DiskImageGraph, DiskImages2 ] 15 | ... 16 | -------------------------------------------------------------------------------- /Sources/CFrameworks/MediaPlayer/MPArtworkColorAnalyzer.h: -------------------------------------------------------------------------------- 1 | // 2 | // MPArtworkColorAnalyzer.h 3 | // 4 | // 5 | // Created by Serena on 09/11/2022 6 | // 7 | 8 | 9 | #ifndef MPArtworkColorAnalyzer_h 10 | #define MPArtworkColorAnalyzer_h 11 | 12 | #if __has_include() 13 | @import MediaPlayer; 14 | 15 | #include "MPArtworkColorAnalysis.h" 16 | 17 | @class MPArtworkColorAnalyzer; // needed for the typede 18 | 19 | typedef void (^AnalyzerReturnBlock)(MPArtworkColorAnalyzer * _Null_unspecified, MPArtworkColorAnalysis * _Null_unspecified); 20 | 21 | @interface MPArtworkColorAnalyzer : NSObject { 22 | 23 | long long _algorithm; 24 | UIImage* _image; 25 | 26 | } 27 | 28 | @property (nonatomic,readonly) long long algorithm; 29 | 30 | -(long long)algorithm; 31 | -(_Nonnull instancetype)initWithImage:(UIImage * _Nonnull)arg1 algorithm:(long long)arg2 ; 32 | -(void)analyzeWithCompletionHandler:(AnalyzerReturnBlock _Nonnull)arg1 ; 33 | @end 34 | 35 | #endif 36 | 37 | 38 | #endif /* MPArtworkColorAnalyzer_h */ 39 | -------------------------------------------------------------------------------- /Sources/CFrameworks/module.modulemap: -------------------------------------------------------------------------------- 1 | module LaunchServicesBridge { 2 | header "LaunchServices/LaunchServices.h" 3 | export * 4 | } 5 | 6 | module CoreUIBridge { 7 | header "CoreUI/CoreUI.h" 8 | export * 9 | } 10 | 11 | module NSTaskBridge { 12 | header "NSTask/NSTask.h" 13 | export * 14 | } 15 | 16 | module libarchiveBridge { 17 | header "libarchive/libarchive.h" 18 | export * 19 | } 20 | 21 | // there are 2 seperate DiskImages 2 modules 22 | // reason being: we want to expose only *one* of them publicly 23 | // being the DiskImages2Parameters module, which is exported with `@_exported` import 24 | // in the DiskImagesWrapper module 25 | module DiskImages2Parameters { 26 | header "DiskImages2/DIAttachParams.h" 27 | export * 28 | } 29 | 30 | module DiskImages2Bridge { 31 | header "DiskImages2/DiskImages2.h" 32 | export * 33 | } 34 | 35 | module CoreSVGBridge { 36 | header "CoreSVG/CoreSVG.h" 37 | export * 38 | } 39 | 40 | module MediaPlayerPrivate { 41 | header "MediaPlayer/MediaPlayerPrivate.h" 42 | export * 43 | } 44 | -------------------------------------------------------------------------------- /Sources/CFrameworks/MediaPlayer/MPArtworkColorAnalysis.h: -------------------------------------------------------------------------------- 1 | // 2 | // MPArtworkColorAnalysis.h 3 | // 4 | // 5 | // Created by Serena on 09/11/2022 6 | // 7 | 8 | 9 | #ifndef MPArtworkColorAnalysis_h 10 | #define MPArtworkColorAnalysis_h 11 | 12 | #if __has_include() 13 | @import UIKit; 14 | 15 | @interface MPArtworkColorAnalysis : NSObject { 16 | 17 | UIColor* _backgroundColor; 18 | BOOL _backgroundColorLight; 19 | UIColor* _primaryTextColor; 20 | BOOL _primaryTextColorLight; 21 | UIColor* _secondaryTextColor; 22 | BOOL _secondaryTextColorLight; 23 | 24 | } 25 | 26 | @property (nonatomic,readonly) UIColor *primaryTextColor; 27 | @property (nonatomic,readonly) UIColor *secondaryTextColor; 28 | @property (nonatomic,readonly) UIColor *backgroundColor; 29 | 30 | @property (getter=isPrimaryTextColorLight, nonatomic, readonly) BOOL primaryTextColorLight; 31 | @property (getter=isSecondaryTextColorLight, nonatomic, readonly) BOOL secondaryTextColorLight; 32 | @property (getter=isBackgroundColorLight, nonatomic, readonly) BOOL backgroundColorLight; 33 | @end 34 | #endif 35 | 36 | #endif /* MPArtworkColorAnalysis_h */ 37 | -------------------------------------------------------------------------------- /Sources/CFrameworks/CoreSVG/CoreSVG.h: -------------------------------------------------------------------------------- 1 | // 2 | // CoreSVG.h 3 | // 4 | // 5 | // Created by Serena on 29/10/2022 6 | // 7 | 8 | 9 | #define HAS_UIKIT __has_include() 10 | 11 | #if HAS_UIKIT 12 | @import UIKit.UIImage; 13 | #else 14 | @import CoreGraphics; 15 | #endif 16 | 17 | #ifndef CoreSVG_h 18 | #define CoreSVG_h 19 | 20 | struct CGSVGDocument; 21 | 22 | typedef struct CGSVGDocument *CGSVGDocumentRef; 23 | 24 | CGSVGDocumentRef CGSVGDocumentCreateFromData(CFDataRef, CFDictionaryRef); 25 | CGSVGDocumentRef CGSVGDocumentRetain(struct CGSVGDocument); 26 | 27 | CGSize CGSVGDocumentGetCanvasSize(CGSVGDocumentRef); 28 | 29 | void CGSVGDocumentRelease(CGSVGDocumentRef); 30 | void CGContextDrawSVGDocument(CGContextRef, CGSVGDocumentRef); 31 | 32 | int CGSVGDocumentWriteToURL(CGSVGDocumentRef, CFURLRef, CFDictionaryRef); 33 | int CGSVGDocumentWriteToData(CGSVGDocumentRef, CFDataRef, CFDictionaryRef); 34 | 35 | #if HAS_UIKIT 36 | // UIImage init from a SVG doc 37 | @interface UIImage (CoreSVGPrivate) 38 | +(instancetype)_imageWithCGSVGDocument:(struct CGSVGDocument *)arg0 NS_SWIFT_NAME(init(svgDocument:)); 39 | +(instancetype)_imageWithCGSVGDocument:(struct CGSVGDocument *)arg0 scale:(CGFloat)arg1 orientation:(UIImageOrientation)arg2 40 | NS_SWIFT_NAME(init(svgDocument:scale:orientation:)); 41 | @end 42 | #endif 43 | 44 | #endif /* CoreSVG_h */ 45 | -------------------------------------------------------------------------------- /Sources/CFrameworks/CoreUI/CSIGenerator.h: -------------------------------------------------------------------------------- 1 | // 2 | // CSIGenerator.h 3 | // Santander 4 | // 5 | // Created by Serena on 28/09/2022 6 | // 7 | 8 | 9 | #ifndef CSIGenerator_h 10 | #define CSIGenerator_h 11 | @import Foundation; 12 | #include "CSIBitmapWrapper.h" 13 | 14 | @interface CSIGenerator : NSObject 15 | @property (nonnull, copy, nonatomic) NSString *name; 16 | @property (nonatomic) int blendMode; 17 | @property (nonatomic) short colorSpaceID; 18 | @property (nonatomic) int exifOrientation; 19 | @property (nonatomic) double opacity; 20 | @property (nonatomic) unsigned int scaleFactor; 21 | @property (nonatomic) long long templateRenderingMode; 22 | @property (nullable, copy, nonatomic) NSString *utiType; 23 | @property (nullable, copy, nonatomic) NSArray *colorComponents; 24 | @property (nonatomic) bool isRenditionFPO; 25 | @property (nonatomic, getter=isExcludedFromContrastFilter) bool excludedFromContrastFilter; 26 | @property (nonatomic) bool isVectorBased; 27 | - (void)addBitmap:(CSIBitmapWrapper * _Nonnull)arg1; 28 | - (void)addSliceRect:(struct CGRect)arg1; 29 | - (NSData * _Null_unspecified)CSIRepresentationWithCompression:(bool)arg1; 30 | - (id _Nullable)initWithCanvasSize:(struct CGSize)arg1 sliceCount:(unsigned int)arg2 layout:(short)arg3; 31 | - (id)initWithColorNamed:(id)arg0 colorSpaceID:(NSUInteger)arg1 components:(id)arg2 ; 32 | @end 33 | 34 | 35 | #endif /* CSIGenerator_h */ 36 | -------------------------------------------------------------------------------- /Sources/DiskImagesWrapper/DeviceHandle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DeviceHandle.swift 3 | // 4 | // 5 | // Created by Serena on 24/10/2022 6 | // 7 | 8 | 9 | import Foundation 10 | import DiskImages2Bridge 11 | 12 | /// A type describing info of a device handle, returned after a disk image has been attached 13 | public struct DeviceHandle: Codable, Hashable, CustomStringConvertible { 14 | 15 | /// The name of the attached device, known as the "BSD Name" in DiskImages2 16 | public let name: String 17 | 18 | /// The ID of the device attached in the IOKit Registry Entry, 19 | /// see functions prefixed with `IORegistryEntry` on https://developer.apple.com/documentation/iokit/iokitlib_h 20 | public let registryEntryID: UInt 21 | 22 | public let handlesRefCount: Bool 23 | 24 | /// The path to this handle, on disk 25 | /// Note: this path may or may not exist on disk, please check for if it does before using. 26 | public let deviceHandlePath: URL 27 | 28 | public var description: String { 29 | return "Name: \(name), Full Path (unverified): \(deviceHandlePath.path), Registry Entry ID: \(registryEntryID)" 30 | } 31 | 32 | internal init(_ diDeviceHandle: DIDeviceHandle) { 33 | self.name = diDeviceHandle.bsdName 34 | self.registryEntryID = diDeviceHandle.regEntryID 35 | self.handlesRefCount = diDeviceHandle.handleRefCount 36 | 37 | self.deviceHandlePath = URL(fileURLWithPath: "/dev").appendingPathComponent(name) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Sources/CFrameworks/CoreUI/CUICommonAssetStorage.h: -------------------------------------------------------------------------------- 1 | // 2 | // CUICommonAssetStorage.h 3 | // Santander 4 | // 5 | // Created by Serena on 25/09/2022 6 | // 7 | 8 | 9 | #ifndef CUICommonAssetStorage_h 10 | #define CUICommonAssetStorage_h 11 | @import Foundation; 12 | #include "structs.h" 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | @interface CUICommonAssetStorage : NSObject 16 | - (NSArray *)allAssetKeys; 17 | - (NSArray *)allRenditionNames; 18 | - (NSData *)assetForKey:(NSData *)arg1; 19 | - (void)enumerateKeysAndObjectsUsingBlock:(void (^)(struct renditionkeytoken *keyList, NSData *csiData))block; 20 | - (long long)maximumRenditionKeyTokenCount; 21 | - (instancetype _Nullable)initWithPath:(NSString *)arg1 forWriting:(bool)arg2; 22 | 23 | - (const char *)mainVersionString; 24 | - (const char *)versionString; 25 | 26 | - (long long)storageTimestamp; 27 | - (long long)_storagefileTimestamp; 28 | - (unsigned int)schemaVersion; 29 | - (unsigned int)coreuiVersion; 30 | - (unsigned int)storageVersion; 31 | - (NSUUID *)uuid; 32 | 33 | - (NSString *)thinningArguments; 34 | - (NSString *)deploymentPlatform; 35 | - (NSString *)deploymentPlatformVersion; 36 | - (NSString *)authoringTool; 37 | @end 38 | 39 | @interface CUIMutableCommonAssetStorage : CUICommonAssetStorage 40 | - (void)setColor:(struct rgbquad)arg1 forName:(char *)arg2 excludeFromFilter:(bool)arg3; 41 | - (bool)setAsset:(NSData *)arg1 forKey:(NSData *)arg2; 42 | - (void)removeAssetForKey:(id)arg0; 43 | - (bool)writeToDiskAndCompact:(bool)arg1 NS_SWIFT_NAME(writeToDisk(compact:)); 44 | @end 45 | 46 | NS_ASSUME_NONNULL_END 47 | 48 | #endif /* CUICommonAssetStorage_h */ 49 | -------------------------------------------------------------------------------- /Sources/AssetCatalogWrapper/CodableExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CodableExtensions.swift 3 | // 4 | // 5 | // Created by Serena on 17/10/2022 6 | // 7 | 8 | #if canImport(UIKit) 9 | import UIKit 10 | public typealias PlatformColor = UIColor 11 | #elseif canImport(AppKit) 12 | import AppKit 13 | public typealias PlatformColor = NSColor 14 | #endif 15 | 16 | import CoreUIBridge 17 | import UniformTypeIdentifiers 18 | 19 | public struct CodableRendition: Codable { 20 | public var renditionName: String 21 | public var itemData: Data? 22 | 23 | public init(_ rendition: Rendition) { 24 | self.renditionName = rendition.cuiRend.name() 25 | 26 | if let image = rendition.image { 27 | #if canImport(UIKit) 28 | let uiImage = UIImage(cgImage: image) 29 | switch (rendition.cuiRend.name() as NSString).lastPathComponent { 30 | case "png": 31 | self.itemData = uiImage.pngData() 32 | default: 33 | self.itemData = uiImage.jpegData(compressionQuality: 1.0) 34 | } 35 | 36 | #elseif canImport(AppKit) 37 | self.itemData = NSImage(cgImage: image, size: CGSize(width: image.width, height: image.height)).tiffRepresentation 38 | #endif 39 | 40 | 41 | } else if let rawData = rendition.cuiRend.srcData { 42 | self.itemData = rawData 43 | } else { self.itemData = nil } 44 | } 45 | 46 | } 47 | 48 | public extension Array where Element == Rendition { 49 | func toCodable() -> [CodableRendition] { 50 | return map { rend in 51 | CodableRendition(rend) 52 | } 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /Tests/DiskImagesTests/Tests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Tests.swift 3 | // 4 | // 5 | // Created by Serena on 24/10/2022 6 | // 7 | 8 | 9 | import XCTest 10 | @testable import DiskImagesWrapper 11 | 12 | class Tests: XCTestCase { 13 | var handleForAttachedDiskImage: DeviceHandle? = nil 14 | 15 | func testAttachDiskImage() throws { 16 | let diskImagePath = try getEnv("DISK_IMAGE_TO_ATTACH_FULL_PATH") 17 | let diskImageURL = URL(fileURLWithPath: diskImagePath) 18 | 19 | let handle = try DiskImages.shared.attachDiskImage(with: AttachParameters(itemURL: diskImageURL)) 20 | print(handle) // print handle description 21 | XCTAssert(FileManager.default.fileExists(atPath: handle.deviceHandlePath.path), "Device handle path does NOT exist.") // make sure the handle path exists 22 | handleForAttachedDiskImage = handle 23 | } 24 | 25 | } 26 | 27 | extension Tests { 28 | func getEnv(_ name: String) throws -> String { 29 | guard let envValue = getenv(name) else { 30 | throw Errors.envVarDoesntExist(name: name) 31 | } 32 | 33 | return String(cString: envValue) 34 | } 35 | 36 | enum Errors: Error, LocalizedError { 37 | case envVarDoesntExist(name: String) 38 | case other(description: String) 39 | 40 | var errorDescription: String? { 41 | switch self { 42 | case .envVarDoesntExist(let name): 43 | return "Enviroment variable \(name) doesn't exist, please set it through Xcode." 44 | case .other(let description): 45 | return description 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Sources/CFrameworks/CoreUI/CUIRenditionKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // CUIRenditionKey.h 3 | // Santander 4 | // 5 | // Created by Serena on 29/09/2022 6 | // 7 | 8 | 9 | #ifndef CUIRenditionKey_h 10 | #define CUIRenditionKey_h 11 | @import Foundation; 12 | 13 | @interface CUIRenditionKey : NSObject 14 | - (const struct renditionkeytoken *)keyList; 15 | - (id)initWithKeyList:(const struct renditionkeytoken *)keyList; 16 | 17 | @property(nonatomic) long long themeElement; 18 | @property(nonatomic) long long themePart; 19 | @property(nonatomic) long long themeSize; 20 | @property(nonatomic) long long themeDirection; 21 | @property(nonatomic) long long themeValue; 22 | @property(nonatomic) long long themeAppearance; 23 | @property(nonatomic) long long themeDimension1; 24 | @property(nonatomic) long long themeDimension2; 25 | @property(nonatomic) long long themeState; 26 | @property(nonatomic) long long themeLayer; 27 | @property(nonatomic) long long themeScale; 28 | @property(nonatomic) long long themeLocalization; 29 | @property(nonatomic) long long themePresentationState; 30 | @property(nonatomic) long long themeIdiom; 31 | @property(nonatomic) long long themeSubtype; 32 | @property(nonatomic) long long themeIdentifier; 33 | @property(nonatomic) long long themePreviousState; 34 | @property(nonatomic) long long themePreviousValue; 35 | @property(nonatomic) long long themeSizeClassHorizontal; 36 | @property(nonatomic) long long themeSizeClassVertical; 37 | @property(nonatomic) long long themeMemoryClass; 38 | @property(nonatomic) long long themeGraphicsClass; 39 | @property(nonatomic) long long themeDisplayGamut; 40 | @property(nonatomic) long long themeDeploymentTarget; 41 | @property(nonatomic) long long themeGlyphWeight; 42 | @property(nonatomic) long long themeGlyphSize; 43 | 44 | @end 45 | 46 | #endif /* CUIRenditionKey_h */ 47 | -------------------------------------------------------------------------------- /Sources/CFrameworks/LaunchServices/LaunchServices.h: -------------------------------------------------------------------------------- 1 | // 2 | // LaunchServicesPrivate.h 3 | // Santander 4 | // 5 | // Created by Serena on 15/08/2022. 6 | // 7 | 8 | #ifndef LaunchServicesPrivate_h 9 | #define LaunchServicesPrivate_h 10 | 11 | #define UIKIT_AVAILABLE __has_include() 12 | 13 | #if UIKIT_AVAILABLE 14 | @import UIKit; 15 | #elif __has_include() 16 | @import AppKit; 17 | #endif 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | @interface LSApplicationProxy 22 | @property (readonly, nonatomic) NSString *applicationType; 23 | 24 | @property (getter=isBetaApp, readonly, nonatomic) BOOL betaApp; 25 | @property (getter=isDeletable, readonly, nonatomic) BOOL deletable; 26 | @property (getter=isRestricted, readonly, nonatomic) BOOL restricted; 27 | @property (getter=isContainerized, readonly, nonatomic) BOOL containerized; 28 | @property (getter=isAdHocCodeSigned, readonly, nonatomic) BOOL adHocCodeSigned; 29 | @property (getter=isAppStoreVendable, readonly, nonatomic) BOOL appStoreVendable; 30 | @property (getter=isLaunchProhibited, readonly, nonatomic) BOOL launchProhibited; 31 | 32 | @property (readonly, nonatomic) NSSet *claimedURLSchemes; 33 | @property (readonly, nonatomic) NSString *teamID; 34 | @property (copy, nonatomic) NSString *sdkVersion; 35 | @property (readonly, nonatomic) NSDictionary *entitlements; 36 | @property (readonly, nonatomic) NSURL* _Nullable bundleContainerURL; 37 | 38 | + (LSApplicationProxy*)applicationProxyForIdentifier:(id)identifier; 39 | - (NSString *)applicationIdentifier; 40 | - (NSURL *)containerURL; 41 | - (NSURL *)bundleURL; 42 | - (NSString *)localizedName; 43 | - (NSData *)iconDataForVariant:(id)variant; 44 | - (NSData *)iconDataForVariant:(id)variant withOptions:(id)options; 45 | @end 46 | 47 | 48 | @interface LSApplicationWorkspace 49 | + (instancetype) defaultWorkspace; 50 | - (NSArray *)allInstalledApplications; 51 | - (NSArray *)allApplications; 52 | - (BOOL)openApplicationWithBundleID:(NSString *)arg0 ; 53 | - (BOOL)uninstallApplication:(NSString *)arg0 withOptions:(_Nullable id)arg1 error:(NSError **)arg2 usingBlock:(_Nullable id)arg3; 54 | @end 55 | 56 | #if UIKIT_AVAILABLE 57 | @interface UIImage (Private) 58 | + (instancetype)_applicationIconImageForBundleIdentifier:(NSString*)bundleIdentifier format:(int)format scale:(CGFloat)scale; 59 | @end 60 | #endif 61 | 62 | NS_ASSUME_NONNULL_END 63 | 64 | #endif /* LaunchServicesPrivate_h */ 65 | -------------------------------------------------------------------------------- /Sources/CFrameworks/NSTask/NSTask.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSTask.h 3 | // Santander 4 | // 5 | // Created by Serena on 06/09/2022 6 | // 7 | 8 | #include 9 | @import Darwin; 10 | 11 | #if !defined(NSTask_h) 12 | #define NSTask_h 13 | 14 | #if (TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST) 15 | @import Foundation; 16 | 17 | NS_ASSUME_NONNULL_BEGIN 18 | 19 | @interface NSTask : NSObject 20 | 21 | @property (copy) NSArray *arguments; 22 | @property (copy) NSURL *currentDirectoryURL; 23 | @property (copy) NSDictionary *environment; 24 | @property (copy) NSURL *executableURL; 25 | @property (readonly) int processIdentifier; 26 | @property NSInteger qualityOfService; 27 | @property (getter=isRunning, readonly) BOOL running; 28 | @property (retain) NSPipe *standardError; 29 | @property (retain) id standardInput; 30 | @property (retain) NSPipe *standardOutput; 31 | @property(copy) void (^terminationHandler)(NSTask *); 32 | @property (readonly) NSInteger terminationReason; 33 | @property (readonly) int terminationStatus; 34 | 35 | 36 | +(id)allocWithZone:(struct _NSZone *)arg0 ; 37 | +(id)currentTaskDictionary; 38 | +(id)launchedTaskWithDictionary:(id)arg0 ; 39 | -(BOOL)isSpawnedProcessDisclaimed; 40 | -(BOOL)resume; 41 | -(BOOL)suspend; 42 | -(NSInteger)suspendCount; 43 | -(BOOL)launchAndReturnError:(out NSError * _Nullable *)error; 44 | -(id)currentDirectoryPath; 45 | -(id)init; 46 | -(id)launchPath; 47 | -(void)waitUntilExit; 48 | -(void)interrupt; 49 | -(void)launch; 50 | -(void)setCurrentDirectoryPath:(id)arg0 ; 51 | -(void)setLaunchPath:(id)arg0 ; 52 | -(void)setSpawnedProcessDisclaimed:(BOOL)arg0 ; 53 | -(void)terminate; 54 | 55 | @end 56 | 57 | NS_ASSUME_NONNULL_END 58 | 59 | // MARK: - Posix Spawn stuff 60 | // these aren't available in the public SDK (for iOS), so we define them here 61 | 62 | #define POSIX_SPAWN_PERSONA_FLAGS_OVERRIDE 1 63 | #pragma clang diagnostic push 64 | #pragma clang diagnostic ignored "-Wnullability-completeness" // shut the hell up about nullability specification 65 | int posix_spawnattr_set_persona_np(const posix_spawnattr_t* __restrict, uid_t, uint32_t); 66 | int posix_spawnattr_set_persona_uid_np(const posix_spawnattr_t* __restrict, uid_t); 67 | int posix_spawnattr_set_persona_gid_np(const posix_spawnattr_t* __restrict, uid_t); 68 | #pragma clang diagnostic pop 69 | #endif 70 | 71 | #pragma clang diagnostic push 72 | #pragma clang diagnostic ignored "-Wnullability-completeness" 73 | int proc_pidpath(pid_t pid, void *buffer, uint32_t buffersize); 74 | #pragma clang diagnostic pop 75 | 76 | #endif /* NSTask_h */ 77 | -------------------------------------------------------------------------------- /Sources/DiskImagesWrapper/Parameters.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Parameters.swift 3 | // 4 | // 5 | // Created by Serena on 24/10/2022 6 | // 7 | 8 | 9 | import Foundation 10 | import DiskImages2Bridge 11 | 12 | /// A Protocol which where a type implements a method for creating parameters to pass in when attaching a Disk Image. 13 | /// For a default implementation, see the ``AttachParameters`` struct. 14 | public protocol AttachParametersProtocol { 15 | /// Creates the Disk Images Attach Parameters to pass into the function to attach 16 | func createDIParams() throws -> DIAttachParams 17 | } 18 | 19 | /// A type which describes the basic parameters when attaching a disk image 20 | public struct AttachParameters: Codable, Hashable, AttachParametersProtocol { 21 | /// The URL of the Disk Image to attach 22 | public var itemURL: URL 23 | 24 | /// The file mode to use when attaching. 25 | public var fileMode: FileMode 26 | 27 | /// A Boolean value describing if DiskImages2 should auto mount the disk image, the effects of this are unknown. 28 | public var doAutoMount: Bool? 29 | 30 | /// A Boolean value describing if DiskImages2 should handle reference counting, the effects of this are unknown. 31 | public var handleRefCount: Bool? 32 | 33 | public func createDIParams() throws -> DIAttachParams { 34 | let params = try DIAttachParams(url: itemURL) 35 | params.fileMode = fileMode.rawValue 36 | 37 | // if doAutoMount and/or handleRefCount are nil, 38 | // default to the parameter's default values 39 | params.autoMount = doAutoMount ?? params.autoMount 40 | params.handleRefCount = handleRefCount ?? params.handleRefCount 41 | 42 | return params 43 | } 44 | 45 | public init(itemURL: URL, fileMode: FileMode = .normal, doAutoMount: Bool? = nil, handleRefCount: Bool? = nil) { 46 | self.itemURL = itemURL 47 | self.fileMode = fileMode 48 | self.doAutoMount = doAutoMount 49 | self.handleRefCount = handleRefCount 50 | } 51 | 52 | public enum FileMode: Codable, Hashable { 53 | /// The normal file mode, you most probably want to use this. 54 | case normal 55 | 56 | /// Make sure that the disk image can be read and written to, 57 | /// this will fail on read-only Disk Images 58 | case forceReadWrite 59 | 60 | /// Another file mode, described by the given `fileModeNumber` parameter. 61 | case other(fileModeNumber: CLongLong) 62 | 63 | public var rawValue: CLongLong { 64 | switch self { 65 | case .normal: 66 | return 0 67 | case .forceReadWrite: 68 | return 3 69 | case .other(let fileModeNum): 70 | return fileModeNum 71 | } 72 | } 73 | } 74 | } 75 | 76 | -------------------------------------------------------------------------------- /Tests/FSOperationsTests/Tests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Tests.swift 3 | // 4 | // 5 | // Created by Serena on 18/10/2022 6 | // 7 | 8 | 9 | @testable import FSOperations 10 | import AssetCatalogWrapper 11 | import XCTest 12 | 13 | // todo: more tests? 14 | class FSOperationTests: XCTestCase { 15 | let tmpDir = URL(fileURLWithPath: NSTemporaryDirectory()) 16 | let homeDir = URL(fileURLWithPath: NSHomeDirectory()) 17 | 18 | lazy var filesToManage = ["file 1", "file 2", Bundle.main.bundleIdentifier!].map { fileName in 19 | tmpDir.appendingPathComponent(fileName) 20 | } 21 | 22 | lazy var directoriesToManage = ["Directory1", "Directory2", Int.random(in: 1...100).description].map { directoryName in 23 | tmpDir.appendingPathComponent(directoryName) 24 | } 25 | 26 | func testInOrder() throws { 27 | try testCreatePaths() 28 | try testCreateSymlinks() 29 | try testRemovePaths() 30 | } 31 | 32 | func testCreatePaths() throws { 33 | filesToManage.printPaths() 34 | try FSOperation.perform(.createFile(files: filesToManage), rootHelperConf: nil) 35 | try ensurePathsExist(filesToManage) 36 | 37 | directoriesToManage.printPaths() 38 | try FSOperation.perform(.createDirectory(directories: directoriesToManage), rootHelperConf: nil) 39 | try ensurePathsExist(directoriesToManage) 40 | } 41 | 42 | func testRemovePaths() throws { 43 | try ensurePathsExist(filesToManage) 44 | try ensurePathsExist(directoriesToManage) 45 | 46 | try FSOperation.perform(.removeItems(items: filesToManage), rootHelperConf: nil) 47 | try FSOperation.perform(.removeItems(items: directoriesToManage), rootHelperConf: nil) 48 | } 49 | 50 | func testCreateSymlinks() throws { 51 | try ensurePathsExist(filesToManage) 52 | 53 | try FSOperation.perform(.symlink(items: filesToManage, resultPath: homeDir), rootHelperConf: nil) 54 | } 55 | } 56 | 57 | extension FSOperationTests { 58 | func ensurePathsExist(_ paths: [URL]) throws { 59 | let pathsThatDontExist = paths.filter { path in 60 | return !FileManager.default.fileExists(atPath: path.path) 61 | } 62 | 63 | if !pathsThatDontExist.isEmpty { 64 | throw StringError("ERROR: Paths \(pathsThatDontExist) are supposed to exist, BUT DON'T!") 65 | } 66 | } 67 | } 68 | 69 | extension Array where Element == URL { 70 | func printPaths(seperator: String = ", ") { 71 | print(map(\.path).joined(separator: seperator)) 72 | } 73 | } 74 | 75 | internal struct StringError: Error, LocalizedError, CustomStringConvertible { 76 | var description: String 77 | init(_ description: String) { 78 | self.description = description 79 | } 80 | 81 | var errorDescription: String? { 82 | return description 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Sources/CFrameworks/CoreUI/CUIThemeRendition.h: -------------------------------------------------------------------------------- 1 | // 2 | // CUIThemeRendition.h 3 | // Santander 4 | // 5 | // Created by Serena on 16/09/2022 6 | // 7 | 8 | 9 | #ifndef CUIThemeRendition_h 10 | #define CUIThemeRendition_h 11 | 12 | #define HAS_CORE_SVG __has_include("../CoreSVG/CoreSVG.h") 13 | 14 | @import CoreGraphics; 15 | 16 | #include "structs.h" 17 | #include "CUIRenditionKey.h" 18 | 19 | #if HAS_CORE_SVG 20 | # include "../CoreSVG/CoreSVG.h" 21 | #endif 22 | 23 | #pragma clang diagnostic push 24 | // for the `Pointer is missing a nullability type specifier` warnings: 25 | #pragma clang diagnostic ignored "-Wnullability-completeness" 26 | 27 | typedef NS_ENUM(NSInteger, CUIBitmapEncoding) { 28 | CUIBitmapEncodingNone = 0, 29 | CUIBitmapEncodingRLE = 1, 30 | CUIBitmapEncodingZIP = 2, 31 | CUIBitmapEncodingLZVN= 3, 32 | CUIBitmapEncodingLZFSE = 4, 33 | CUIBitmapEncodingJPEG_LZFSE = 5, 34 | CUIBitmapEncodingBlurred = 6, 35 | CUIBitmapEncodingASTC = 7, 36 | CUIBitmapEncodingPaletteImg = 8, 37 | CUIBitmapEncodingHEVC = 9, 38 | CUIBitmapEncodingDeepmapLZFSE = 10, 39 | CUIBitmapEncodingDeepmap2 = 11, 40 | CUIBitmapEncodingDXTC = 12, 41 | }; 42 | 43 | @interface CUIThemeRendition : NSObject 44 | @property(nonatomic) long long type; 45 | @property(nonatomic) unsigned int subtype; 46 | @property(nonatomic) int blendMode; 47 | @property(nonatomic) int exifOrientation; 48 | @property(nonatomic) double opacity; 49 | @property(readonly, nonatomic) NSData *srcData; 50 | //@property (nonatomic) NSInteger type; 51 | 52 | - (struct renditionkeytoken *)key; 53 | - (NSString * _Nonnull)name; 54 | - (unsigned long long)colorSpaceID; 55 | - (double)scale; 56 | - (NSDictionary *)properties; 57 | - (long long)templateRenderingMode; 58 | - (NSString * _Nullable)utiType; 59 | - (bool)isHeaderFlaggedFPO; 60 | - (struct cuithemerenditionrenditionflags *)renditionFlags; 61 | - (bool)isVectorBased; 62 | - (int)pixelFormat; 63 | - (bool)isInternalLink; 64 | - (CUIRenditionKey *)linkingToRendition; 65 | #if HAS_CORE_SVG 66 | - (CGSVGDocumentRef _Nullable)svgDocument; 67 | #endif 68 | - (struct CGRect)_destinationFrame; 69 | - (CGImageRef _Nullable)uncroppedImage; 70 | - (CGImageRef _Nullable)unslicedImage; 71 | - (CGColorRef)cgColor; 72 | - (bool)substituteWithSystemColor; 73 | - (NSString *)systemColorName; 74 | - (CGImageRef)createImageFromPDFRenditionWithScale:(double)arg1; 75 | - (CGPDFDocumentRef _Nullable)pdfDocument; 76 | - (struct CGSize)unslicedSize; 77 | - (_Nonnull id)initWithCSIData:(NSData *)arg1 forKey:(const struct renditionkeytoken *)arg2; 78 | - (_Nullable id)initWithCSIData:(NSData *)csidata forKey:(const struct renditionkeytoken *)key version:(unsigned int)version; 79 | - (NSData *)data; // Null if the classForCoder isn't _CUIRawDataRendition 80 | - (NSString *)utiType; 81 | - (CUIBitmapEncoding)bitmapEncoding; 82 | @end 83 | 84 | 85 | @interface _CUIThemeSVGRendition : CUIThemeRendition 86 | - (NSData *)rawData; 87 | @end 88 | 89 | /* 90 | @interface _CUIRawDataRendition : CUIThemeRendition 91 | - (id)data; 92 | @end 93 | */ 94 | 95 | #pragma clang diagnostic pop 96 | 97 | #endif /* CUIThemeRendition_h */ 98 | -------------------------------------------------------------------------------- /Tests/CompressionTests/Tests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Tests.swift 3 | // 4 | // 5 | // Created by Serena on 21/10/2022 6 | // 7 | 8 | @testable import CompressionWrapper 9 | import libarchiveBridge 10 | import XCTest 11 | 12 | class CompressionTests: XCTestCase { 13 | let currentFileURL = URL(fileURLWithPath: #file) 14 | 15 | func testExtraction() throws { 16 | let fileToExtract = URL(fileURLWithPath: try getEnv("FILE_TO_EXTRACT_PATH")) 17 | let destinationURL = currentFileURL.deletingLastPathComponent().appendingPathComponent("Output") 18 | defer { 19 | for content in (try? FileManager.default.contentsOfDirectory(at: destinationURL, includingPropertiesForKeys: [])) ?? [] { 20 | try? FileManager.default.removeItem(at: content) 21 | } 22 | } 23 | 24 | try FileManager.default.createDirectory(at: destinationURL, withIntermediateDirectories: true) 25 | 26 | try Compression.shared.extract(path: fileToExtract, to: destinationURL) 27 | } 28 | 29 | // Test to make sure we get the "Failed to open archive file" when a file doesn't exist 30 | func testExtractionPathDoesntExist() throws { 31 | // this path obviously doesn't exist, so lets try and make sure we get the "failed to open file" 32 | let archiveThatDoesntExist = URL(fileURLWithPath: "/Kendrick/Savior.zip") 33 | let destination = URL(fileURLWithPath: NSTemporaryDirectory()) // nothing'll get archived, so this doesn't matter 34 | 35 | XCTAssertThrowsError(try Compression.shared.extract(path: archiveThatDoesntExist, to: destination)) 36 | } 37 | 38 | func testArchive() throws { 39 | let parentDir = currentFileURL.deletingLastPathComponent() 40 | let paths = [ 41 | parentDir.appendingPathComponent("Tests.swift"), 42 | parentDir.appendingPathComponent("TestFile.swift"), 43 | URL(fileURLWithPath: "/Users/user/Public") 44 | ] 45 | 46 | try Compression.shared.compress(paths: paths, outputPath: parentDir.appendingPathComponent("Output.zip"), format: .tar) 47 | } 48 | 49 | func testBothArchiveAndExtract() throws { 50 | let parentPath = currentFileURL.deletingLastPathComponent() 51 | try testArchive() 52 | try Compression.shared.extract(path: parentPath.appendingPathComponent("Output.zip"), to: parentPath.appendingPathComponent("Output")) 53 | } 54 | 55 | func getEnv(_ variable: String) throws -> String { 56 | guard let value = getenv(variable) else { 57 | throw TestErrors.unableToGetEnv(envVarName: variable) 58 | } 59 | 60 | return String(cString: value) 61 | } 62 | } 63 | 64 | 65 | private enum TestErrors: Error, LocalizedError, CustomStringConvertible { 66 | case unableToGetEnv(envVarName: String) 67 | 68 | var description: String { 69 | switch self { 70 | case .unableToGetEnv(let envVarName): 71 | return "Unable to get enviroment variable \(envVarName)" 72 | } 73 | } 74 | 75 | var errorDescription: String? { 76 | description 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Sources/ApplicationsWrapper/ApplicationsManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ApplicationsManager.swift 3 | // Santander 4 | // 5 | // Created by Serena on 15/08/2022. 6 | // 7 | 8 | #if canImport(UIKit) 9 | import UIKit 10 | #elseif canImport(AppKit) 11 | import AppKit 12 | #endif 13 | 14 | @_exported import LaunchServicesBridge 15 | 16 | /// A Swift Wrapper to manage Applications 17 | public struct ApplicationsManager { 18 | public let allApps: [LSApplicationProxy] 19 | public static let shared = ApplicationsManager(allApps: LSApplicationWorkspace.default().allApplications()) 20 | 21 | public func application(forContainerURL containerURL: URL) -> LSApplicationProxy? { 22 | return allApps.first { app in 23 | app.containerURL() == containerURL 24 | } 25 | } 26 | 27 | public func application(forBundleURL bundleURL: URL) -> LSApplicationProxy? { 28 | return allApps.first { app in 29 | app.bundleURL() == bundleURL 30 | } 31 | } 32 | 33 | public func application(forDataContainerURL dataContainerURL: URL) -> LSApplicationProxy? { 34 | return allApps.first { app in 35 | app.bundleContainerURL == dataContainerURL 36 | } 37 | } 38 | 39 | public func deleteApp(_ app: LSApplicationProxy) throws { 40 | let errorPointer: NSErrorPointer = nil 41 | let didSucceed = LSApplicationWorkspace.default().uninstallApplication(app.applicationIdentifier(), withOptions: nil, error: errorPointer, usingBlock: nil) 42 | if let error = errorPointer?.pointee { 43 | throw error 44 | } 45 | 46 | guard didSucceed else { 47 | throw Errors.unableToUninstallApplication(appBundleID: app.applicationIdentifier()) 48 | } 49 | } 50 | 51 | #if canImport(UIKit) 52 | public func icon(forApplication app: LSApplicationProxy, scale: CGFloat = UIScreen.main.scale) -> UIImage { 53 | return ._applicationIconImage(forBundleIdentifier: app.applicationIdentifier(), format: 1, scale: scale) 54 | } 55 | #elseif canImport(AppKit) 56 | public func icon(forApplication app: LSApplicationProxy) -> NSImage { 57 | return NSWorkspace.shared.icon(forFile: app.bundleURL().path) 58 | } 59 | #endif 60 | 61 | public func openApp(_ app: LSApplicationProxy) throws { 62 | guard LSApplicationWorkspace.default().openApplication(withBundleID: app.applicationIdentifier()) else { 63 | throw Errors.unableToOpenApplication(appBundleID: app.applicationIdentifier()) 64 | } 65 | } 66 | 67 | public enum Errors: Error, LocalizedError { 68 | case unableToOpenApplication(appBundleID: String) 69 | case unableToUninstallApplication(appBundleID: String) 70 | 71 | public var errorDescription: String? { 72 | switch self { 73 | case .unableToOpenApplication(let bundleID): 74 | return "Unable to open Application with Bundle ID \(bundleID)" 75 | case .unableToUninstallApplication(let bundleID): 76 | return "Unable to delete Application with Bundle ID \(bundleID)" 77 | } 78 | } 79 | } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /Sources/SVGWrapper/SVGDocument.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SVGDocument.swift 3 | // 4 | // 5 | // Created by Serena on 29/10/2022 6 | // 7 | 8 | 9 | @_exported 10 | import CoreSVGBridge 11 | import Foundation 12 | 13 | public class SVGDocument { 14 | /// The document represented as a `CGSVGDocumentRef` 15 | public var doc: CGSVGDocumentRef 16 | 17 | /// Whether or not to destroy the document with `CGSVGDocumentRelease` in the deinit. 18 | public var destroyUponDeinitialization: Bool = true 19 | 20 | /// Initializes a new instance with a given `CGSVGDocumentRef` 21 | public init(doc: CGSVGDocumentRef) { 22 | self.doc = doc 23 | } 24 | 25 | /// Initializes a new SVG Document with the given string representation 26 | convenience public init?(string: String) { 27 | guard let data = string.data(using: .utf8) else { return nil } 28 | self.init(data: data) 29 | } 30 | 31 | /// Initializes a new SVG Document with the given SVG file URL 32 | convenience public init(fileURL: URL) throws { 33 | self.init(data: try Data(contentsOf: fileURL)) 34 | } 35 | 36 | 37 | public init(data: Data) { 38 | self.doc = CGSVGDocumentCreateFromData(data as CFData, nil) 39 | } 40 | 41 | #if canImport(UIKit) 42 | public func uiImage(configuration: ImageCreationConfiguration? = nil) -> UIImage { 43 | if let configuration = configuration { 44 | return UIImage(svgDocument: doc, scale: configuration.scale, orientation: configuration.orientation) 45 | } 46 | 47 | return UIImage(svgDocument: doc) 48 | } 49 | 50 | public struct ImageCreationConfiguration: Hashable { 51 | public let scale: CGFloat 52 | public let orientation: UIImage.Orientation 53 | 54 | public init(scale: CGFloat, orientation: UIImage.Orientation) { 55 | self.scale = scale 56 | self.orientation = orientation 57 | } 58 | } 59 | #endif 60 | 61 | public func write(to url: URL) { 62 | CGSVGDocumentWriteToURL(doc, url as CFURL, nil) 63 | } 64 | 65 | /// Writes the SVG Document to a given CGContext 66 | /// 67 | /// - Parameters: 68 | /// - context: The CGContext to write to 69 | public func write(to context: CGContext) { 70 | CGContextDrawSVGDocument(context, doc) 71 | } 72 | 73 | /// A cross platform-compatible representation of this image as a CGImage. 74 | public func cgImage(withSize size: CGSize? = nil) -> CGImage? { 75 | let size = size ?? canvasSize 76 | let context = CGContext(data: nil, 77 | width: Int(ceil(size.width)), 78 | height: Int(ceil(size.height)), 79 | bitsPerComponent: 8, 80 | bytesPerRow: 0, 81 | space: CGColorSpaceCreateDeviceRGB(), 82 | bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue) 83 | CGContextDrawSVGDocument(context, doc) 84 | return context?.makeImage() 85 | } 86 | 87 | /// The size of the document. 88 | public var canvasSize: CGSize { 89 | return CGSVGDocumentGetCanvasSize(doc) 90 | } 91 | 92 | deinit { 93 | if destroyUponDeinitialization { 94 | CGSVGDocumentRelease(doc) 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.5 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | import Foundation 6 | 7 | /// Returns a URL of the sources 8 | func pathInSources(componentToAppend: String) -> URL { 9 | URL(fileURLWithPath: #file) 10 | .deletingLastPathComponent() 11 | .appendingPathComponent("Sources") 12 | .appendingPathComponent(componentToAppend) 13 | } 14 | 15 | let sourcesDirectory = URL(fileURLWithPath: #file) 16 | .deletingLastPathComponent() 17 | .appendingPathComponent("Sources") 18 | 19 | let coreUITBD = sourcesDirectory.appendingPathComponent("CFrameworks/CoreUI/CoreUI.tbd") 20 | let coreUILinkerSetting = LinkerSetting.unsafeFlags([coreUITBD.path]) 21 | 22 | let di2TBD = sourcesDirectory.appendingPathComponent("CFrameworks/DiskImages2/DiskImages2.tbd") 23 | let di2LinkerSetting = LinkerSetting.unsafeFlags([di2TBD.path]) 24 | 25 | let coreSVGTBD = sourcesDirectory.appendingPathComponent("CFrameworks/CoreSVG/CoreSVG.tbd") 26 | let coreSVGLinkerSetting = LinkerSetting.unsafeFlags([coreSVGTBD.path]) 27 | 28 | let package = Package( 29 | name: "PrivateKits", 30 | platforms: [.iOS(.v13), .macOS(.v10_15)], 31 | products: [ 32 | // Products define the executables and libraries a package produces, and make them visible to other packages. 33 | .library(name: "ApplicationsWrapper", targets: ["ApplicationsWrapper"]), 34 | .library(name: "AssetCatalogWrapper", targets: ["AssetCatalogWrapper"]), 35 | .library(name: "FSOperations", targets: ["FSOperations"]), 36 | .library(name: "SVGWrapper", targets: ["SVGWrapper"]), 37 | .library(name: "CompressionWrapper", targets: ["CompressionWrapper"]), 38 | .library(name: "DiskImagesWrapper", targets: ["DiskImagesWrapper"]), 39 | .library(name: "NSTask", targets: ["NSTask"]) 40 | ], 41 | dependencies: [ 42 | // Dependencies declare other packages that this package depends on. 43 | // .package(url: /* package url */, from: "1.0.0"), 44 | ], 45 | targets: [ 46 | // Targets are the basic building blocks of a package. A target can define a module or a test suite. 47 | // Targets can depend on other targets in this package, and on products in packages this package depends on. 48 | .target(name: "ApplicationsWrapper", dependencies: ["CFrameworks"]), 49 | .target(name: "AssetCatalogWrapper", dependencies: ["CFrameworks", "SVGWrapper"], 50 | linkerSettings: [coreUILinkerSetting]), 51 | .target(name: "CompressionWrapper", dependencies: ["CFrameworks"], linkerSettings: [.linkedLibrary("archive")]), 52 | .target(name: "DiskImagesWrapper", dependencies: ["CFrameworks"], linkerSettings: [di2LinkerSetting]), 53 | .target(name: "SVGWrapper", dependencies: ["CFrameworks"], linkerSettings: [coreSVGLinkerSetting]), 54 | 55 | .target(name: "FSOperations", dependencies: ["AssetCatalogWrapper"], linkerSettings: [coreUILinkerSetting]), 56 | .target(name: "NSTask", dependencies: ["CFrameworks"]), 57 | 58 | .testTarget(name: "FSOperationsTests", dependencies: ["FSOperations", "AssetCatalogWrapper"]), 59 | .testTarget(name: "CompressionTests", dependencies: ["CompressionWrapper"]), 60 | .testTarget(name: "DiskImagesTests", dependencies: ["DiskImagesWrapper"]), 61 | 62 | .systemLibrary(name: "CFrameworks", path: nil, pkgConfig: nil, providers: nil) 63 | ] 64 | ) 65 | -------------------------------------------------------------------------------- /Sources/DiskImagesWrapper/DiskImages.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DiskImages.swift 3 | // 4 | // 5 | // Created by Serena on 24/10/2022 6 | // 7 | 8 | 9 | import Foundation 10 | import DiskImages2Bridge 11 | 12 | // export DIAttachParams 13 | @_exported import DiskImages2Parameters 14 | 15 | public class DiskImages { 16 | public static let shared = DiskImages() 17 | 18 | private init() {} 19 | 20 | @discardableResult 21 | /// Attaches a disk image through the given parameters, see the ``AttachParameters`` struct. 22 | public func attachDiskImage(with params: Parameters) throws -> DeviceHandle { 23 | let diParams: DIAttachParams 24 | do { 25 | diParams = try params.createDIParams() 26 | } catch { 27 | throw Errors.failedToCreateParameters(errorEncountered: error) 28 | } 29 | 30 | var diHandle: DIDeviceHandle? = nil 31 | try DiskImages2.attach(with: diParams, handle: &diHandle) 32 | guard let diHandle = diHandle else { 33 | throw Errors.noHandlerReturned 34 | } 35 | 36 | return DeviceHandle(diHandle) 37 | } 38 | 39 | /// Returns the disk image URL of an attached device 40 | /// ie, if /dev/disk7 was originally attached from DMG at /var/mobile/random.dmg 41 | /// then calling `diskimageURL(ofDeviceAt: URL(fileURLWithPath: "/dev/disk7")` 42 | /// would return 43 | public func diskImageURL(ofDeviceAt deviceURL: URL) throws -> URL { 44 | return try DiskImages2.imageURL(fromDevice: deviceURL) 45 | } 46 | 47 | /// Detach (aka eject) a device at the given URL 48 | public func detachDevice(at deviceURL: URL) throws { 49 | try deviceURL.withUnsafeFileSystemRepresentation { fsRep in 50 | guard let fsRep = fsRep else { 51 | throw Errors.failedToGenerateFSRepresentation(path: deviceURL) 52 | } 53 | 54 | let fd = open(fsRep, O_RDONLY) 55 | guard fd != -1 else { 56 | throw Errors.failedToOpenDevice(deviceURL: deviceURL) 57 | } 58 | 59 | defer { close(fd) } 60 | 61 | let ejectCode = _ioctlRequestCode(forGroup: "d", number: 21) 62 | let ioctlReturnCode = ioctl(fd, ejectCode) 63 | guard ioctlReturnCode != -1 else { 64 | throw Errors.failedToDetachDevice(deviceURL: deviceURL) 65 | } 66 | } 67 | } 68 | 69 | private func _ioctlRequestCode(forGroup group: Character, number: UInt) -> UInt { 70 | let void = UInt(IOC_VOID) 71 | let g = UInt(group.asciiValue!) << 8 72 | return void | g | number 73 | } 74 | } 75 | 76 | 77 | extension DiskImages { 78 | // MARK: - Possible Errors 79 | private enum Errors: Error, LocalizedError, CustomStringConvertible { 80 | case failedToCreateParameters(errorEncountered: Error) 81 | case failedToGenerateFSRepresentation(path: URL) 82 | case failedToOpenDevice(deviceURL: URL) 83 | case failedToDetachDevice(deviceURL: URL) 84 | case noHandlerReturned 85 | 86 | var description: String { 87 | switch self { 88 | case .failedToCreateParameters(let errorEncountered): 89 | return "Error encountered while trying to create parameters to attach disk image: \(errorEncountered.localizedDescription)" 90 | case .failedToGenerateFSRepresentation(let path): 91 | return "Failed to generate file system representation of path \(path.path), could this path be invalid (ie, characters in this path's name are not allowed on this FileSystem)?" 92 | case .failedToOpenDevice(let deviceURL): 93 | return "Failed to open and get file descriptor of device at \(deviceURL.path): \(String(cString: strerror(errno)))" 94 | case .failedToDetachDevice(let deviceURL): 95 | return "Failed to detach (aka eject) device at path \(deviceURL.path): \(String(cString: strerror(errno)))" 96 | case .noHandlerReturned: 97 | return "(Supposedly) attached disk image, however a handler pointing to it was not returned." 98 | } 99 | } 100 | 101 | var errorDescription: String? { 102 | description 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /Sources/FSOperations/FSOperation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FSOperation.swift 3 | // Santander 4 | // 5 | // Created by Serena on 15/09/2022 6 | // 7 | 8 | 9 | import Foundation 10 | import AssetCatalogWrapper 11 | import UniformTypeIdentifiers 12 | 13 | // You may ask, hey, why is this an enum and not a struct / class with several functions? 14 | // well: 15 | // 1) this allows for just one unified function, rather than many 16 | // 2) this allows to redirect to a root helper 17 | 18 | /// Lists operations that can be done to the FileSystem 19 | public enum FSOperation: Codable { 20 | case removeItems(items: [URL]) 21 | case createFile(files: [URL]) 22 | case createDirectory(directories: [URL]) 23 | 24 | case moveItem(items: [URL], resultPath: URL) 25 | case copyItem(items: [URL], resultPath: URL) 26 | case symlink (items: [URL], resultPath: URL) 27 | case rename (item: URL, newPath: URL) 28 | 29 | case setOwner(url: URL, newOwner: String) 30 | case setGroup(url: URL, newGroup: String) 31 | 32 | case setPermissions(url: URL, newOctalPermissions: Int) 33 | 34 | case writeData(url: URL, data: Data) 35 | case writeString(url: URL, string: String) 36 | case extractCatalog(catalogFileURL: URL, resultPath: URL) 37 | 38 | static private let fm = FileManager.default 39 | 40 | private static func _returnFailedItemsDictionaryIfAvailable(_ urls: [URL], handler: (URL) throws -> Void) throws { 41 | if urls.count == 1 { 42 | try handler(urls[0]) 43 | return 44 | } 45 | 46 | var failedItems: [String: String] = [:] 47 | for url in urls { 48 | do { 49 | try handler(url) 50 | } catch { 51 | failedItems[url.lastPathComponent] = error.localizedDescription 52 | } 53 | } 54 | 55 | if !failedItems.isEmpty { 56 | var message: String = "" 57 | for (item, error) in failedItems { 58 | message.append("\(item): \(error)\n") 59 | } 60 | 61 | throw _Errors.otherError(description: message.trimmingCharacters(in: .whitespacesAndNewlines)) 62 | } 63 | } 64 | 65 | public static func perform(_ operation: FSOperation, rootHelperConf: RootHelperConfiguration?) throws { 66 | if let rootHelperConf = rootHelperConf, rootHelperConf.useRootHelper { 67 | try rootHelperConf.perform(operation) 68 | return 69 | } 70 | 71 | switch operation { 72 | case .removeItems(let items): 73 | try _returnFailedItemsDictionaryIfAvailable(items) { url in 74 | try fm.removeItem(at: url) 75 | } 76 | 77 | case .createFile(let files): 78 | try _returnFailedItemsDictionaryIfAvailable(files) { url in 79 | // mode "a": create if it doesn't exist 80 | guard let filePtr = fopen((url as NSURL).fileSystemRepresentation, "a") else { 81 | throw _Errors.errnoError 82 | } 83 | 84 | fclose(filePtr) 85 | } 86 | case .createDirectory(let directories): 87 | try _returnFailedItemsDictionaryIfAvailable(directories) { url in 88 | try fm.createDirectory(at: url, withIntermediateDirectories: true) 89 | } 90 | case .moveItem(let items, let resultPath): 91 | try _returnFailedItemsDictionaryIfAvailable(items) { url in 92 | try fm.moveItem(at: url, to: resultPath.appendingPathComponent(url.lastPathComponent)) 93 | } 94 | case .copyItem(let items, let resultPath): 95 | try _returnFailedItemsDictionaryIfAvailable(items) { url in 96 | try fm.copyItem(at: url, to: resultPath.appendingPathComponent(url.lastPathComponent)) 97 | } 98 | case .rename(let item, let newPath): 99 | try FileManager.default.moveItem(at: item, to: newPath) 100 | case .symlink(let items, let resultPath): 101 | try _returnFailedItemsDictionaryIfAvailable(items) { url in 102 | try fm.createSymbolicLink(at: resultPath.appendingPathComponent(url.lastPathComponent), withDestinationURL: url) 103 | } 104 | case .setOwner(let url, let newOwner): 105 | try fm.setAttributes([.ownerAccountName: newOwner], ofItemAtPath: url.path) 106 | case .setGroup(let url, let newGroup): 107 | try fm.setAttributes([.groupOwnerAccountName: newGroup], ofItemAtPath: url.path) 108 | case .setPermissions(let url, let newOctalPermissions): 109 | try fm.setAttributes([.posixPermissions: newOctalPermissions], ofItemAtPath: url.path) 110 | case .writeData(let url, let data): 111 | try data.write(to: url) 112 | case .writeString(let url, let string): 113 | try string.write(to: url, atomically: true, encoding: .utf8) 114 | case .extractCatalog(let catalogFileURL, let resultPath): 115 | let (_, nonCodableRends) = try AssetCatalogWrapper.shared.renditions(forCarArchive: catalogFileURL) 116 | let renditions = nonCodableRends.flatMap(\.renditions).toCodable() 117 | 118 | try fm.createDirectory(at: resultPath, withIntermediateDirectories: true) 119 | var failedItems: [String: String] = [:] 120 | for rend in renditions { 121 | let newURL = resultPath.appendingPathComponent(rend.renditionName) 122 | if let data = rend.itemData { 123 | do { 124 | try FSOperation.perform(.writeData(url: newURL, data: data), rootHelperConf: rootHelperConf) 125 | } catch { 126 | failedItems[rend.renditionName] = "Unable to write item data to file: \(error.localizedDescription)" 127 | } 128 | } 129 | } 130 | 131 | if !failedItems.isEmpty { 132 | var message: String = "" 133 | for (item, error) in failedItems { 134 | message.append("\(item): \(error)") 135 | } 136 | 137 | throw _Errors.otherError(description: message.trimmingCharacters(in: .whitespacesAndNewlines)) 138 | } 139 | } 140 | } 141 | 142 | /// The command line invokation to use for SantanderRootHelper 143 | /// for this operation 144 | public var commandLineInvokation: [String] { 145 | switch self { 146 | case .removeItems(let items): 147 | return ["delete", items.joined()] 148 | case .createFile(let files): 149 | return ["create", "--files", files.joined()] 150 | case .createDirectory(let directories): 151 | return ["create", "--directories", directories.joined()] 152 | case .moveItem(let items, let resultPath): 153 | return ["move", items.joined(), "--destination", resultPath.path] 154 | case .copyItem(let items, let resultPath): 155 | return ["copy", items.joined(), "--destination", resultPath.path] 156 | case .rename(let item, let newPath): 157 | return ["rename", item.path, newPath.path] 158 | case .symlink(let items, let resultPath): 159 | return ["link", items.joined(), "--destination", resultPath.path] 160 | case .setOwner(let url, let newOwner): 161 | return ["set-owner-or-group", url.path, "--owner-name", newOwner] 162 | case .setGroup(let url, let newGroup): 163 | return ["set-owner-or-group", url.path, "--group-name", newGroup] 164 | case .setPermissions(let url, let newOctalPermissions): 165 | return ["set-permissions", url.path, newOctalPermissions.description] 166 | case .writeData(let url, _): 167 | return ["write-data", url.path] 168 | case .writeString(let url, let string): 169 | return ["write-string", string, "--path", url.path] 170 | case .extractCatalog(let catalogFile, let resultPath): 171 | return ["extract-catalog", catalogFile.path, "--destination", resultPath.path] 172 | } 173 | } 174 | } 175 | 176 | private extension Array where Element == URL { 177 | func joined(separator: String = " ") -> String { 178 | map(\.path).joined(separator: separator) 179 | } 180 | } 181 | 182 | private enum _Errors: Error, LocalizedError { 183 | case errnoError 184 | case otherError(description: String) 185 | 186 | var errorDescription: String? { 187 | switch self { 188 | case .errnoError: 189 | return String(cString: strerror(errno)) 190 | case .otherError(let description): 191 | return description 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /Sources/CFrameworks/CoreSVG/CoreSVG.tbd: -------------------------------------------------------------------------------- 1 | --- !tapi-tbd 2 | tbd-version: 4 3 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 4 | arm64e-macos, arm64e-maccatalyst, armv7-ios, armv7s-ios, arm64-ios, arm64e-ios ] 5 | install-name: '/System/Library/PrivateFrameworks/CoreSVG.framework/Versions/A/CoreSVG' 6 | current-version: 324 7 | exports: 8 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 9 | arm64e-macos, arm64e-maccatalyst, armv7-ios, armv7s-ios, arm64-ios, arm64e-ios ] 10 | symbols: [ _CGContextDrawSVGDocument, _CGContextDrawSVGDocumentWithOptions, 11 | _CGContextDrawSVGNode, _CGContextDrawSVGNodeWithOptions, _CGContextDrawSVGOptionDidDrawKey, 12 | _CGContextDrawSVGOptionWillDrawKey, _CGSVGAtomCopyString, 13 | _CGSVGAtomFromCString, _CGSVGAtomFromString, _CGSVGAtomGetCString, 14 | _CGSVGAttributeCopyString, _CGSVGAttributeCreateWithAtom, 15 | _CGSVGAttributeCreateWithCString, _CGSVGAttributeCreateWithClipPath, 16 | _CGSVGAttributeCreateWithColor, _CGSVGAttributeCreateWithFilter, 17 | _CGSVGAttributeCreateWithFloat, _CGSVGAttributeCreateWithFloats, 18 | _CGSVGAttributeCreateWithGradient, _CGSVGAttributeCreateWithLength, 19 | _CGSVGAttributeCreateWithMask, _CGSVGAttributeCreateWithPaint, 20 | _CGSVGAttributeCreateWithPath, _CGSVGAttributeCreateWithPoint, 21 | _CGSVGAttributeCreateWithRect, _CGSVGAttributeCreateWithString, 22 | _CGSVGAttributeCreateWithTransform, _CGSVGAttributeGetAtom, 23 | _CGSVGAttributeGetClipPath, _CGSVGAttributeGetFilter, _CGSVGAttributeGetFloat, 24 | _CGSVGAttributeGetFloatCount, _CGSVGAttributeGetFloats, _CGSVGAttributeGetLength, 25 | _CGSVGAttributeGetMask, _CGSVGAttributeGetName, _CGSVGAttributeGetPaint, 26 | _CGSVGAttributeGetPath, _CGSVGAttributeGetPoint, _CGSVGAttributeGetRect, 27 | _CGSVGAttributeGetTransform, _CGSVGAttributeGetType, _CGSVGAttributeGetTypeID, 28 | _CGSVGAttributeMapCopy, _CGSVGAttributeMapCreate, _CGSVGAttributeMapCreateWithDefaults, 29 | _CGSVGAttributeMapEnumerate, _CGSVGAttributeMapGetAttribute, 30 | _CGSVGAttributeMapGetCount, _CGSVGAttributeMapGetTypeID, _CGSVGAttributeMapRelease, 31 | _CGSVGAttributeMapRemoveAttribute, _CGSVGAttributeMapRetain, 32 | _CGSVGAttributeMapSetAttribute, _CGSVGAttributeRelease, _CGSVGAttributeRetain, 33 | _CGSVGCanvasAddEllipseInRect, _CGSVGCanvasAddLine, _CGSVGCanvasAddPath, 34 | _CGSVGCanvasAddPolygon, _CGSVGCanvasAddPolyline, _CGSVGCanvasAddRect, 35 | _CGSVGCanvasGetCurrentGroup, _CGSVGCanvasGetTypeID, _CGSVGCanvasPopGroup, 36 | _CGSVGCanvasPushGroup, _CGSVGCanvasRelease, _CGSVGCanvasRetain, 37 | _CGSVGClipPathAddPath, _CGSVGClipPathCreate, _CGSVGClipPathGetCompositePath, 38 | _CGSVGClipPathGetCompositePathRelativeToNode, _CGSVGClipPathGetNumberOfPaths, 39 | _CGSVGClipPathGetPath, _CGSVGClipPathGetTypeID, _CGSVGClipPathRelease, 40 | _CGSVGClipPathRemovePath, _CGSVGClipPathRetain, _CGSVGColorCreateCGColor, 41 | _CGSVGColorCreateDisplayP3, _CGSVGColorCreateFromCString, 42 | _CGSVGColorCreateFromString, _CGSVGColorCreateRGBA, _CGSVGColorCreateWithRGBA, 43 | _CGSVGDocumentAddNamedStyle, _CGSVGDocumentContainsWideGamutContent, 44 | _CGSVGDocumentCreate, _CGSVGDocumentCreateFromData, _CGSVGDocumentCreateFromDataProvider, 45 | _CGSVGDocumentCreateFromURL, _CGSVGDocumentCreateOptionVariablesKey, 46 | _CGSVGDocumentDefsAddNode, _CGSVGDocumentDefsEnumerate, _CGSVGDocumentDefsGetNode, 47 | _CGSVGDocumentGetCanvas, _CGSVGDocumentGetCanvasSize, _CGSVGDocumentGetNamedStyle, 48 | _CGSVGDocumentGetRootNode, _CGSVGDocumentGetTypeID, _CGSVGDocumentIsMonochrome, 49 | _CGSVGDocumentOptionBaseProfileKey, _CGSVGDocumentOptionSecurityLevelKey, 50 | _CGSVGDocumentOptionShowPlaceholderKey, _CGSVGDocumentOptionStrictKey, 51 | _CGSVGDocumentRelease, _CGSVGDocumentRetain, _CGSVGDocumentWriteToData, 52 | _CGSVGDocumentWriteToURL, _CGSVGFilterAddNode, _CGSVGFilterCreate, 53 | _CGSVGFilterGetChildAtIndex, _CGSVGFilterGetChildCount, _CGSVGFilterGetTypeID, 54 | _CGSVGFilterPrimitiveCreate, _CGSVGFilterPrimitiveGetTypeID, 55 | _CGSVGFilterPrimitiveRelease, _CGSVGFilterPrimitiveRetain, 56 | _CGSVGFilterRelease, _CGSVGFilterRetain, _CGSVGGradientAddStop, 57 | _CGSVGGradientCreate, _CGSVGGradientGetCenter, _CGSVGGradientGetEnd, 58 | _CGSVGGradientGetFocal, _CGSVGGradientGetGradientTransform, 59 | _CGSVGGradientGetNumberOfStops, _CGSVGGradientGetRadius, _CGSVGGradientGetSpread, 60 | _CGSVGGradientGetSpreadMethod, _CGSVGGradientGetStart, _CGSVGGradientGetStop, 61 | _CGSVGGradientGetType, _CGSVGGradientGetTypeID, _CGSVGGradientRelease, 62 | _CGSVGGradientRetain, _CGSVGGradientSetCenter, _CGSVGGradientSetEnd, 63 | _CGSVGGradientSetFocal, _CGSVGGradientSetGradientTransform, 64 | _CGSVGGradientSetRadius, _CGSVGGradientSetSpread, _CGSVGGradientSetSpreadMethod, 65 | _CGSVGGradientSetStart, _CGSVGGradientStopCreateWithColor, 66 | _CGSVGGradientStopGetColor, _CGSVGGradientStopGetOffset, _CGSVGGradientStopGetOpacity, 67 | _CGSVGGradientStopGetTypeID, _CGSVGGradientStopRelease, _CGSVGGradientStopRetain, 68 | _CGSVGImageCreateWithNoImage, _CGSVGImageCreateWithRasterImage, 69 | _CGSVGImageCreateWithSVGDocument, _CGSVGImageGetRasterImage, 70 | _CGSVGImageGetSVGDocument, _CGSVGImageGetType, _CGSVGImageGetTypeID, 71 | _CGSVGImageRelease, _CGSVGImageRetain, _CGSVGLengthEqualToLength, 72 | _CGSVGLengthMake, _CGSVGLengthMakeWithType, _CGSVGLengthScaledLength, 73 | _CGSVGMaskAddNode, _CGSVGMaskCreate, _CGSVGMaskCreateMask, 74 | _CGSVGMaskGetChildAtIndex, _CGSVGMaskGetChildCount, _CGSVGMaskGetTypeID, 75 | _CGSVGMaskRelease, _CGSVGMaskRemoveNode, _CGSVGMaskRetain, 76 | _CGSVGNodeAddChild, _CGSVGNodeCopy, _CGSVGNodeCopyName, _CGSVGNodeCopyStringIdentifier, 77 | _CGSVGNodeCopyText, _CGSVGNodeCreate, _CGSVGNodeCreateCompoundCGPath, 78 | _CGSVGNodeCreateGroupNode, _CGSVGNodeEnumerate, _CGSVGNodeExtractCompoundCGPath, 79 | _CGSVGNodeFindAttribute, _CGSVGNodeFindChildWithCStringIdentifier, 80 | _CGSVGNodeFindChildWithStringIdentifier, _CGSVGNodeGetAttributeMap, 81 | _CGSVGNodeGetBoundingBox, _CGSVGNodeGetBoundingBoxWithOptions, 82 | _CGSVGNodeGetChildAtIndex, _CGSVGNodeGetChildCount, _CGSVGNodeGetParent, 83 | _CGSVGNodeGetRelativeBoundingBox, _CGSVGNodeGetType, _CGSVGNodeGetTypeID, 84 | _CGSVGNodeIsRoot, _CGSVGNodeRelease, _CGSVGNodeRemoveChildAtIndex, 85 | _CGSVGNodeRetain, _CGSVGNodeSetAttribute, _CGSVGNodeSetAttributeMap, 86 | _CGSVGNodeSetCStringComment, _CGSVGNodeSetCStringIdentifier, 87 | _CGSVGNodeSetCStringText, _CGSVGNodeSetStringComment, _CGSVGNodeSetStringIdentifier, 88 | _CGSVGNodeSetStringText, _CGSVGPaintCreateNone, _CGSVGPaintCreateWithColor, 89 | _CGSVGPaintCreateWithGradient, _CGSVGPaintCreateWithPattern, 90 | _CGSVGPaintGetColor, _CGSVGPaintGetGradient, _CGSVGPaintGetOpacity, 91 | _CGSVGPaintGetPattern, _CGSVGPaintGetType, _CGSVGPaintGetTypeID, 92 | _CGSVGPaintIsVisible, _CGSVGPaintRelease, _CGSVGPaintRetain, 93 | _CGSVGPaintSetOpacity, _CGSVGPathAppendCommand, _CGSVGPathCommandAppendFloats, 94 | _CGSVGPathCommandAppendPoint, _CGSVGPathCommandGetFloatAtIndex, 95 | _CGSVGPathCommandGetFloatCount, _CGSVGPathCommandGetType, 96 | _CGSVGPathCommandGetTypeID, _CGSVGPathCreate, _CGSVGPathCreateCGPath, 97 | _CGSVGPathCreatePathDescription, _CGSVGPathCreateWithCGPath, 98 | _CGSVGPathCreateWithPathDescription, _CGSVGPathGetCommandAtIndex, 99 | _CGSVGPathGetCommandCount, _CGSVGPathGetTypeID, _CGSVGPathRelease, 100 | _CGSVGPathRetain, _CGSVGPatternAddNode, _CGSVGPatternCreate, 101 | _CGSVGPatternGetChildAtIndex, _CGSVGPatternGetChildCount, 102 | _CGSVGPatternGetTypeID, _CGSVGPatternRelease, _CGSVGPatternRemoveNode, 103 | _CGSVGPatternRetain, _CGSVGPointEqualToPoint, _CGSVGPointMake, 104 | _CGSVGPointMakeWithPoint, _CGSVGPointMakeWithTypes, _CGSVGPointScaledPoint, 105 | _CGSVGRootNodeCreate, _CGSVGRootNodeGetAspectRatio, _CGSVGRootNodeGetAspectRatioMeetOrSlice, 106 | _CGSVGRootNodeGetSize, _CGSVGRootNodeGetViewbox, _CGSVGRootNodeSetAspectRatio, 107 | _CGSVGRootNodeSetAspectRatioMeetOrSlice, _CGSVGRootNodeSetSize, 108 | _CGSVGRootNodeSetViewbox, _CGSVGShapeNodeCopyText, _CGSVGShapeNodeCreate, 109 | _CGSVGShapeNodeGetCircleGeometry, _CGSVGShapeNodeGetEllipseGeometry, 110 | _CGSVGShapeNodeGetFloatCount, _CGSVGShapeNodeGetFloats, _CGSVGShapeNodeGetLineGeometry, 111 | _CGSVGShapeNodeGetPath, _CGSVGShapeNodeGetPrimitive, _CGSVGShapeNodeGetRectGeometry, 112 | _CGSVGShapeNodeSetCircleGeometry, _CGSVGShapeNodeSetEllipseGeometry, 113 | _CGSVGShapeNodeSetFloats, _CGSVGShapeNodeSetLineGeometry, 114 | _CGSVGShapeNodeSetPath, _CGSVGShapeNodeSetRectGeometry, _CGSVGViewBoxNodeGetAspectRatio, 115 | _CGSVGViewBoxNodeGetAspectRatioMeetOrSlice, _CGSVGViewBoxNodeGetPosition, 116 | _CGSVGViewBoxNodeGetSize, _CGSVGViewBoxNodeGetViewbox, _CGSVGViewBoxNodeSetAspectRatio, 117 | _CGSVGViewBoxNodeSetAspectRatioMeetOrSlice, _CGSVGViewBoxNodeSetSize, 118 | _CGSVGViewBoxNodeSetViewbox, _CoreSVGVersionNumber, _CoreSVGVersionString, 119 | _kCGSVGOmitHeaders, _kCGSVGPacked ] 120 | ... 121 | -------------------------------------------------------------------------------- /Sources/CompressionWrapper/Compression.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Compression.swift 3 | // 4 | // 5 | // Created by Serena on 21/10/2022 6 | // 7 | 8 | import Foundation 9 | @_implementationOnly 10 | import libarchiveBridge 11 | 12 | enum CompressionErrors: Swift.Error, LocalizedError, CustomStringConvertible { 13 | case failedToCopyData(description: String) 14 | case failedToExtract(description: String, line: Int = #line) 15 | case failedToArchive(dsecription: String) 16 | 17 | var description: String { 18 | switch self { 19 | case .failedToCopyData(let description): 20 | return "Failed to copy data: \(description)" 21 | case .failedToExtract(let description, let line): 22 | #if DEBUG 23 | return "Failed to extract file: \(description) (line: \(line))" 24 | #else 25 | return "Failed to extract file: \(description)" 26 | #endif 27 | case .failedToArchive(let description): 28 | return "Error while archiving: \(description)" 29 | } 30 | } 31 | 32 | var errorDescription: String? { 33 | description 34 | } 35 | } 36 | 37 | public struct ArchiveOptions: OptionSet { 38 | public let rawValue: CInt 39 | 40 | public init(rawValue: CInt) { 41 | self.rawValue = rawValue 42 | } 43 | 44 | public static let restoreOwner = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_OWNER) 45 | public static let restorePermissions = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_PERM) 46 | public static let restoreTime = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_TIME) 47 | public static let dontOverwite = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_NO_OVERWRITE) 48 | public static let unlink = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_UNLINK) 49 | 50 | public static let restoreACLs = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_ACL) 51 | public static let restoreFFLags = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_FFLAGS) 52 | public static let restoreXattrs = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_XATTR) 53 | public static let secureSymlinks = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_SECURE_SYMLINKS) 54 | public static let secureNoDotDot = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_SECURE_NODOTDOT) 55 | public static let dontCreateParentDirs = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_NO_AUTODIR) 56 | public static let sparse = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_SPARSE) 57 | public static let includeMacOSMetadata = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_MAC_METADATA) 58 | public static let dontUseHFSCompression = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_NO_HFS_COMPRESSION) 59 | public static let forceUseHFSCompression = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED) 60 | public static let rejectAbsolutePaths = ArchiveOptions(rawValue: ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) 61 | } 62 | 63 | public class Compression { 64 | public static let shared = Compression() 65 | 66 | private init() {} 67 | 68 | public func extract( 69 | path compressedFile: URL, 70 | to destination: URL, 71 | options: ArchiveOptions = [.restoreTime, .restorePermissions, .restoreACLs, .restoreFFLags] 72 | ) throws { 73 | let flags = options.rawValue 74 | 75 | let a = archive_read_new() 76 | archive_read_support_format_all(a) 77 | archive_read_support_filter_all(a) 78 | 79 | let ext = archive_write_disk_new() 80 | archive_write_disk_set_options(ext, flags) 81 | 82 | let archiveEntry = archive_entry_new() 83 | var r: CInt = 0 84 | 85 | defer { 86 | archive_read_close(a) 87 | archive_read_free(a) 88 | archive_write_close(ext) 89 | archive_write_free(ext) 90 | } 91 | 92 | try compressedFile.withUnsafeFileSystemRepresentation { fsRepresentation in 93 | guard let fsRepresentation = fsRepresentation, 94 | archive_read_open_filename(a, fsRepresentation, 10240) == ARCHIVE_OK else { 95 | throw CompressionErrors.failedToExtract(description: "Failed to open compressed archive \(compressedFile.path)") 96 | } 97 | } 98 | 99 | while true { 100 | r = archive_read_next_header2(a, archiveEntry) 101 | if r == ARCHIVE_EOF { break } // we're done here. 102 | 103 | if r < ARCHIVE_OK { 104 | throw CompressionErrors.failedToExtract(description: .archiveError(for: a)) 105 | } 106 | 107 | let currentPathBeingProcessed = archive_entry_pathname(archiveEntry)! 108 | let fullOutputPath = destination.appendingPathComponent(String(cString: currentPathBeingProcessed)) 109 | fullOutputPath.withUnsafeFileSystemRepresentation { fsRepresentation in 110 | archive_entry_set_pathname(archiveEntry, fsRepresentation) 111 | } 112 | 113 | r = archive_write_header(ext, archiveEntry) 114 | if (r < ARCHIVE_OK) { 115 | throw CompressionErrors.failedToExtract(description: .archiveError(for: ext)) 116 | } 117 | 118 | if archive_entry_size(archiveEntry) > 0 { 119 | try copyData(ar: a, aw: ext) 120 | } 121 | 122 | r = archive_write_finish_entry(ext) 123 | if (r < ARCHIVE_OK) { 124 | throw CompressionErrors.failedToExtract(description: .archiveError(for: ext)) 125 | } 126 | 127 | } 128 | } 129 | 130 | /// Compresses the paths given (alongside their subdirectories) to the given outputPath. 131 | /// The process handler is called on every URL which gets processed, hence the name 132 | public func compress(paths: [URL], outputPath: URL, format: FormatType, filenameExcludes: [String] = [], processHandler: ((URL) -> Void)? = nil) throws { 133 | let a = archive_write_new() 134 | var entry: OpaquePointer? = nil 135 | let buff = UnsafeMutableRawPointer.allocate(byteCount: 8192, alignment: 4) 136 | var st: stat = stat() 137 | var fd: CInt = 0 138 | var len: Int = 0 139 | 140 | archive_write_add_filter_gzip(a) 141 | format.apply(to: a) 142 | try outputPath.withUnsafeFileSystemRepresentation { fsRepresentation in 143 | guard archive_write_open_filename(a, fsRepresentation) == ARCHIVE_OK else { 144 | throw CompressionErrors.failedToArchive(dsecription: "Unable to open a destination to destination path \(outputPath.path)") 145 | } 146 | } 147 | 148 | func _archiveIndividiualPath(_ path: URL) throws { 149 | try path.withUnsafeFileSystemRepresentation { fsRepresentation in 150 | guard let fsRepresentation = fsRepresentation else { 151 | throw CompressionErrors.failedToArchive(dsecription: "Path \(path.path) is an invalid path (Cannot generate filesystem representation).") 152 | } 153 | 154 | processHandler?(path) 155 | guard stat(fsRepresentation, &st) == 0 else { 156 | throw CompressionErrors.failedToArchive(dsecription: "Failed to stat (get information of) path \(path.path): \(String.errnoString())") 157 | } 158 | 159 | let attrs = try FileManager.default.attributesOfItem(atPath: path.path) 160 | guard let type = attrs[.type] as? FileAttributeType, let existingPosixPermissions = attrs[.posixPermissions] as? mode_t else { 161 | throw CompressionErrors.failedToArchive(dsecription: "Unable to get type or permissions of path \(path.path): \(String.errnoString()))") 162 | } 163 | 164 | entry = archive_entry_new() 165 | archive_entry_set_pathname(entry, path.relativePath(from: outputPath)) 166 | 167 | let archiveType = try __archiveTypeConstant(forPathType: type, path: path) 168 | archive_entry_set_size(entry, st.st_size) 169 | archive_entry_set_filetype(entry, CUnsignedInt(archiveType)) 170 | 171 | archive_entry_set_perm(entry, existingPosixPermissions) 172 | guard archive_write_header(a, entry) == ARCHIVE_OK else { 173 | throw CompressionErrors.failedToArchive(dsecription: "Failed to write header of path \(path.path): \(String.archiveError(for: a))") 174 | } 175 | 176 | fd = open(fsRepresentation, O_RDONLY) 177 | guard fd != -1 else { 178 | throw CompressionErrors.failedToArchive(dsecription: "Failed to open file \(path.path): \(String.errnoString())") 179 | } 180 | 181 | len = read(fd, buff, MemoryLayout.stride(ofValue: buff)) 182 | while len > 0 { 183 | archive_write_data(a, buff, len) 184 | len = read(fd, buff, MemoryLayout.stride(ofValue: buff)) 185 | } 186 | 187 | close(fd) 188 | archive_entry_free(entry) 189 | } 190 | } 191 | 192 | let allPaths = paths.flatMap { path in 193 | let isDir = (try? path.resourceValues(forKeys: [.isDirectoryKey]).isDirectory) ?? false 194 | if isDir, let enumerator = FileManager.default.enumerator(at: path, includingPropertiesForKeys: nil) { 195 | return enumerator.allObjects as? [URL] ?? [] 196 | } else { 197 | return [path] 198 | } 199 | } 200 | 201 | for path in allPaths { 202 | if !filenameExcludes.contains(path.lastPathComponent) { 203 | try _archiveIndividiualPath(path) 204 | } 205 | } 206 | 207 | archive_write_close(a) 208 | archive_write_free(a) 209 | } 210 | 211 | private func copyData(ar: OpaquePointer?, aw: OpaquePointer?) throws { 212 | var r: CInt = 0 213 | var size = 0 214 | var buffer: UnsafeRawPointer? = nil 215 | var offset: la_int64_t = 0 216 | 217 | while true { 218 | r = archive_read_data_block(ar, &buffer, &size, &offset) 219 | if r == ARCHIVE_EOF { break } // we're done here. 220 | // libarchive didn't return an okay status, throw error 221 | if r < ARCHIVE_OK { 222 | throw CompressionErrors.failedToCopyData(description: "Error occured while trying to read data block: \(String.archiveError(for: ar))") 223 | } 224 | 225 | 226 | r = CInt(archive_write_data_block(aw, buffer, Int(size), offset)) 227 | if r < ARCHIVE_OK { 228 | throw CompressionErrors.failedToCopyData(description: "Failed to write data block: \(String.archiveError(for: aw))") 229 | } 230 | } 231 | } 232 | 233 | public enum FormatType: CaseIterable, CustomStringConvertible { 234 | case zip 235 | case tar 236 | // case sevenZip 237 | 238 | internal func apply(to a: OpaquePointer?) { 239 | switch self { 240 | case .zip: 241 | archive_write_set_format_zip(a) 242 | case .tar: 243 | archive_write_set_format_gnutar(a) 244 | } 245 | } 246 | 247 | public var fileExtension: String { 248 | switch self { 249 | case .zip: 250 | return "zip" 251 | case .tar: 252 | return "tar" 253 | } 254 | } 255 | 256 | public var description: String { 257 | switch self { 258 | case .zip: 259 | return "Zip" 260 | case .tar: 261 | return "Tar" 262 | } 263 | } 264 | } 265 | } 266 | 267 | 268 | fileprivate extension URL { 269 | func relativePath(from base: URL) -> String { 270 | 271 | //this is the new part, clearly, need to use workBase in lower part 272 | let workBase = base 273 | // Remove/replace "." and "..", make paths absolute: 274 | let destComponents = self.standardized.resolvingSymlinksInPath().pathComponents 275 | let baseComponents = workBase.standardized.resolvingSymlinksInPath().pathComponents 276 | 277 | // Find number of common path components: 278 | var i = 0 279 | while i < destComponents.count && 280 | i < baseComponents.count && 281 | destComponents[i] == baseComponents[i] { 282 | i += 1 283 | } 284 | 285 | return destComponents[i...].joined(separator: "/") 286 | } 287 | 288 | } 289 | 290 | fileprivate func __archiveTypeConstant(forPathType pathType: FileAttributeType, path: URL) throws -> CInt { 291 | switch pathType { 292 | case .typeRegular: 293 | return AE_IFREG 294 | case .typeDirectory: 295 | return AE_IFDIR 296 | case .typeSymbolicLink: 297 | return AE_IFLNK 298 | case .typeBlockSpecial: 299 | return AE_IFBLK 300 | case .typeSocket: 301 | return AE_IFSOCK 302 | case .typeCharacterSpecial: 303 | return AE_IFCHR 304 | default: 305 | throw CompressionErrors.failedToArchive(dsecription: "Unknown type of path \(path.path)") 306 | } 307 | } 308 | 309 | fileprivate extension String { 310 | // the following functions are here just to make code above clearer 311 | static func errnoString(_ errnoNumber: CInt = errno) -> String { 312 | return String(cString: strerror(errnoNumber)) 313 | } 314 | 315 | static func archiveError(for archive: OpaquePointer?) -> String { 316 | return String(cString: archive_error_string(archive)) 317 | } 318 | } 319 | -------------------------------------------------------------------------------- /Sources/AssetCatalogWrapper/AssetCatalogWrapper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CarWrapper.swift 3 | // Santander 4 | // 5 | // Created by Serena on 16/09/2022 6 | // 7 | 8 | 9 | #if canImport(UIKit) 10 | import UIKit 11 | #elseif canImport(AppKit) 12 | import AppKit 13 | #endif 14 | 15 | import UniformTypeIdentifiers 16 | import SVGWrapper 17 | 18 | @_exported 19 | import CoreUIBridge 20 | 21 | public typealias RenditionCollection = [(type: RenditionType, renditions: [Rendition])] 22 | 23 | internal func _getScreenScale() -> CGFloat { 24 | #if canImport(UIKit) 25 | return UIScreen.main.scale 26 | #else 27 | return NSScreen.main!.backingScaleFactor 28 | #endif 29 | } 30 | 31 | public class AssetCatalogWrapper { 32 | public static let shared = AssetCatalogWrapper() 33 | 34 | public func renditions(forCarArchive url: URL) throws -> (CUICatalog, RenditionCollection) { 35 | let catalog = try CUICatalog(url: url) 36 | return (catalog, catalog.__getRenditionCollection()) 37 | } 38 | 39 | public func extract(collection: RenditionCollection, to destinationURL: URL) throws { 40 | let justRenditions = collection.flatMap(\.renditions) 41 | var failedItems: [Rendition: String] = [:] 42 | for rendition in justRenditions { 43 | switch rendition.type { 44 | case .image, .icon: 45 | guard let image = rendition.image else { 46 | failedItems[rendition] = "Failed to generate image" 47 | continue 48 | } 49 | 50 | #if os(macOS) 51 | let rep = NSBitmapImageRep(cgImage: image) 52 | let data = rep.representation(using: .png, properties: [.compressionFactor: 1]) 53 | #else 54 | let data = UIImage(cgImage: image).pngData() 55 | #endif 56 | 57 | guard let data = data else { 58 | failedItems[rendition] = "Unable to generate png data for image" 59 | continue 60 | } 61 | 62 | var writeURL = destinationURL.appendingPathComponent(rendition.namedLookup.name) 63 | if writeURL.pathExtension.isEmpty { 64 | writeURL.appendPathExtension("png") 65 | } 66 | 67 | do { 68 | try data.write(to: writeURL, options: .atomic) 69 | } catch { 70 | failedItems[rendition] = "Failed to write to \(writeURL.path): \(error)" 71 | } 72 | case .pdf: 73 | guard let data = rendition.cuiRend.srcData else { 74 | failedItems[rendition] = "Failed to generate PDF data" 75 | continue 76 | } 77 | 78 | var writeURL = destinationURL.appendingPathComponent(rendition.namedLookup.name) 79 | if writeURL.pathExtension != "pdf" { 80 | writeURL.appendPathExtension("pdf") 81 | } 82 | 83 | do { 84 | try data.write(to: writeURL) 85 | } catch { 86 | failedItems[rendition] = "Unable to write to \(writeURL.path): \(error.localizedDescription)" 87 | } 88 | case .svg: 89 | guard let svg = rendition.cuiRend.svgDocument() else { 90 | failedItems[rendition] = "Failed to generate SVG" 91 | continue 92 | } 93 | 94 | var writeURL = destinationURL.appendingPathComponent(rendition.namedLookup.name) 95 | if writeURL.pathExtension != "svg" { 96 | writeURL.appendPathExtension("svg") 97 | } 98 | SVGDocument(doc: svg).write(to: writeURL) 99 | default: 100 | break 101 | } 102 | } 103 | 104 | if !failedItems.isEmpty { 105 | var failedItemsMessage: String = "" 106 | for (rendition, error) in failedItems { 107 | failedItemsMessage.append("\(rendition.name): \(error.localizedLowercase)") 108 | } 109 | failedItemsMessage = failedItemsMessage.trimmingCharacters(in: .whitespaces) 110 | throw StringError(failedItemsMessage) 111 | } 112 | } 113 | } 114 | 115 | /// Represents a Core UI rendition 116 | public class Rendition: Hashable { 117 | 118 | /// the ThemeSubtype constant used to identify renditions 119 | /// classified as `macCatalyst` 120 | /// see `RenditionIdiom`'s init 121 | public static let macCatalystSubtype = 32401 122 | 123 | public func hash(into hasher: inout Hasher) { 124 | hasher.combine(cuiRend) 125 | hasher.combine(namedLookup) 126 | hasher.combine(type) 127 | } 128 | 129 | public static func == (lhs: Rendition, rhs: Rendition) -> Bool { 130 | return lhs.cuiRend == rhs.cuiRend && lhs.namedLookup == rhs.namedLookup && lhs.type == rhs.type 131 | } 132 | 133 | public let cuiRend: CUIThemeRendition 134 | public let namedLookup: CUINamedLookup 135 | public let type: RenditionType 136 | public let name: String 137 | 138 | @available(*, unavailable, message: "Renamed to `representation`") 139 | public var preview: Representation? { fatalError() } 140 | 141 | public lazy var representation: Representation? = Representation(self) 142 | public lazy var image: CGImage? = _getImage() 143 | 144 | public func _getImage() -> CGImage? { 145 | if let cgImage = cuiRend.uncroppedImage()?.takeUnretainedValue() { 146 | return cgImage 147 | } 148 | 149 | switch type { 150 | case .pdf: 151 | return cuiRend.createImageFromPDFRendition(withScale: _getScreenScale())?.takeUnretainedValue() 152 | case .svg: 153 | if let svgDocument = cuiRend.svgDocument() { 154 | let document = SVGDocument(doc: svgDocument) 155 | document.destroyUponDeinitialization = false 156 | return document.cgImage() 157 | } 158 | return nil 159 | 160 | default: 161 | return nil 162 | } 163 | 164 | } 165 | 166 | public init(_ namedLookup: CUINamedLookup) { 167 | let rendition = namedLookup.rendition 168 | self.cuiRend = rendition 169 | self.namedLookup = namedLookup 170 | self.type = .init(namedLookup: namedLookup) 171 | 172 | self.name = type == .icon ? cuiRend.name() : namedLookup.name 173 | } 174 | 175 | #if canImport(UIKit) 176 | public func makeDragItem() -> UIDragItem? { 177 | guard let cgImage = self.image else { return nil } 178 | 179 | let image = UIImage(cgImage: cgImage) 180 | let itemProvider = NSItemProvider(object: image) 181 | let dragItem = UIDragItem(itemProvider: itemProvider) 182 | dragItem.localObject = image 183 | 184 | return dragItem 185 | } 186 | #endif 187 | 188 | /// The idiom, aka the platform target, of a Rendition 189 | public enum Idiom: CustomStringConvertible { 190 | /// All platforms. 191 | case universal 192 | 193 | case iphone 194 | case ipad 195 | case tv 196 | case watch 197 | case carPlay 198 | case macCatalyst 199 | 200 | /// This seems to be for App Store related renditions. 201 | case marketing 202 | 203 | public init?(_ keyList: CUIRenditionKey) { 204 | if keyList.themeSubtype == Rendition.macCatalystSubtype { 205 | self = .macCatalyst 206 | return 207 | } 208 | 209 | switch keyList.themeIdiom { 210 | case 0: 211 | self = .universal 212 | case 1: 213 | self = .iphone 214 | case 2: 215 | self = .ipad 216 | case 3: 217 | self = .tv 218 | case 4: 219 | self = .carPlay 220 | case 5: 221 | self = .watch 222 | case 6: 223 | self = .marketing 224 | default: 225 | return nil 226 | } 227 | } 228 | 229 | public var description: String { 230 | switch self { 231 | case .universal: 232 | return "Universal" 233 | case .iphone: 234 | return "iPhone" 235 | case .ipad: 236 | return "iPad" 237 | case .tv: 238 | return "TV" 239 | case .watch: 240 | return "Watch" 241 | case .carPlay: 242 | return "CarPlay" 243 | case .macCatalyst: 244 | return "Mac Catalyst" 245 | case .marketing: 246 | return "Marketing" 247 | } 248 | } 249 | } 250 | 251 | public enum DisplayGamut: Int64, Hashable, CustomStringConvertible { 252 | case sRGB = 0 253 | case p3 = 1 254 | 255 | public init?(_ key: CUIRenditionKey) { 256 | self.init(rawValue: key.themeDisplayGamut) 257 | } 258 | 259 | public var description: String { 260 | switch self { 261 | case .sRGB: 262 | return "SRGB" 263 | case .p3: 264 | return "Display P3" 265 | } 266 | } 267 | } 268 | 269 | public enum Appearance: Int64, CustomStringConvertible { 270 | case any = 0 271 | case dark = 1 272 | case highContrast = 2 273 | case highConstrastDark = 3 274 | case light = 4 275 | case highConstrastLight = 5 276 | 277 | public init?(_ key: CUIRenditionKey) { 278 | self.init(rawValue: key.themeAppearance) 279 | } 280 | 281 | public var description: String { 282 | switch self { 283 | case .any: 284 | return "Any" 285 | case .dark: 286 | return "Dark" 287 | case .light: 288 | return "Light" 289 | case .highContrast: 290 | return "High Constrast" 291 | case .highConstrastDark: 292 | return "High Contrast Dark" 293 | case .highConstrastLight: 294 | return "High Constrast Light" 295 | } 296 | } 297 | } 298 | 299 | public enum Representation: Hashable { 300 | case color(CGColor) 301 | case image(CGImage) 302 | case rawData(Data) 303 | 304 | #if canImport(UIKit) 305 | public var uiView: UIView { 306 | var view = UIView() 307 | switch self { 308 | case .color(let cgColor): 309 | view.backgroundColor = UIColor(cgColor: cgColor) 310 | case .image(let cgImage): 311 | view = UIImageView(image: UIImage(cgImage: cgImage)) 312 | view.clipsToBounds = true 313 | } 314 | 315 | return view 316 | } 317 | /* 318 | #else 319 | public var nsView: NSView { 320 | switch self { 321 | case .color(let color): 322 | let view = NSView() 323 | view.wantsLayer = true 324 | view.layer?.backgroundColor = color 325 | return view 326 | case .image(let image): 327 | return NSImageView(image: NSImage(cgImage: image, 328 | size: CGSize(width: image.width, height: image.height))) 329 | } 330 | } 331 | */ 332 | #endif 333 | 334 | public init?(_ rendition: Rendition) { 335 | if let cgColor = rendition.cuiRend.cgColor()?.takeUnretainedValue() { 336 | self = .color(cgColor) 337 | } else if let image = rendition.image { 338 | self = .image(image) 339 | } else if let data = rendition.cuiRend.data() { 340 | self = .rawData(data) 341 | } else { 342 | return nil 343 | } 344 | } 345 | } 346 | } 347 | 348 | public enum RenditionType: Int, Codable, Hashable, CustomStringConvertible, CaseIterable { 349 | case image, icon, imageSet, multiSizeImageSet 350 | case pdf 351 | case color 352 | case svg 353 | case rawData 354 | case unknown 355 | 356 | public init(namedLookup: CUINamedLookup) { 357 | let className = NSStringFromClass(namedLookup.rendition.classForCoder) 358 | 359 | switch className { 360 | case "_CUIRawPixelRendition": // non PNG images? lmao 361 | self = .image 362 | case "_CUIThemePixelRendition", "_CUIInternalLinkRendition": 363 | let key = namedLookup.key 364 | 365 | switch key.themeElement { 366 | case 85 where key.themePart == 220 : 367 | self = .icon 368 | case 9: 369 | self = .imageSet 370 | default: 371 | self = .image 372 | } 373 | case "_CUIThemePDFRendition": 374 | self = .pdf 375 | case "_CUIThemeColorRendition": 376 | self = .color 377 | case "_CUIThemeSVGRendition": 378 | self = .svg 379 | case "_CUIThemeMultisizeImageSetRendition": 380 | self = .multiSizeImageSet 381 | case "_CUIRawDataRendition": 382 | self = .rawData 383 | default: 384 | self = .unknown 385 | } 386 | } 387 | 388 | public var description: String { 389 | switch self { 390 | case .image: 391 | return "Image" 392 | case .icon: 393 | return "Icon" 394 | case .imageSet: 395 | return "Image Set" 396 | case .multiSizeImageSet: 397 | return "Multisize Image Set" 398 | case .pdf: 399 | return "PDF" 400 | case .color: 401 | return "Color" 402 | case .svg: 403 | return "SVG (Vector)" 404 | case .rawData: 405 | return "Raw Data" 406 | case .unknown: 407 | return "Unknown" 408 | } 409 | } 410 | 411 | public var isEditable: Bool { 412 | switch self { 413 | case .image, .icon, .color: 414 | return true 415 | default: 416 | return false 417 | } 418 | } 419 | 420 | } 421 | 422 | @available(*, deprecated, message: "Renamed to Rendition.Representation") 423 | public typealias RenditionPreview = Rendition.Representation 424 | 425 | public extension CUICatalog { 426 | 427 | internal func __getRenditionCollection() -> RenditionCollection { 428 | var dict: [RenditionType: [Rendition]] = [:] 429 | 430 | enumerateNamedLookups { lookup in 431 | let rend = Rendition(lookup) 432 | if var existing = dict[rend.type] { 433 | existing.append(rend) 434 | dict[rend.type] = existing 435 | } else { 436 | dict[rend.type] = [rend] 437 | } 438 | } 439 | 440 | var arr = RenditionCollection() 441 | for (key, value) in dict { 442 | // sort Renditions in Alphabetical order 443 | let sorted = value.sorted { first, second in first.name < second.name } 444 | arr.append((key, sorted)) 445 | } 446 | 447 | // sort Types in Alphabetical order 448 | arr = arr.sorted { first, second in 449 | return first.type.description < second.type.description 450 | } 451 | 452 | return arr 453 | } 454 | 455 | /// Removes an item, and returns a new, updated catalog for the file URL 456 | func removeItem(_ rendition: Rendition, fileURL: URL) throws { 457 | let keyStore = try removingItem(rendition, fileURL: fileURL) 458 | try writekeyStore(keyStore, to: fileURL) 459 | } 460 | 461 | /// Removes an item, and returns a new, updated catalog for the file URL 462 | func removingItem(_ rendition: Rendition, fileURL: URL) throws -> CUIMutableCommonAssetStorage { 463 | let keyStore = try keyStore(forFileURL: fileURL) 464 | guard let data = _themeStore().convertRenditionKey(toKeyData: rendition.cuiRend.key()) else { 465 | throw _Errors.unableToAccessItemData 466 | } 467 | 468 | keyStore.removeAsset(forKey: data) 469 | return keyStore 470 | } 471 | 472 | func editItem(_ item: Rendition, fileURL: URL, to newValue: Rendition.Representation, isAlphaAllowed: Bool = true) throws { 473 | let keyStore = try editingItem(item, fileURL: fileURL, to: newValue, isAlphaAllowed: isAlphaAllowed) 474 | try writekeyStore(keyStore, to: fileURL) 475 | } 476 | 477 | func editingItem(_ item: Rendition, fileURL: URL, to newValue: Rendition.Representation, isAlphaAllowed: Bool = true) throws -> CUIMutableCommonAssetStorage { 478 | guard let keyStore = CUIMutableCommonAssetStorage(path: fileURL.path, forWriting: true) else { 479 | throw _Errors.unableToAccessCatalogFile(fileURL: fileURL) 480 | } 481 | 482 | // refactored from https://github.com/joey-gm/Aphrodite/blob/a334eb6a7c4863897723c968bd7a083ae1df75b9/Aphrodite/Models/AssetCatalog.swift#L181 483 | switch newValue { 484 | case .image(let newImage): 485 | var rendition = item.cuiRend 486 | let assetStorage = keyStore 487 | let themeStore = _themeStore() 488 | 489 | let isInternalLink: Bool = rendition.isInternalLink() 490 | let linkRect: CGRect = rendition._destinationFrame() 491 | let keyList = rendition.linkingToRendition()?.keyList() ?? item.namedLookup.key.keyList() 492 | 493 | var carKey = themeStore.convertRenditionKey(toKeyData: keyList) 494 | if isInternalLink { 495 | let keyList = rendition.linkingToRendition()?.keyList() 496 | carKey = themeStore.convertRenditionKey(toKeyData: keyList) 497 | if CUIThemeRendition.responds(to: #selector(CUIThemeRendition.init(csiData:forKey:))) { 498 | rendition = CUIThemeRendition(csiData: assetStorage.asset(forKey: carKey!), forKey: keyList) 499 | } else { 500 | rendition = CUIThemeRendition(csiData: assetStorage.asset(forKey: carKey!), forKey: keyList, version: 0)! 501 | } 502 | } 503 | 504 | guard let carKey = carKey else { 505 | throw _Errors.failedToEditItem(lineFailed: #line) 506 | } 507 | 508 | let unslicedSize: CGSize = rendition.unslicedSize() 509 | let renditionLayout = rendition.type == 0 ? Int16(rendition.subtype) : Int16(rendition.type) 510 | guard let generator = CSIGenerator(canvasSize: unslicedSize, sliceCount: 1, layout: renditionLayout), 511 | let wrapper = CSIBitmapWrapper(pixelWidth: UInt32(unslicedSize.width), 512 | pixelHeight: UInt32(unslicedSize.height)) 513 | else { 514 | throw _Errors.failedToEditItem() 515 | } 516 | 517 | if !isAlphaAllowed { 518 | disableAlpha(for: wrapper) 519 | } 520 | 521 | let context = Unmanaged.fromOpaque(wrapper.bitmapContext()).takeUnretainedValue() 522 | 523 | if isInternalLink { 524 | if let existingImage = rendition.unslicedImage()?.takeUnretainedValue() { 525 | context.draw(existingImage, in: CGRect(origin: .zero, size: unslicedSize)) 526 | context.clear(linkRect.insetBy(dx: -2, dy: -2)) // clear the original image and the 2px broader 527 | } 528 | 529 | context.draw(newImage, in: linkRect) 530 | } else { 531 | context.draw(newImage, in: CGRect(origin: .zero, size: unslicedSize)) 532 | } 533 | 534 | //Add Bitmap Wrapper and Set Rendition Properties 535 | generator.addBitmap(wrapper) 536 | generator.addSliceRect(rendition._destinationFrame()) 537 | generator.prepareToEdit(forRendition: rendition) 538 | 539 | guard let csiRep = generator.csiRepresentation(withCompression: true) else { 540 | throw _Errors.failedToEditItem() 541 | } 542 | 543 | assetStorage.setAsset(csiRep, forKey: carKey) 544 | case .color(let cgColor): 545 | let components = try cgColor.components.unwrap("Failed to edit item \(item.name): Failed to get color components of new color.") 546 | let generator = try CSIGenerator(colorNamed: nil, 547 | colorSpaceID: UInt(item.cuiRend.colorSpaceID()), components: components) 548 | .unwrap("Failed to edit item \(item.name): Failed to generate a CSIGenerator in order to edit the item.") 549 | 550 | let csiRepresentation = try generator.csiRepresentation(withCompression: true) 551 | .unwrap("Failed to generate CSI Representation of the new color.") 552 | 553 | let themeStore = _themeStore() 554 | let keyData = try themeStore.convertRenditionKey(toKeyData: item.namedLookup.key.keyList()) 555 | .unwrap("Failed to generate data of new item.") 556 | guard keyStore.setAsset(csiRepresentation, forKey: keyData) else { 557 | throw _Errors.failedToEditItem(description: "Failed to set new data for asset.") 558 | } 559 | default: 560 | assertionFailure("Editing Not Supported") 561 | } 562 | 563 | return keyStore 564 | } 565 | 566 | // so we don't have to repeat code above 567 | private func keyStore(forFileURL fileURL: URL) throws -> CUIMutableCommonAssetStorage { 568 | guard let keyStore = CUIMutableCommonAssetStorage(path: fileURL.path, forWriting: true) else { 569 | throw _Errors.unableToAccessCatalogFile(fileURL: fileURL) 570 | } 571 | 572 | return keyStore 573 | } 574 | 575 | private func writekeyStore(_ keyStore: CUIMutableCommonAssetStorage, to fileURL: URL) throws { 576 | guard keyStore.writeToDisk(compact: true) else { 577 | throw _Errors.unableToWriteToCatalogFile(fileURL: fileURL) 578 | } 579 | } 580 | 581 | private func disableAlpha(for wrapper: CSIBitmapWrapper) { 582 | wrapper.setSourceAlphaInfo(.noneSkipLast) 583 | } 584 | 585 | private enum _Errors: Error, LocalizedError { 586 | case unableToAccessCatalogFile(fileURL: URL) 587 | case unableToWriteToCatalogFile(fileURL: URL) 588 | 589 | // for when `convertRenditionKey` fails 590 | case unableToAccessItemData 591 | 592 | case failedToEditItem(lineFailed: Int = #line, file: String = #file, description: String? = nil) 593 | 594 | var errorDescription: String? { 595 | switch self { 596 | case .unableToAccessCatalogFile(let fileURL): 597 | return "Unable to init CUIMutableCommonAssetStorage for \(fileURL.path)" 598 | case .unableToWriteToCatalogFile(let fileURL): 599 | return "Unable to write to catalog file \(fileURL.lastPathComponent)" 600 | case .unableToAccessItemData: 601 | return "Unable to access data of item" 602 | case .failedToEditItem(let lineFailed, let file, let description): 603 | #if DEBUG 604 | return "Failed to edit item, failed at \(file):\(lineFailed), cause: \(description ?? "Unknown.")" 605 | #else 606 | return "Failed to edit item: \(description ?? "unknown cause. Blame CoreUI!")" 607 | #endif 608 | } 609 | } 610 | } 611 | 612 | } 613 | 614 | private extension CSIGenerator { 615 | func prepareToEdit(forRendition rendition: CUIThemeRendition) { 616 | let flags = rendition.renditionFlags()?.pointee 617 | 618 | name = rendition.name() 619 | blendMode = rendition.blendMode 620 | 621 | colorSpaceID = Int16(rendition.colorSpaceID()) 622 | exifOrientation = rendition.exifOrientation 623 | opacity = rendition.opacity 624 | scaleFactor = UInt32(rendition.scale()) 625 | templateRenderingMode = rendition.templateRenderingMode() 626 | utiType = rendition.utiType() 627 | isVectorBased = rendition.isVectorBased() 628 | excludedFromContrastFilter = Bool(truncating: (flags?.isExcludedFromContrastFilter ?? 0) as NSNumber) 629 | } 630 | } 631 | 632 | struct StringError: Error, LocalizedError { 633 | let description: String 634 | 635 | init(_ description: String) { 636 | self.description = description 637 | } 638 | 639 | var errorDescription: String? { description } 640 | } 641 | 642 | fileprivate extension Optional { 643 | func unwrap(orThrow error: Error) throws -> Wrapped { 644 | guard let self = self else { throw error } 645 | return self 646 | } 647 | 648 | func unwrap(_ error: String) throws -> Wrapped { 649 | return try self.unwrap(orThrow: StringError(error)) 650 | } 651 | 652 | } 653 | 654 | extension CUIBitmapEncoding : CustomStringConvertible { 655 | public var description: String { 656 | switch self { 657 | case .none: 658 | return "uncompressed" 659 | case .RLE: 660 | return "rle" 661 | case .ZIP: 662 | return "zip" 663 | case .LZVN: 664 | return "lzvn" 665 | case .LZFSE: 666 | return "lzfse" 667 | case .JPEG_LZFSE: 668 | return "jpeg-lzfse" 669 | case .blurred: 670 | return "blurred" 671 | case .ASTC: 672 | return "astc" 673 | case .paletteImg: 674 | return "palette-img" 675 | case .HEVC: 676 | return "hevc" 677 | case .deepmapLZFSE: 678 | return "deepmap-lzfse" 679 | case .deepmap2: 680 | return "deepmap2" 681 | case .DXTC: 682 | return "dxtc" 683 | default: 684 | return "(Unknown)" 685 | } 686 | } 687 | } 688 | -------------------------------------------------------------------------------- /Sources/CFrameworks/libarchive/archive_entry.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003-2008 Tim Kientzle 3 | * Copyright (c) 2016 Martin Matuska 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | * 26 | * $FreeBSD: head/lib/libarchive/archive_entry.h 201096 2009-12-28 02:41:27Z kientzle $ 27 | */ 28 | 29 | #ifndef ARCHIVE_ENTRY_H_INCLUDED 30 | #define ARCHIVE_ENTRY_H_INCLUDED 31 | 32 | /* Note: Compiler will complain if this does not match archive.h! */ 33 | #define ARCHIVE_VERSION_NUMBER 3006002 34 | 35 | /* 36 | * Note: archive_entry.h is for use outside of libarchive; the 37 | * configuration headers (config.h, archive_platform.h, etc.) are 38 | * purely internal. Do NOT use HAVE_XXX configuration macros to 39 | * control the behavior of this header! If you must conditionalize, 40 | * use predefined compiler and/or platform macros. 41 | */ 42 | 43 | #include 44 | #include /* for wchar_t */ 45 | #include 46 | #include 47 | 48 | #if defined(_WIN32) && !defined(__CYGWIN__) 49 | #include 50 | #endif 51 | 52 | /* Get a suitable 64-bit integer type. */ 53 | #if !defined(__LA_INT64_T_DEFINED) 54 | # if ARCHIVE_VERSION_NUMBER < 4000000 55 | #define __LA_INT64_T la_int64_t 56 | # endif 57 | #define __LA_INT64_T_DEFINED 58 | # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__) 59 | typedef __int64 la_int64_t; 60 | # else 61 | #include 62 | # if defined(_SCO_DS) || defined(__osf__) 63 | typedef long long la_int64_t; 64 | # else 65 | typedef int64_t la_int64_t; 66 | # endif 67 | # endif 68 | #endif 69 | 70 | /* The la_ssize_t should match the type used in 'struct stat' */ 71 | #if !defined(__LA_SSIZE_T_DEFINED) 72 | /* Older code relied on the __LA_SSIZE_T macro; after 4.0 we'll switch to the typedef exclusively. */ 73 | # if ARCHIVE_VERSION_NUMBER < 4000000 74 | #define __LA_SSIZE_T la_ssize_t 75 | # endif 76 | #define __LA_SSIZE_T_DEFINED 77 | # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__) 78 | # if defined(_SSIZE_T_DEFINED) || defined(_SSIZE_T_) 79 | typedef ssize_t la_ssize_t; 80 | # elif defined(_WIN64) 81 | typedef __int64 la_ssize_t; 82 | # else 83 | typedef long la_ssize_t; 84 | # endif 85 | # else 86 | # include /* ssize_t */ 87 | typedef ssize_t la_ssize_t; 88 | # endif 89 | #endif 90 | 91 | /* Get a suitable definition for mode_t */ 92 | #if ARCHIVE_VERSION_NUMBER >= 3999000 93 | /* Switch to plain 'int' for libarchive 4.0. It's less broken than 'mode_t' */ 94 | # define __LA_MODE_T int 95 | #elif defined(_WIN32) && !defined(__CYGWIN__) && !defined(__BORLANDC__) && !defined(__WATCOMC__) 96 | # define __LA_MODE_T unsigned short 97 | #else 98 | # define __LA_MODE_T mode_t 99 | #endif 100 | 101 | /* Large file support for Android */ 102 | #if defined(__LIBARCHIVE_BUILD) && defined(__ANDROID__) 103 | #include "android_lf.h" 104 | #endif 105 | 106 | /* 107 | * On Windows, define LIBARCHIVE_STATIC if you're building or using a 108 | * .lib. The default here assumes you're building a DLL. Only 109 | * libarchive source should ever define __LIBARCHIVE_BUILD. 110 | */ 111 | #if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC) 112 | # ifdef __LIBARCHIVE_BUILD 113 | # ifdef __GNUC__ 114 | # define __LA_DECL __attribute__((dllexport)) extern 115 | # else 116 | # define __LA_DECL __declspec(dllexport) 117 | # endif 118 | # else 119 | # ifdef __GNUC__ 120 | # define __LA_DECL 121 | # else 122 | # define __LA_DECL __declspec(dllimport) 123 | # endif 124 | # endif 125 | #else 126 | /* Static libraries on all platforms and shared libraries on non-Windows. */ 127 | # define __LA_DECL 128 | #endif 129 | 130 | #if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1 131 | # define __LA_DEPRECATED __attribute__((deprecated)) 132 | #else 133 | # define __LA_DEPRECATED 134 | #endif 135 | 136 | #ifdef __cplusplus 137 | extern "C" { 138 | #endif 139 | 140 | /* 141 | * Description of an archive entry. 142 | * 143 | * You can think of this as "struct stat" with some text fields added in. 144 | * 145 | * TODO: Add "comment", "charset", and possibly other entries that are 146 | * supported by "pax interchange" format. However, GNU, ustar, cpio, 147 | * and other variants don't support these features, so they're not an 148 | * excruciatingly high priority right now. 149 | * 150 | * TODO: "pax interchange" format allows essentially arbitrary 151 | * key/value attributes to be attached to any entry. Supporting 152 | * such extensions may make this library useful for special 153 | * applications (e.g., a package manager could attach special 154 | * package-management attributes to each entry). 155 | */ 156 | struct archive; 157 | struct archive_entry; 158 | 159 | /* 160 | * File-type constants. These are returned from archive_entry_filetype() 161 | * and passed to archive_entry_set_filetype(). 162 | * 163 | * These values match S_XXX defines on every platform I've checked, 164 | * including Windows, AIX, Linux, Solaris, and BSD. They're 165 | * (re)defined here because platforms generally don't define the ones 166 | * they don't support. For example, Windows doesn't define S_IFLNK or 167 | * S_IFBLK. Instead of having a mass of conditional logic and system 168 | * checks to define any S_XXX values that aren't supported locally, 169 | * I've just defined a new set of such constants so that 170 | * libarchive-based applications can manipulate and identify archive 171 | * entries properly even if the hosting platform can't store them on 172 | * disk. 173 | * 174 | * These values are also used directly within some portable formats, 175 | * such as cpio. If you find a platform that varies from these, the 176 | * correct solution is to leave these alone and translate from these 177 | * portable values to platform-native values when entries are read from 178 | * or written to disk. 179 | */ 180 | /* 181 | * In libarchive 4.0, we can drop the casts here. 182 | * They're needed to work around Borland C's broken mode_t. 183 | */ 184 | #define AE_IFMT 0170000 185 | #define AE_IFREG 0100000 186 | #define AE_IFLNK 0120000 187 | #define AE_IFSOCK 0140000 188 | #define AE_IFCHR 0020000 189 | #define AE_IFBLK 0060000 190 | #define AE_IFDIR 0040000 191 | #define AE_IFIFO 0010000 192 | 193 | /* 194 | * Symlink types 195 | */ 196 | #define AE_SYMLINK_TYPE_UNDEFINED 0 197 | #define AE_SYMLINK_TYPE_FILE 1 198 | #define AE_SYMLINK_TYPE_DIRECTORY 2 199 | 200 | /* 201 | * Basic object manipulation 202 | */ 203 | 204 | __LA_DECL struct archive_entry *archive_entry_clear(struct archive_entry *); 205 | /* The 'clone' function does a deep copy; all of the strings are copied too. */ 206 | __LA_DECL struct archive_entry *archive_entry_clone(struct archive_entry *); 207 | __LA_DECL void archive_entry_free(struct archive_entry *); 208 | __LA_DECL struct archive_entry *archive_entry_new(void); 209 | 210 | /* 211 | * This form of archive_entry_new2() will pull character-set 212 | * conversion information from the specified archive handle. The 213 | * older archive_entry_new(void) form is equivalent to calling 214 | * archive_entry_new2(NULL) and will result in the use of an internal 215 | * default character-set conversion. 216 | */ 217 | __LA_DECL struct archive_entry *archive_entry_new2(struct archive *); 218 | 219 | /* 220 | * Retrieve fields from an archive_entry. 221 | * 222 | * There are a number of implicit conversions among these fields. For 223 | * example, if a regular string field is set and you read the _w wide 224 | * character field, the entry will implicitly convert narrow-to-wide 225 | * using the current locale. Similarly, dev values are automatically 226 | * updated when you write devmajor or devminor and vice versa. 227 | * 228 | * In addition, fields can be "set" or "unset." Unset string fields 229 | * return NULL, non-string fields have _is_set() functions to test 230 | * whether they've been set. You can "unset" a string field by 231 | * assigning NULL; non-string fields have _unset() functions to 232 | * unset them. 233 | * 234 | * Note: There is one ambiguity in the above; string fields will 235 | * also return NULL when implicit character set conversions fail. 236 | * This is usually what you want. 237 | */ 238 | __LA_DECL time_t archive_entry_atime(struct archive_entry *); 239 | __LA_DECL long archive_entry_atime_nsec(struct archive_entry *); 240 | __LA_DECL int archive_entry_atime_is_set(struct archive_entry *); 241 | __LA_DECL time_t archive_entry_birthtime(struct archive_entry *); 242 | __LA_DECL long archive_entry_birthtime_nsec(struct archive_entry *); 243 | __LA_DECL int archive_entry_birthtime_is_set(struct archive_entry *); 244 | __LA_DECL time_t archive_entry_ctime(struct archive_entry *); 245 | __LA_DECL long archive_entry_ctime_nsec(struct archive_entry *); 246 | __LA_DECL int archive_entry_ctime_is_set(struct archive_entry *); 247 | __LA_DECL dev_t archive_entry_dev(struct archive_entry *); 248 | __LA_DECL int archive_entry_dev_is_set(struct archive_entry *); 249 | __LA_DECL dev_t archive_entry_devmajor(struct archive_entry *); 250 | __LA_DECL dev_t archive_entry_devminor(struct archive_entry *); 251 | __LA_DECL __LA_MODE_T archive_entry_filetype(struct archive_entry *); 252 | __LA_DECL void archive_entry_fflags(struct archive_entry *, 253 | unsigned long * /* set */, 254 | unsigned long * /* clear */); 255 | __LA_DECL const char *archive_entry_fflags_text(struct archive_entry *); 256 | __LA_DECL la_int64_t archive_entry_gid(struct archive_entry *); 257 | __LA_DECL const char *archive_entry_gname(struct archive_entry *); 258 | __LA_DECL const char *archive_entry_gname_utf8(struct archive_entry *); 259 | __LA_DECL const wchar_t *archive_entry_gname_w(struct archive_entry *); 260 | __LA_DECL const char *archive_entry_hardlink(struct archive_entry *); 261 | __LA_DECL const char *archive_entry_hardlink_utf8(struct archive_entry *); 262 | __LA_DECL const wchar_t *archive_entry_hardlink_w(struct archive_entry *); 263 | __LA_DECL la_int64_t archive_entry_ino(struct archive_entry *); 264 | __LA_DECL la_int64_t archive_entry_ino64(struct archive_entry *); 265 | __LA_DECL int archive_entry_ino_is_set(struct archive_entry *); 266 | __LA_DECL __LA_MODE_T archive_entry_mode(struct archive_entry *); 267 | __LA_DECL time_t archive_entry_mtime(struct archive_entry *); 268 | __LA_DECL long archive_entry_mtime_nsec(struct archive_entry *); 269 | __LA_DECL int archive_entry_mtime_is_set(struct archive_entry *); 270 | __LA_DECL unsigned int archive_entry_nlink(struct archive_entry *); 271 | __LA_DECL const char *archive_entry_pathname(struct archive_entry *); 272 | __LA_DECL const char *archive_entry_pathname_utf8(struct archive_entry *); 273 | __LA_DECL const wchar_t *archive_entry_pathname_w(struct archive_entry *); 274 | __LA_DECL __LA_MODE_T archive_entry_perm(struct archive_entry *); 275 | __LA_DECL dev_t archive_entry_rdev(struct archive_entry *); 276 | __LA_DECL dev_t archive_entry_rdevmajor(struct archive_entry *); 277 | __LA_DECL dev_t archive_entry_rdevminor(struct archive_entry *); 278 | __LA_DECL const char *archive_entry_sourcepath(struct archive_entry *); 279 | __LA_DECL const wchar_t *archive_entry_sourcepath_w(struct archive_entry *); 280 | __LA_DECL la_int64_t archive_entry_size(struct archive_entry *); 281 | __LA_DECL int archive_entry_size_is_set(struct archive_entry *); 282 | __LA_DECL const char *archive_entry_strmode(struct archive_entry *); 283 | __LA_DECL const char *archive_entry_symlink(struct archive_entry *); 284 | __LA_DECL const char *archive_entry_symlink_utf8(struct archive_entry *); 285 | __LA_DECL int archive_entry_symlink_type(struct archive_entry *); 286 | __LA_DECL const wchar_t *archive_entry_symlink_w(struct archive_entry *); 287 | __LA_DECL la_int64_t archive_entry_uid(struct archive_entry *); 288 | __LA_DECL const char *archive_entry_uname(struct archive_entry *); 289 | __LA_DECL const char *archive_entry_uname_utf8(struct archive_entry *); 290 | __LA_DECL const wchar_t *archive_entry_uname_w(struct archive_entry *); 291 | __LA_DECL int archive_entry_is_data_encrypted(struct archive_entry *); 292 | __LA_DECL int archive_entry_is_metadata_encrypted(struct archive_entry *); 293 | __LA_DECL int archive_entry_is_encrypted(struct archive_entry *); 294 | 295 | /* 296 | * Set fields in an archive_entry. 297 | * 298 | * Note: Before libarchive 2.4, there were 'set' and 'copy' versions 299 | * of the string setters. 'copy' copied the actual string, 'set' just 300 | * stored the pointer. In libarchive 2.4 and later, strings are 301 | * always copied. 302 | */ 303 | 304 | __LA_DECL void archive_entry_set_atime(struct archive_entry *, time_t, long); 305 | __LA_DECL void archive_entry_unset_atime(struct archive_entry *); 306 | #if defined(_WIN32) && !defined(__CYGWIN__) 307 | __LA_DECL void archive_entry_copy_bhfi(struct archive_entry *, BY_HANDLE_FILE_INFORMATION *); 308 | #endif 309 | __LA_DECL void archive_entry_set_birthtime(struct archive_entry *, time_t, long); 310 | __LA_DECL void archive_entry_unset_birthtime(struct archive_entry *); 311 | __LA_DECL void archive_entry_set_ctime(struct archive_entry *, time_t, long); 312 | __LA_DECL void archive_entry_unset_ctime(struct archive_entry *); 313 | __LA_DECL void archive_entry_set_dev(struct archive_entry *, dev_t); 314 | __LA_DECL void archive_entry_set_devmajor(struct archive_entry *, dev_t); 315 | __LA_DECL void archive_entry_set_devminor(struct archive_entry *, dev_t); 316 | __LA_DECL void archive_entry_set_filetype(struct archive_entry *, unsigned int); 317 | __LA_DECL void archive_entry_set_fflags(struct archive_entry *, 318 | unsigned long /* set */, unsigned long /* clear */); 319 | /* Returns pointer to start of first invalid token, or NULL if none. */ 320 | /* Note that all recognized tokens are processed, regardless. */ 321 | __LA_DECL const char *archive_entry_copy_fflags_text(struct archive_entry *, 322 | const char *); 323 | __LA_DECL const wchar_t *archive_entry_copy_fflags_text_w(struct archive_entry *, 324 | const wchar_t *); 325 | __LA_DECL void archive_entry_set_gid(struct archive_entry *, la_int64_t); 326 | __LA_DECL void archive_entry_set_gname(struct archive_entry *, const char *); 327 | __LA_DECL void archive_entry_set_gname_utf8(struct archive_entry *, const char *); 328 | __LA_DECL void archive_entry_copy_gname(struct archive_entry *, const char *); 329 | __LA_DECL void archive_entry_copy_gname_w(struct archive_entry *, const wchar_t *); 330 | __LA_DECL int archive_entry_update_gname_utf8(struct archive_entry *, const char *); 331 | __LA_DECL void archive_entry_set_hardlink(struct archive_entry *, const char *); 332 | __LA_DECL void archive_entry_set_hardlink_utf8(struct archive_entry *, const char *); 333 | __LA_DECL void archive_entry_copy_hardlink(struct archive_entry *, const char *); 334 | __LA_DECL void archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *); 335 | __LA_DECL int archive_entry_update_hardlink_utf8(struct archive_entry *, const char *); 336 | __LA_DECL void archive_entry_set_ino(struct archive_entry *, la_int64_t); 337 | __LA_DECL void archive_entry_set_ino64(struct archive_entry *, la_int64_t); 338 | __LA_DECL void archive_entry_set_link(struct archive_entry *, const char *); 339 | __LA_DECL void archive_entry_set_link_utf8(struct archive_entry *, const char *); 340 | __LA_DECL void archive_entry_copy_link(struct archive_entry *, const char *); 341 | __LA_DECL void archive_entry_copy_link_w(struct archive_entry *, const wchar_t *); 342 | __LA_DECL int archive_entry_update_link_utf8(struct archive_entry *, const char *); 343 | __LA_DECL void archive_entry_set_mode(struct archive_entry *, __LA_MODE_T); 344 | __LA_DECL void archive_entry_set_mtime(struct archive_entry *, time_t, long); 345 | __LA_DECL void archive_entry_unset_mtime(struct archive_entry *); 346 | __LA_DECL void archive_entry_set_nlink(struct archive_entry *, unsigned int); 347 | __LA_DECL void archive_entry_set_pathname(struct archive_entry *, const char *); 348 | __LA_DECL void archive_entry_set_pathname_utf8(struct archive_entry *, const char *); 349 | __LA_DECL void archive_entry_copy_pathname(struct archive_entry *, const char *); 350 | __LA_DECL void archive_entry_copy_pathname_w(struct archive_entry *, const wchar_t *); 351 | __LA_DECL int archive_entry_update_pathname_utf8(struct archive_entry *, const char *); 352 | __LA_DECL void archive_entry_set_perm(struct archive_entry *, __LA_MODE_T); 353 | __LA_DECL void archive_entry_set_rdev(struct archive_entry *, dev_t); 354 | __LA_DECL void archive_entry_set_rdevmajor(struct archive_entry *, dev_t); 355 | __LA_DECL void archive_entry_set_rdevminor(struct archive_entry *, dev_t); 356 | __LA_DECL void archive_entry_set_size(struct archive_entry *, la_int64_t); 357 | __LA_DECL void archive_entry_unset_size(struct archive_entry *); 358 | __LA_DECL void archive_entry_copy_sourcepath(struct archive_entry *, const char *); 359 | __LA_DECL void archive_entry_copy_sourcepath_w(struct archive_entry *, const wchar_t *); 360 | __LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *); 361 | __LA_DECL void archive_entry_set_symlink_type(struct archive_entry *, int); 362 | __LA_DECL void archive_entry_set_symlink_utf8(struct archive_entry *, const char *); 363 | __LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *); 364 | __LA_DECL void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *); 365 | __LA_DECL int archive_entry_update_symlink_utf8(struct archive_entry *, const char *); 366 | __LA_DECL void archive_entry_set_uid(struct archive_entry *, la_int64_t); 367 | __LA_DECL void archive_entry_set_uname(struct archive_entry *, const char *); 368 | __LA_DECL void archive_entry_set_uname_utf8(struct archive_entry *, const char *); 369 | __LA_DECL void archive_entry_copy_uname(struct archive_entry *, const char *); 370 | __LA_DECL void archive_entry_copy_uname_w(struct archive_entry *, const wchar_t *); 371 | __LA_DECL int archive_entry_update_uname_utf8(struct archive_entry *, const char *); 372 | __LA_DECL void archive_entry_set_is_data_encrypted(struct archive_entry *, char is_encrypted); 373 | __LA_DECL void archive_entry_set_is_metadata_encrypted(struct archive_entry *, char is_encrypted); 374 | /* 375 | * Routines to bulk copy fields to/from a platform-native "struct 376 | * stat." Libarchive used to just store a struct stat inside of each 377 | * archive_entry object, but this created issues when trying to 378 | * manipulate archives on systems different than the ones they were 379 | * created on. 380 | * 381 | * TODO: On Linux and other LFS systems, provide both stat32 and 382 | * stat64 versions of these functions and all of the macro glue so 383 | * that archive_entry_stat is magically defined to 384 | * archive_entry_stat32 or archive_entry_stat64 as appropriate. 385 | */ 386 | __LA_DECL const struct stat *archive_entry_stat(struct archive_entry *); 387 | __LA_DECL void archive_entry_copy_stat(struct archive_entry *, const struct stat *); 388 | 389 | /* 390 | * Storage for Mac OS-specific AppleDouble metadata information. 391 | * Apple-format tar files store a separate binary blob containing 392 | * encoded metadata with ACL, extended attributes, etc. 393 | * This provides a place to store that blob. 394 | */ 395 | 396 | __LA_DECL const void * archive_entry_mac_metadata(struct archive_entry *, size_t *); 397 | __LA_DECL void archive_entry_copy_mac_metadata(struct archive_entry *, const void *, size_t); 398 | 399 | /* 400 | * Digest routine. This is used to query the raw hex digest for the 401 | * given entry. The type of digest is provided as an argument. 402 | */ 403 | #define ARCHIVE_ENTRY_DIGEST_MD5 0x00000001 404 | #define ARCHIVE_ENTRY_DIGEST_RMD160 0x00000002 405 | #define ARCHIVE_ENTRY_DIGEST_SHA1 0x00000003 406 | #define ARCHIVE_ENTRY_DIGEST_SHA256 0x00000004 407 | #define ARCHIVE_ENTRY_DIGEST_SHA384 0x00000005 408 | #define ARCHIVE_ENTRY_DIGEST_SHA512 0x00000006 409 | 410 | __LA_DECL const unsigned char * archive_entry_digest(struct archive_entry *, int /* type */); 411 | 412 | /* 413 | * ACL routines. This used to simply store and return text-format ACL 414 | * strings, but that proved insufficient for a number of reasons: 415 | * = clients need control over uname/uid and gname/gid mappings 416 | * = there are many different ACL text formats 417 | * = would like to be able to read/convert archives containing ACLs 418 | * on platforms that lack ACL libraries 419 | * 420 | * This last point, in particular, forces me to implement a reasonably 421 | * complete set of ACL support routines. 422 | */ 423 | 424 | /* 425 | * Permission bits. 426 | */ 427 | #define ARCHIVE_ENTRY_ACL_EXECUTE 0x00000001 428 | #define ARCHIVE_ENTRY_ACL_WRITE 0x00000002 429 | #define ARCHIVE_ENTRY_ACL_READ 0x00000004 430 | #define ARCHIVE_ENTRY_ACL_READ_DATA 0x00000008 431 | #define ARCHIVE_ENTRY_ACL_LIST_DIRECTORY 0x00000008 432 | #define ARCHIVE_ENTRY_ACL_WRITE_DATA 0x00000010 433 | #define ARCHIVE_ENTRY_ACL_ADD_FILE 0x00000010 434 | #define ARCHIVE_ENTRY_ACL_APPEND_DATA 0x00000020 435 | #define ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY 0x00000020 436 | #define ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS 0x00000040 437 | #define ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS 0x00000080 438 | #define ARCHIVE_ENTRY_ACL_DELETE_CHILD 0x00000100 439 | #define ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES 0x00000200 440 | #define ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES 0x00000400 441 | #define ARCHIVE_ENTRY_ACL_DELETE 0x00000800 442 | #define ARCHIVE_ENTRY_ACL_READ_ACL 0x00001000 443 | #define ARCHIVE_ENTRY_ACL_WRITE_ACL 0x00002000 444 | #define ARCHIVE_ENTRY_ACL_WRITE_OWNER 0x00004000 445 | #define ARCHIVE_ENTRY_ACL_SYNCHRONIZE 0x00008000 446 | 447 | #define ARCHIVE_ENTRY_ACL_PERMS_POSIX1E \ 448 | (ARCHIVE_ENTRY_ACL_EXECUTE \ 449 | | ARCHIVE_ENTRY_ACL_WRITE \ 450 | | ARCHIVE_ENTRY_ACL_READ) 451 | 452 | #define ARCHIVE_ENTRY_ACL_PERMS_NFS4 \ 453 | (ARCHIVE_ENTRY_ACL_EXECUTE \ 454 | | ARCHIVE_ENTRY_ACL_READ_DATA \ 455 | | ARCHIVE_ENTRY_ACL_LIST_DIRECTORY \ 456 | | ARCHIVE_ENTRY_ACL_WRITE_DATA \ 457 | | ARCHIVE_ENTRY_ACL_ADD_FILE \ 458 | | ARCHIVE_ENTRY_ACL_APPEND_DATA \ 459 | | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY \ 460 | | ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS \ 461 | | ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS \ 462 | | ARCHIVE_ENTRY_ACL_DELETE_CHILD \ 463 | | ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES \ 464 | | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES \ 465 | | ARCHIVE_ENTRY_ACL_DELETE \ 466 | | ARCHIVE_ENTRY_ACL_READ_ACL \ 467 | | ARCHIVE_ENTRY_ACL_WRITE_ACL \ 468 | | ARCHIVE_ENTRY_ACL_WRITE_OWNER \ 469 | | ARCHIVE_ENTRY_ACL_SYNCHRONIZE) 470 | 471 | /* 472 | * Inheritance values (NFS4 ACLs only); included in permset. 473 | */ 474 | #define ARCHIVE_ENTRY_ACL_ENTRY_INHERITED 0x01000000 475 | #define ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT 0x02000000 476 | #define ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT 0x04000000 477 | #define ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT 0x08000000 478 | #define ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY 0x10000000 479 | #define ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS 0x20000000 480 | #define ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS 0x40000000 481 | 482 | #define ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4 \ 483 | (ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT \ 484 | | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT \ 485 | | ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT \ 486 | | ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY \ 487 | | ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS \ 488 | | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS \ 489 | | ARCHIVE_ENTRY_ACL_ENTRY_INHERITED) 490 | 491 | /* We need to be able to specify combinations of these. */ 492 | #define ARCHIVE_ENTRY_ACL_TYPE_ACCESS 0x00000100 /* POSIX.1e only */ 493 | #define ARCHIVE_ENTRY_ACL_TYPE_DEFAULT 0x00000200 /* POSIX.1e only */ 494 | #define ARCHIVE_ENTRY_ACL_TYPE_ALLOW 0x00000400 /* NFS4 only */ 495 | #define ARCHIVE_ENTRY_ACL_TYPE_DENY 0x00000800 /* NFS4 only */ 496 | #define ARCHIVE_ENTRY_ACL_TYPE_AUDIT 0x00001000 /* NFS4 only */ 497 | #define ARCHIVE_ENTRY_ACL_TYPE_ALARM 0x00002000 /* NFS4 only */ 498 | #define ARCHIVE_ENTRY_ACL_TYPE_POSIX1E (ARCHIVE_ENTRY_ACL_TYPE_ACCESS \ 499 | | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) 500 | #define ARCHIVE_ENTRY_ACL_TYPE_NFS4 (ARCHIVE_ENTRY_ACL_TYPE_ALLOW \ 501 | | ARCHIVE_ENTRY_ACL_TYPE_DENY \ 502 | | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \ 503 | | ARCHIVE_ENTRY_ACL_TYPE_ALARM) 504 | 505 | /* Tag values mimic POSIX.1e */ 506 | #define ARCHIVE_ENTRY_ACL_USER 10001 /* Specified user. */ 507 | #define ARCHIVE_ENTRY_ACL_USER_OBJ 10002 /* User who owns the file. */ 508 | #define ARCHIVE_ENTRY_ACL_GROUP 10003 /* Specified group. */ 509 | #define ARCHIVE_ENTRY_ACL_GROUP_OBJ 10004 /* Group who owns the file. */ 510 | #define ARCHIVE_ENTRY_ACL_MASK 10005 /* Modify group access (POSIX.1e only) */ 511 | #define ARCHIVE_ENTRY_ACL_OTHER 10006 /* Public (POSIX.1e only) */ 512 | #define ARCHIVE_ENTRY_ACL_EVERYONE 10107 /* Everyone (NFS4 only) */ 513 | 514 | /* 515 | * Set the ACL by clearing it and adding entries one at a time. 516 | * Unlike the POSIX.1e ACL routines, you must specify the type 517 | * (access/default) for each entry. Internally, the ACL data is just 518 | * a soup of entries. API calls here allow you to retrieve just the 519 | * entries of interest. This design (which goes against the spirit of 520 | * POSIX.1e) is useful for handling archive formats that combine 521 | * default and access information in a single ACL list. 522 | */ 523 | __LA_DECL void archive_entry_acl_clear(struct archive_entry *); 524 | __LA_DECL int archive_entry_acl_add_entry(struct archive_entry *, 525 | int /* type */, int /* permset */, int /* tag */, 526 | int /* qual */, const char * /* name */); 527 | __LA_DECL int archive_entry_acl_add_entry_w(struct archive_entry *, 528 | int /* type */, int /* permset */, int /* tag */, 529 | int /* qual */, const wchar_t * /* name */); 530 | 531 | /* 532 | * To retrieve the ACL, first "reset", then repeatedly ask for the 533 | * "next" entry. The want_type parameter allows you to request only 534 | * certain types of entries. 535 | */ 536 | __LA_DECL int archive_entry_acl_reset(struct archive_entry *, int /* want_type */); 537 | __LA_DECL int archive_entry_acl_next(struct archive_entry *, int /* want_type */, 538 | int * /* type */, int * /* permset */, int * /* tag */, 539 | int * /* qual */, const char ** /* name */); 540 | 541 | /* 542 | * Construct a text-format ACL. The flags argument is a bitmask that 543 | * can include any of the following: 544 | * 545 | * Flags only for archive entries with POSIX.1e ACL: 546 | * ARCHIVE_ENTRY_ACL_TYPE_ACCESS - Include POSIX.1e "access" entries. 547 | * ARCHIVE_ENTRY_ACL_TYPE_DEFAULT - Include POSIX.1e "default" entries. 548 | * ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT - Include "default:" before each 549 | * default ACL entry. 550 | * ARCHIVE_ENTRY_ACL_STYLE_SOLARIS - Output only one colon after "other" and 551 | * "mask" entries. 552 | * 553 | * Flags only for archive entries with NFSv4 ACL: 554 | * ARCHIVE_ENTRY_ACL_STYLE_COMPACT - Do not output the minus character for 555 | * unset permissions and flags in NFSv4 ACL permission and flag fields 556 | * 557 | * Flags for for archive entries with POSIX.1e ACL or NFSv4 ACL: 558 | * ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID - Include extra numeric ID field in 559 | * each ACL entry. 560 | * ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA - Separate entries with comma 561 | * instead of newline. 562 | */ 563 | #define ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID 0x00000001 564 | #define ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT 0x00000002 565 | #define ARCHIVE_ENTRY_ACL_STYLE_SOLARIS 0x00000004 566 | #define ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA 0x00000008 567 | #define ARCHIVE_ENTRY_ACL_STYLE_COMPACT 0x00000010 568 | 569 | __LA_DECL wchar_t *archive_entry_acl_to_text_w(struct archive_entry *, 570 | la_ssize_t * /* len */, int /* flags */); 571 | __LA_DECL char *archive_entry_acl_to_text(struct archive_entry *, 572 | la_ssize_t * /* len */, int /* flags */); 573 | __LA_DECL int archive_entry_acl_from_text_w(struct archive_entry *, 574 | const wchar_t * /* wtext */, int /* type */); 575 | __LA_DECL int archive_entry_acl_from_text(struct archive_entry *, 576 | const char * /* text */, int /* type */); 577 | 578 | /* Deprecated constants */ 579 | #define OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID 1024 580 | #define OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT 2048 581 | 582 | /* Deprecated functions */ 583 | __LA_DECL const wchar_t *archive_entry_acl_text_w(struct archive_entry *, 584 | int /* flags */) __LA_DEPRECATED; 585 | __LA_DECL const char *archive_entry_acl_text(struct archive_entry *, 586 | int /* flags */) __LA_DEPRECATED; 587 | 588 | /* Return bitmask of ACL types in an archive entry */ 589 | __LA_DECL int archive_entry_acl_types(struct archive_entry *); 590 | 591 | /* Return a count of entries matching 'want_type' */ 592 | __LA_DECL int archive_entry_acl_count(struct archive_entry *, int /* want_type */); 593 | 594 | /* Return an opaque ACL object. */ 595 | /* There's not yet anything clients can actually do with this... */ 596 | struct archive_acl; 597 | __LA_DECL struct archive_acl *archive_entry_acl(struct archive_entry *); 598 | 599 | /* 600 | * extended attributes 601 | */ 602 | 603 | __LA_DECL void archive_entry_xattr_clear(struct archive_entry *); 604 | __LA_DECL void archive_entry_xattr_add_entry(struct archive_entry *, 605 | const char * /* name */, const void * /* value */, 606 | size_t /* size */); 607 | 608 | /* 609 | * To retrieve the xattr list, first "reset", then repeatedly ask for the 610 | * "next" entry. 611 | */ 612 | 613 | __LA_DECL int archive_entry_xattr_count(struct archive_entry *); 614 | __LA_DECL int archive_entry_xattr_reset(struct archive_entry *); 615 | __LA_DECL int archive_entry_xattr_next(struct archive_entry *, 616 | const char ** /* name */, const void ** /* value */, size_t *); 617 | 618 | /* 619 | * sparse 620 | */ 621 | 622 | __LA_DECL void archive_entry_sparse_clear(struct archive_entry *); 623 | __LA_DECL void archive_entry_sparse_add_entry(struct archive_entry *, 624 | la_int64_t /* offset */, la_int64_t /* length */); 625 | 626 | /* 627 | * To retrieve the xattr list, first "reset", then repeatedly ask for the 628 | * "next" entry. 629 | */ 630 | 631 | __LA_DECL int archive_entry_sparse_count(struct archive_entry *); 632 | __LA_DECL int archive_entry_sparse_reset(struct archive_entry *); 633 | __LA_DECL int archive_entry_sparse_next(struct archive_entry *, 634 | la_int64_t * /* offset */, la_int64_t * /* length */); 635 | 636 | /* 637 | * Utility to match up hardlinks. 638 | * 639 | * The 'struct archive_entry_linkresolver' is a cache of archive entries 640 | * for files with multiple links. Here's how to use it: 641 | * 1. Create a lookup object with archive_entry_linkresolver_new() 642 | * 2. Tell it the archive format you're using. 643 | * 3. Hand each archive_entry to archive_entry_linkify(). 644 | * That function will return 0, 1, or 2 entries that should 645 | * be written. 646 | * 4. Call archive_entry_linkify(resolver, NULL) until 647 | * no more entries are returned. 648 | * 5. Call archive_entry_linkresolver_free(resolver) to free resources. 649 | * 650 | * The entries returned have their hardlink and size fields updated 651 | * appropriately. If an entry is passed in that does not refer to 652 | * a file with multiple links, it is returned unchanged. The intention 653 | * is that you should be able to simply filter all entries through 654 | * this machine. 655 | * 656 | * To make things more efficient, be sure that each entry has a valid 657 | * nlinks value. The hardlink cache uses this to track when all links 658 | * have been found. If the nlinks value is zero, it will keep every 659 | * name in the cache indefinitely, which can use a lot of memory. 660 | * 661 | * Note that archive_entry_size() is reset to zero if the file 662 | * body should not be written to the archive. Pay attention! 663 | */ 664 | struct archive_entry_linkresolver; 665 | 666 | /* 667 | * There are three different strategies for marking hardlinks. 668 | * The descriptions below name them after the best-known 669 | * formats that rely on each strategy: 670 | * 671 | * "Old cpio" is the simplest, it always returns any entry unmodified. 672 | * As far as I know, only cpio formats use this. Old cpio archives 673 | * store every link with the full body; the onus is on the dearchiver 674 | * to detect and properly link the files as they are restored. 675 | * "tar" is also pretty simple; it caches a copy the first time it sees 676 | * any link. Subsequent appearances are modified to be hardlink 677 | * references to the first one without any body. Used by all tar 678 | * formats, although the newest tar formats permit the "old cpio" strategy 679 | * as well. This strategy is very simple for the dearchiver, 680 | * and reasonably straightforward for the archiver. 681 | * "new cpio" is trickier. It stores the body only with the last 682 | * occurrence. The complication is that we might not 683 | * see every link to a particular file in a single session, so 684 | * there's no easy way to know when we've seen the last occurrence. 685 | * The solution here is to queue one link until we see the next. 686 | * At the end of the session, you can enumerate any remaining 687 | * entries by calling archive_entry_linkify(NULL) and store those 688 | * bodies. If you have a file with three links l1, l2, and l3, 689 | * you'll get the following behavior if you see all three links: 690 | * linkify(l1) => NULL (the resolver stores l1 internally) 691 | * linkify(l2) => l1 (resolver stores l2, you write l1) 692 | * linkify(l3) => l2, l3 (all links seen, you can write both). 693 | * If you only see l1 and l2, you'll get this behavior: 694 | * linkify(l1) => NULL 695 | * linkify(l2) => l1 696 | * linkify(NULL) => l2 (at end, you retrieve remaining links) 697 | * As the name suggests, this strategy is used by newer cpio variants. 698 | * It's noticeably more complex for the archiver, slightly more complex 699 | * for the dearchiver than the tar strategy, but makes it straightforward 700 | * to restore a file using any link by simply continuing to scan until 701 | * you see a link that is stored with a body. In contrast, the tar 702 | * strategy requires you to rescan the archive from the beginning to 703 | * correctly extract an arbitrary link. 704 | */ 705 | 706 | __LA_DECL struct archive_entry_linkresolver *archive_entry_linkresolver_new(void); 707 | __LA_DECL void archive_entry_linkresolver_set_strategy( 708 | struct archive_entry_linkresolver *, int /* format_code */); 709 | __LA_DECL void archive_entry_linkresolver_free(struct archive_entry_linkresolver *); 710 | __LA_DECL void archive_entry_linkify(struct archive_entry_linkresolver *, 711 | struct archive_entry **, struct archive_entry **); 712 | __LA_DECL struct archive_entry *archive_entry_partial_links( 713 | struct archive_entry_linkresolver *res, unsigned int *links); 714 | #ifdef __cplusplus 715 | } 716 | #endif 717 | 718 | /* This is meaningless outside of this header. */ 719 | #undef __LA_DECL 720 | 721 | #endif /* !ARCHIVE_ENTRY_H_INCLUDED */ 722 | -------------------------------------------------------------------------------- /Sources/CFrameworks/CoreUI/CoreUI.tbd: -------------------------------------------------------------------------------- 1 | --- !tapi-tbd 2 | tbd-version: 4 3 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 4 | arm64e-macos, arm64e-maccatalyst, armv7-ios, armv7s-ios, arm64-ios, arm64e-ios ] 5 | install-name: '/System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI' 6 | exports: 7 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 8 | arm64e-macos, arm64e-maccatalyst, armv7-ios, armv7s-ios, arm64-ios, arm64e-ios ] 9 | symbols: [ _CSIEqualMetrics, _CSIIllegalMetrics, _CUIAccumulateSVGShapesIntoJoinedPath, 10 | _CUIAccumulateSVGShapesIntoPath, _CUIBlendModeDescriptionFromCGBlendMode, 11 | _CUIBlendModeLSRDescriptionFromCGBlendMode, _CUICFArrayCreateWithCGRects, 12 | _CUICFDictionaryGetCGRect, _CUICFDictionarySetCFArrayOfCGRects, 13 | _CUICFDictionarySetCGRect, _CUICFDictionarySetSegmentSeparatorTypes, 14 | _CUICFDictionarySetSegmentType, _CUICGBitmapContextCreate, 15 | _CUICGBlendModeFromLSRDescription, _CUICGImageGetAlphaInfo, 16 | _CUICalcNonAlphaAreaOfImage, _CUICalculateExtrusionMaskOfImage, 17 | _CUICatalogLetterpressStylePresetName, _CUIColorCreateFromColorWithSystemEffectOptions, 18 | _CUIColorHistogramARGBIntersection, _CUIColorHistogramARGBIsMonochrome, 19 | _CUICompareRenditionKey, _CUIComputeImageColorHistogramARGB, 20 | _CUIConvertCGImageFormat, _CUIConvertCompressionTypeToString, 21 | _CUIConvertDeepImageTo8, _CUIConvertFromTXRPixelFormat, _CUIConvertImageToPixelFormat, 22 | _CUIConvertPixelFormatToString, _CUIConvertToTXRPixelFormat, 23 | _CUICopyCustomColor, _CUICopyCustomColorWithOptions, _CUICopyCustomFontDescriptor, 24 | _CUICopyMaskShape, _CUICopyMeasurements, _CUICreateDisplayShape, 25 | _CUICreateJoinedPathFromSVGNode, _CUICreateLayerContents, 26 | _CUICreateMenuPath, _CUICreateOrUpdateLayer, _CUICreatePathFromSVGNode, 27 | _CUICreateRenderer, _CUICreateSDFEdgeTextureFromImage, _CUICreateSDFEdgeTexturePixelFormat, 28 | _CUICreateSDFGradientTextureFromImage, _CUICreateSDFGradientTexturePixelFormat, 29 | _CUICreateSubpathArrayFromCGPath, _CUICreateSubpathsFromSVGNode, 30 | _CUICurrentPlatform, _CUIDeallocateRGBAImageBuffer, _CUIDefaultThemeRenditionKeyFormat, 31 | _CUIDraw, _CUIDrawExtrudedImageInContext, _CUIDrawStyledGlyphsAtPositions, 32 | _CUIDrawStyledGlyphsWithAdvances, _CUIEdgeInsetsEqualToEdgeInsets, 33 | _CUIEdgeInsetsFromCGRect, _CUIEdgeInsetsInsetRect, _CUIEdgeInsetsInvalid, 34 | _CUIEdgeInsetsMake, _CUIEdgeInsetsOutsetRect, _CUIEdgeInsetsToCGRect, 35 | _CUIEdgeInsetsValid, _CUIEdgeInsetsZero, _CUIEffectBevelStyleDescription, 36 | _CUIEffectBlendModeDescription, _CUIEqualRenditionKeys, _CUIExists, 37 | _CUIFillCARKeyArrayForRenditionKey, _CUIFillCARKeyArrayForRenditionKey2, 38 | _CUIFillRenditionKeyForCARKeyArray, _CUIGetChannelDataForImage, 39 | _CUIGetCustomFontSize, _CUIGetDebugValue, _CUIGetDeviceArtworkDisplayGamut, 40 | _CUIGetFormatForFeatureSetAndPixelFormat, _CUIGetRGBAImageBuffer, 41 | _CUIGetSVGAttributeUnitScale, _CUIHitTest, _CUIImageCompressedWithColorQuantization, 42 | _CUIImageIsMonochrome, _CUIImageIsWideGamut, _CUIKeyFormatToArrayString, 43 | _CUILogEnableRenditionLog, _CUILogHandle, _CUILogLogToStderr, 44 | _CUILogRenditionLogEnabled, _CUIMaxDimensionForVectorGlyph, 45 | _CUIMaxScaleForTargetPlatform, _CUIMinDimensionForVectorGlyph, 46 | _CUIMinScaleForTargetPlatform, _CUIParseDeploymentTarget, 47 | _CUIPlaceHolderRendition, _CUIPlatformForPlatformString, _CUIPlatformNameForPlatform, 48 | _CUIPointSizeForDimensionForVectorGlyph, _CUIPreferredVectorGlyphConfigurationsForPlatform, 49 | _CUIRendererCopyProperties, _CUIRendererSetProperties, _CUIRenditionKeyCopy, 50 | _CUIRenditionKeyFormatRemoveAttribute, _CUIRenditionKeyHasIdentifier, 51 | _CUIRenditionKeySetValueForAttribute, _CUIRenditionKeyStandardize, 52 | _CUIRenditionKeyTokenCount, _CUIRenditionKeyValueForAttribute, 53 | _CUISDFTexturesSupported, _CUISVGAttributeGetBoolean, _CUISVGNodeCanBeRepresentedAsPath, 54 | _CUISVGNodeGetTransform, _CUISetCustomColorInContext, _CUISetDebugValue, 55 | _CUISetUpContext, _CUISystemTheme, _CUISystemThemeRenditionKeyFormat, 56 | _CUIThemeInfoVersion, _CUIUncompressQuantizedImageData, _CUIWatchSubTypeFallbackOrder, 57 | _CoreUIVersionNumber, __CUILog, __LookupStructuredThemeProvider, 58 | __RegisterThemeProvider, _gColorStatuses, _gColors, _gEffectBevelStyles, 59 | _gEffectBlendModes, _gEffectParameterTypes, _gEffectTypes, 60 | _gMetafontSelectors, _gMetafontSizes, _gRenditionSubtypes, 61 | _gRenditionTypes, _gThemeCompressionTypes, _gThemeDeploymentTargets, 62 | _gThemeDirections, _gThemeDisplayGamuts, _gThemeDrawingLayers, 63 | _gThemeDynamicDisplayModes, _gThemeElements, _gThemeGraphicsFeatureSetClasses, 64 | _gThemeGraphicsFeatureSetClasses_Legacy, _gThemeIdioms, _gThemeMemoryPerformanceClasses, 65 | _gThemeParts, _gThemePresentationStates, _gThemeSizes, _gThemeStates, 66 | _gThemeTemplateRenderingModes, _gThemeTextureFaces, _gThemeTextureInterpretations, 67 | _gThemeTexturePixelFormats, _gThemeTextureRawTypes, _gThemeUISizeClasses, 68 | _gThemeValues, _gThemeVectorGlyphRenderingModes, _gThemeVectorSizes, 69 | _gThemeVectorWeights, _kCUIAlignmentCenter, _kCUIAlignmentMaximum, 70 | _kCUIAlignmentMinimum, _kCUIAnimationFrameKey, _kCUIAnimationStartTimeKey, 71 | _kCUIAnimationTimeKey, _kCUIArrowsOnlyKey, _kCUIArtVariantKey, 72 | _kCUIArtVariantLightContent, _kCUIBackdropCompatibleKey, _kCUIBackgroundAlert, 73 | _kCUIBackgroundDialog, _kCUIBackgroundDocument, _kCUIBackgroundDrawer, 74 | _kCUIBackgroundGroupBox, _kCUIBackgroundGroupBoxOpaque, _kCUIBackgroundKey, 75 | _kCUIBackgroundMenu, _kCUIBackgroundMenuSelected, _kCUIBackgroundMetal, 76 | _kCUIBackgroundModelessDialog, _kCUIBackgroundNotification, 77 | _kCUIBackgroundSecondaryGroupBox, _kCUIBackgroundSecondaryGroupBoxOpaque, 78 | _kCUIBackgroundSheet, _kCUIBackgroundSheetOpaque, _kCUIBackgroundTabPane, 79 | _kCUIBackgroundTabPaneOpaque, _kCUIBackgroundToolbar, _kCUIBackgroundTypeAbsoluteLightBezel, 80 | _kCUIBackgroundTypeAqua, _kCUIBackgroundTypeBorderless, _kCUIBackgroundTypeDark, 81 | _kCUIBackgroundTypeDarkRaised, _kCUIBackgroundTypeDiscreteSelection, 82 | _kCUIBackgroundTypeKey, _kCUIBackgroundTypeLetterpressRaised, 83 | _kCUIBackgroundTypeLight, _kCUIBackgroundTypeLightContent, 84 | _kCUIBackgroundTypeList, _kCUIBackgroundTypeListAlternate, 85 | _kCUIBackgroundTypeListSelected, _kCUIBackgroundTypeLowered, 86 | _kCUIBackgroundTypeMenu, _kCUIBackgroundTypeMenuBar, _kCUIBackgroundTypeMenuBarLight, 87 | _kCUIBackgroundTypeMenuBarRaised, _kCUIBackgroundTypeMenuDark, 88 | _kCUIBackgroundTypeRaised, _kCUIBackgroundTypeSelection, _kCUIBackgroundTypeSelectionLabel, 89 | _kCUIBackgroundTypeSelectionQuaternaryLabel, _kCUIBackgroundTypeSelectionQuinaryLabel, 90 | _kCUIBackgroundTypeSelectionSecondaryLabel, _kCUIBackgroundTypeSelectionTertiaryLabel, 91 | _kCUIBackgroundTypeSourceList, _kCUIBackgroundTypeStateTransform, 92 | _kCUIBackgroundTypeTextured, _kCUIBackgroundTypeTitlebarRaised, 93 | _kCUIBackgroundTypeToolbar, _kCUIBackgroundTypeToolbarStateTransform, 94 | _kCUIBackgroundUnifiedTitle, _kCUIBackgroundUtility, _kCUIBannerBorderStyleBottom, 95 | _kCUIBannerBorderStyleKey, _kCUIBannerBorderStyleTop, _kCUIBannerBorderStyleTopAndBottom, 96 | _kCUIBannerTypeBurn, _kCUIBannerTypeGroup, _kCUIBannerTypeHelp, 97 | _kCUIBannerTypeKey, _kCUIBannerTypeNetwork, _kCUIBannerTypeSearch, 98 | _kCUIBannerTypeShared, _kCUIBannerTypeTrash, _kCUIBezelBrightnessMultiplier, 99 | _kCUIBezelTintColor, _kCUIBlurKey, _kCUIColorDividerSplitterSingleLine, 100 | _kCUIColorEngravedText, _kCUIColorEngravedTextBold, _kCUIColorEngravedTextBoldEtch, 101 | _kCUIColorEngravedTextEtch, _kCUIColorFocusRing, _kCUIColorKey, 102 | _kCUIColorSearchResultsMenuColor, _kCUIColorSearchResultsSeparatorLineColor, 103 | _kCUIColorTemperatureAdjustment, _kCUIColorTextWindow, _kCUIContextSetFillAndStrokeColorKey, 104 | _kCUIContextSetFillColorKey, _kCUIContextSetStrokeColorKey, 105 | _kCUICurveRadiusKey, _kCUIDirectionDown, _kCUIDirectionEast, 106 | _kCUIDirectionKey, _kCUIDirectionLeft, _kCUIDirectionNone, 107 | _kCUIDirectionNorth, _kCUIDirectionRight, _kCUIDirectionSouth, 108 | _kCUIDirectionUp, _kCUIDirectionWest, _kCUIEffectColorFillKey, 109 | _kCUIEffectDarkenKey, _kCUIEffectDimKey, _kCUIEffectEmboss2Key, 110 | _kCUIEffectEmbossKey, _kCUIEffectEngraveEdgesKey, _kCUIEffectEngraveKey, 111 | _kCUIEffectEngraveLightKey, _kCUIEffectGlowKey, _kCUIEffectLiveKey, 112 | _kCUIEffectMenuBarEngraveKey, _kCUIEffectRecolorKey, _kCUIEffectShadowKey, 113 | _kCUIEffectTintKey, _kCUIEffectTypeDetailAccent, _kCUIEffectTypeFocusRing, 114 | _kCUIEffectTypeRowSelection, _kCUIEffectTypeStatefulColorsSystemEffect, 115 | _kCUIEffectTypeTextHighlight, _kCUIEffectsKey, _kCUIEmphasizedKey, 116 | _kCUIFocusInsetKey, _kCUIFocusNoneKey, _kCUIFocusStyleKey, 117 | _kCUIFontSizeTypeControlMiniKey, _kCUIFontSizeTypeControlRegularKey, 118 | _kCUIFontSizeTypeControlSmallKey, _kCUIFontTypeFixedPitchKey, 119 | _kCUIFontTypeMenuBarKey, _kCUIFontTypeMenuKey, _kCUIFontTypeSystemBoldKey, 120 | _kCUIFontTypeSystemKey, _kCUIFontTypeTitleBarKey, _kCUIFontTypeToolTipsKey, 121 | _kCUIFontTypeUserKey, _kCUIForegroundTintColor, _kCUIFrameOnlyKey, 122 | _kCUIGrowBox, _kCUIGrowBoxEmpty, _kCUIHorizontalAlignmentKey, 123 | _kCUIISOnOffStyleKey, _kCUIImageAccounts, _kCUIImageAction, 124 | _kCUIImageActions, _kCUIImageAdd, _kCUIImageAddBookmark, _kCUIImageAddOnTexture, 125 | _kCUIImageAdvanced, _kCUIImageAdvancedPreferences, _kCUIImageAlarm, 126 | _kCUIImageAlertEnabled, _kCUIImageAudioInput, _kCUIImageAudioInputMute, 127 | _kCUIImageAudioInputMuteOverlay, _kCUIImageAudioOutputMute, 128 | _kCUIImageAudioOutputVolumeHigh, _kCUIImageAudioOutputVolumeLow, 129 | _kCUIImageAudioOutputVolumeMed, _kCUIImageAudioOutputVolumeOff, 130 | _kCUIImageAutoFill, _kCUIImageAutoTab, _kCUIImageBluetooth, 131 | _kCUIImageBonjour, _kCUIImageBookmark, _kCUIImageBookmarkLock, 132 | _kCUIImageBookmarks, _kCUIImageBug, _kCUIImageBurning, _kCUIImageCMYKButton, 133 | _kCUIImageCameraDisabled, _kCUIImageCameraDisabledLarge, _kCUIImageCameraDisabledSmall, 134 | _kCUIImageCancel, _kCUIImageCaution, _kCUIImageChildContainer, 135 | _kCUIImageChildContainerEmpty, _kCUIImageChildContainerUnselected, 136 | _kCUIImageCircleAdd, _kCUIImageCircleArrowLeft, _kCUIImageCircleArrowRight, 137 | _kCUIImageCircleDelete, _kCUIImageClippingPicture, _kCUIImageClippingUnknown, 138 | _kCUIImageCloseButton, _kCUIImageColor, _kCUIImageColorPanel, 139 | _kCUIImageColorPickerCrayon, _kCUIImageColorPickerList, _kCUIImageColorPickerSliders, 140 | _kCUIImageColorPickerUser, _kCUIImageColorPickerWheel, _kCUIImageColorProfileButton, 141 | _kCUIImageColorProfileButtonSelected, _kCUIImageColorSwatchResizeDimple, 142 | _kCUIImageColorSyncProfile, _kCUIImageColumnView, _kCUIImageCommunicationAudio, 143 | _kCUIImageCommunicationText, _kCUIImageCommunicationVideo, 144 | _kCUIImageComputer, _kCUIImageCorrectionCross, _kCUIImageCorrectionDot, 145 | _kCUIImageCorrectionESC, _kCUIImageDatePickerCalendarArrowLeft, 146 | _kCUIImageDatePickerCalendarArrowLeftPressed, _kCUIImageDatePickerCalendarArrowRight, 147 | _kCUIImageDatePickerCalendarArrowRightPressed, _kCUIImageDatePickerCalendarHome, 148 | _kCUIImageDatePickerCalendarHomePressed, _kCUIImageDatePickerClockCenter, 149 | _kCUIImageDatePickerClockFace, _kCUIImageDatePickerClockHourHand, 150 | _kCUIImageDatePickerClockHourHandPin, _kCUIImageDatePickerClockMinuteHand, 151 | _kCUIImageDatePickerClockMinuteHandPin, _kCUIImageDatePickerClockSecondHand, 152 | _kCUIImageDatePickerClockSecondHandPin, _kCUIImageDisclosable, 153 | _kCUIImageDisclosableAlternate, _kCUIImageDisclosed, _kCUIImageDisclosedAlternate, 154 | _kCUIImageDotMac, _kCUIImageDotmacLogo, _kCUIImageDropDownIndicator, 155 | _kCUIImageEffect, _kCUIImageEjectMedia, _kCUIImageEnterFullScreen, 156 | _kCUIImageErase, _kCUIImageError, _kCUIImageEveryone, _kCUIImageExecutableBinary, 157 | _kCUIImageExitFullScreen, _kCUIImageExtraBookmarks, _kCUIImageFastForward, 158 | _kCUIImageFileNameKey, _kCUIImageFindWrapIndicator, _kCUIImageFindWrapIndicatorReverse, 159 | _kCUIImageFlowView, _kCUIImageFolder, _kCUIImageFolderBurnable, 160 | _kCUIImageFolderSmart, _kCUIImageFollowLinkFreestanding, _kCUIImageFont, 161 | _kCUIImageFontAndColor, _kCUIImageFontPanel, _kCUIImageFontPanelActionButton, 162 | _kCUIImageFontPanelActionButtonPressed, _kCUIImageFontPanelBlurEffect, 163 | _kCUIImageFontPanelDropEffect, _kCUIImageFontPanelDropEffectPressed, 164 | _kCUIImageFontPanelEffectsDivider, _kCUIImageFontPanelMinusIdle, 165 | _kCUIImageFontPanelMinusPressed, _kCUIImageFontPanelOpacityEffect, 166 | _kCUIImageFontPanelPaperColour, _kCUIImageFontPanelPaperColourPressed, 167 | _kCUIImageFontPanelPlusIdle, _kCUIImageFontPanelPlusPressed, 168 | _kCUIImageFontPanelSliderThumb, _kCUIImageFontPanelSliderThumbPressed, 169 | _kCUIImageFontPanelSliderTrack, _kCUIImageFontPanelSplitterKnob, 170 | _kCUIImageFontPanelSpreadEffect, _kCUIImageFontPanelStrikeEffect, 171 | _kCUIImageFontPanelStrikeEffectPressed, _kCUIImageFontPanelTextColour, 172 | _kCUIImageFontPanelTextColourPressed, _kCUIImageFontPanelUnderlineEffect, 173 | _kCUIImageFontPanelUnderlineEffectPressed, _kCUIImageFullScreenEnter, 174 | _kCUIImageFullScreenExit, _kCUIImageGalleryView, _kCUIImageGeneralPreferences, 175 | _kCUIImageGenericApplication, _kCUIImageGenericDocument, _kCUIImageGenericQuestionMark, 176 | _kCUIImageGenericStationery, _kCUIImageGenericURL, _kCUIImageGetInfo, 177 | _kCUIImageGetInfoOutline, _kCUIImageGoBack, _kCUIImageGoForward, 178 | _kCUIImageGoLeft, _kCUIImageGoLeftSmall, _kCUIImageGoRight, 179 | _kCUIImageGoRightSmall, _kCUIImageGrammarDot, _kCUIImageGreyButton, 180 | _kCUIImageGroup, _kCUIImageHSBButton, _kCUIImageHome, _kCUIImageHourglass, 181 | _kCUIImageIChatTheater, _kCUIImageICloudLocation, _kCUIImageIconAFPServer, 182 | _kCUIImageIconAlertCaution, _kCUIImageIconAlertCautionBadge, 183 | _kCUIImageIconAlertNote, _kCUIImageIconAlertStop, _kCUIImageIconAliasBadge, 184 | _kCUIImageIconAppearanceFolder, _kCUIImageIconAppleExtrasFolder, 185 | _kCUIImageIconAppleLogo, _kCUIImageIconAppleMenu, _kCUIImageIconAppleMenuFolder, 186 | _kCUIImageIconAppleScriptBadge, _kCUIImageIconAppleTalk, _kCUIImageIconAppleTalkZone, 187 | _kCUIImageIconApplicationSupportFolder, _kCUIImageIconApplicationsFolder, 188 | _kCUIImageIconAssistantsFolder, _kCUIImageIconBackwardArrow, 189 | _kCUIImageIconBurning, _kCUIImageIconClipboard, _kCUIImageIconClippingPictureType, 190 | _kCUIImageIconClippingSoundType, _kCUIImageIconClippingTextType, 191 | _kCUIImageIconClippingUnknownType, _kCUIImageIconColorSyncFolder, 192 | _kCUIImageIconComputer, _kCUIImageIconConnectTo, _kCUIImageIconContextualMenuItemsFolder, 193 | _kCUIImageIconControlPanelDisabledFolder, _kCUIImageIconControlPanelFolder, 194 | _kCUIImageIconControlStripModulesFolder, _kCUIImageIconDeleteAlias, 195 | _kCUIImageIconDesktop, _kCUIImageIconDocumentsFolder, _kCUIImageIconDropFolder, 196 | _kCUIImageIconEjectMedia, _kCUIImageIconExtensionsDisabledFolder, 197 | _kCUIImageIconExtensionsFolder, _kCUIImageIconFTPServer, _kCUIImageIconFavoriteItems, 198 | _kCUIImageIconFavoritesFolder, _kCUIImageIconFinder, _kCUIImageIconFontSuitcase, 199 | _kCUIImageIconFontsFolder, _kCUIImageIconForwardArrow, _kCUIImageIconFullTrash, 200 | _kCUIImageIconGenericApplication, _kCUIImageIconGenericCDROM, 201 | _kCUIImageIconGenericComponent, _kCUIImageIconGenericControlPanel, 202 | _kCUIImageIconGenericControlStripModule, _kCUIImageIconGenericDeskAccessory, 203 | _kCUIImageIconGenericDocument, _kCUIImageIconGenericEditionFile, 204 | _kCUIImageIconGenericExtension, _kCUIImageIconGenericFileServer, 205 | _kCUIImageIconGenericFloppy, _kCUIImageIconGenericFolder, 206 | _kCUIImageIconGenericFont, _kCUIImageIconGenericFontScaler, 207 | _kCUIImageIconGenericHardDisk, _kCUIImageIconGenericIDisk, 208 | _kCUIImageIconGenericMoverObject, _kCUIImageIconGenericNetwork, 209 | _kCUIImageIconGenericPCCard, _kCUIImageIconGenericPreferences, 210 | _kCUIImageIconGenericQueryDocument, _kCUIImageIconGenericRAMDisk, 211 | _kCUIImageIconGenericRemovableMedia, _kCUIImageIconGenericSharedLibary, 212 | _kCUIImageIconGenericStationery, _kCUIImageIconGenericSuitcase, 213 | _kCUIImageIconGenericURL, _kCUIImageIconGenericWORM, _kCUIImageIconGenericWindow, 214 | _kCUIImageIconGrid, _kCUIImageIconGroup, _kCUIImageIconGuestUser, 215 | _kCUIImageIconHTTPServer, _kCUIImageIconHelp, _kCUIImageIconHelpFolder, 216 | _kCUIImageIconIPFileServer, _kCUIImageIconInternationResources, 217 | _kCUIImageIconInternationalResources, _kCUIImageIconInternetFolder, 218 | _kCUIImageIconInternetLocationAppleShare, _kCUIImageIconInternetLocationAppleTalkZone, 219 | _kCUIImageIconInternetLocationFTP, _kCUIImageIconInternetLocationFile, 220 | _kCUIImageIconInternetLocationGeneric, _kCUIImageIconInternetLocationHTTP, 221 | _kCUIImageIconInternetLocationMail, _kCUIImageIconInternetLocationNSLNeighborhood, 222 | _kCUIImageIconInternetLocationNews, _kCUIImageIconInternetLocationVNC, 223 | _kCUIImageIconInternetPlugInFolder, _kCUIImageIconInternetSearchSitesFolder, 224 | _kCUIImageIconKeepArranged, _kCUIImageIconKeyboardLayout, 225 | _kCUIImageIconLocalesFolder, _kCUIImageIconLocked, _kCUIImageIconLockedBadge, 226 | _kCUIImageIconMacOSReadMeFolder, _kCUIImageIconMountedBadge, 227 | _kCUIImageIconMountedFolder, _kCUIImageIconNoFiles, _kCUIImageIconNoFolder, 228 | _kCUIImageIconNoWrite, _kCUIImageIconOpenFolder, _kCUIImageIconOwnedFolder, 229 | _kCUIImageIconOwner, _kCUIImageIconPreferencesFolder, _kCUIImageIconPrintMonitorFolder, 230 | _kCUIImageIconPrinterDescriptionFolder, _kCUIImageIconPrinterDriverFolder, 231 | _kCUIImageIconPrivateFolder, _kCUIImageIconProtectedApplicationFolder, 232 | _kCUIImageIconProtectedSystemFolder, _kCUIImageIconPublicFolder, 233 | _kCUIImageIconQuestionMark, _kCUIImageIconRecentApplicationsFolder, 234 | _kCUIImageIconRecentDocumentsFolder, _kCUIImageIconRecentItems, 235 | _kCUIImageIconRecentServersFolder, _kCUIImageIconRightContainerArrow, 236 | _kCUIImageIconScriptingAdditionsFolder, _kCUIImageIconScriptsFolder, 237 | _kCUIImageIconSharedBadge, _kCUIImageIconSharedFolder, _kCUIImageIconSharedLibrariesFolder, 238 | _kCUIImageIconSharingPrivsNotApplicable, _kCUIImageIconSharingPrivsReadOnly, 239 | _kCUIImageIconSharingPrivsReadWrite, _kCUIImageIconSharingPrivsUnknown, 240 | _kCUIImageIconSharingPrivsWritable, _kCUIImageIconShortcut, 241 | _kCUIImageIconShutdownItemsDisabledFolder, _kCUIImageIconShutdownItemsFolder, 242 | _kCUIImageIconSortAscending, _kCUIImageIconSortDescending, 243 | _kCUIImageIconSoundFile, _kCUIImageIconSpeakableItemsFolder, 244 | _kCUIImageIconStartupItemsDisabledFolder, _kCUIImageIconStartupItemsFolder, 245 | _kCUIImageIconSystemExtensionDisabledFolder, _kCUIImageIconSystemFolder, 246 | _kCUIImageIconSystemSuitcase, _kCUIImageIconTextEncodingsFolder, 247 | _kCUIImageIconToolbarCustomize, _kCUIImageIconToolbarDelete, 248 | _kCUIImageIconToolbarFavorites, _kCUIImageIconToolbarHome, 249 | _kCUIImageIconTrash, _kCUIImageIconTrueTypeFlatFont, _kCUIImageIconTrueTypeFont, 250 | _kCUIImageIconTrueTypeMultiFlatFont, _kCUIImageIconUnknownFSObject, 251 | _kCUIImageIconUnlocked, _kCUIImageIconUser, _kCUIImageIconUserFolder, 252 | _kCUIImageIconUserIDisk, _kCUIImageIconUsersFolder, _kCUIImageIconUtilitiesFolder, 253 | _kCUIImageIconView, _kCUIImageIconVoicesFolder, _kCUIImageIconWorkgroupFolder, 254 | _kCUIImageIndeterminateProgress, _kCUIImageInfo, _kCUIImageInternetLocationAFP, 255 | _kCUIImageInternetLocationFTP, _kCUIImageInternetLocationFile, 256 | _kCUIImageInternetLocationGeneric, _kCUIImageInternetLocationHTTP, 257 | _kCUIImageInternetLocationMAILTO, _kCUIImageInternetLocationNEWS, 258 | _kCUIImageInternetLocationNSLNeighborhood, _kCUIImageInternetLocationVNC, 259 | _kCUIImageInvalidData, _kCUIImageInvalidDataFreestanding, 260 | _kCUIImageIsGrayscaleKey, _kCUIImageKEXT, _kCUIImageLabelsPreferences, 261 | _kCUIImageLayerReferenceKey, _kCUIImageLeftFacingTriangle, 262 | _kCUIImageLegacyScrollerCorner, _kCUIImageLegacyScrollerCornerSmall, 263 | _kCUIImageLinenBackgroundPattern, _kCUIImageLink, _kCUIImageListView, 264 | _kCUIImageLockLocked, _kCUIImageLockUnlocked, _kCUIImageMagnificationLevel, 265 | _kCUIImageMagnifyingGlass, _kCUIImageManualTab, _kCUIImageMarkup, 266 | _kCUIImageMediaBrowserIcon, _kCUIImageMediaBrowserMediaTypeAudio, 267 | _kCUIImageMediaBrowserMediaTypeAudioTemplate16, _kCUIImageMediaBrowserMediaTypeAudioTemplate18, 268 | _kCUIImageMediaBrowserMediaTypeAudioTemplate32, _kCUIImageMediaBrowserMediaTypeMovies, 269 | _kCUIImageMediaBrowserMediaTypeMoviesTemplate16, _kCUIImageMediaBrowserMediaTypeMoviesTemplate18, 270 | _kCUIImageMediaBrowserMediaTypeMoviesTemplate32, _kCUIImageMediaBrowserMediaTypePhotos, 271 | _kCUIImageMediaBrowserMediaTypePhotosTemplate16, _kCUIImageMediaBrowserMediaTypePhotosTemplate18, 272 | _kCUIImageMediaBrowserMediaTypePhotosTemplate32, _kCUIImageMenuCheckmark, 273 | _kCUIImageMenuItemBullet, _kCUIImageMenuItemDiamond, _kCUIImageMenuMixedState, 274 | _kCUIImageMenuOnState, _kCUIImageMenuScrollDown, _kCUIImageMenuScrollUp, 275 | _kCUIImageMenuSubmenu, _kCUIImageMenuSubmenuLeft, _kCUIImageMobileMe, 276 | _kCUIImageMoveSplitterDown, _kCUIImageMoveSplitterLeft, _kCUIImageMoveSplitterRight, 277 | _kCUIImageMoveSplitterUp, _kCUIImageMultipleDocuments, _kCUIImageMultipleItems, 278 | _kCUIImageMysteryDocument, _kCUIImageNameKey, _kCUIImageNavEjectButtonNormal, 279 | _kCUIImageNavEjectButtonNormalSelected, _kCUIImageNavEjectButtonPressed, 280 | _kCUIImageNavEjectButtonRollover, _kCUIImageNavEjectButtonSmallNormal, 281 | _kCUIImageNavEjectButtonSmallNormalSelected, _kCUIImageNavEjectButtonSmallPressed, 282 | _kCUIImageNavEjectButtonSmallRollover, _kCUIImageNetwork, 283 | _kCUIImageNewFolder, _kCUIImageNewMessage, _kCUIImageNoCacheKey, 284 | _kCUIImageOffline, _kCUIImagePath, _kCUIImagePathIndicator, 285 | _kCUIImagePathLocationArrow, _kCUIImagePause, _kCUIImagePauseQTPrivate, 286 | _kCUIImagePerson, _kCUIImagePersonAnonymous, _kCUIImagePersonUnknown, 287 | _kCUIImagePhotograph, _kCUIImagePlay, _kCUIImagePreferencesGeneral, 288 | _kCUIImagePresentationStart, _kCUIImagePrint, _kCUIImagePrivateArrowNext, 289 | _kCUIImagePrivateArrowPrevious, _kCUIImagePrivateChapters, 290 | _kCUIImagePropertyFlipsHorizontally, _kCUIImagePulldownArrowSmall, 291 | _kCUIImageQuickLook, _kCUIImageQuickLookStart, _kCUIImageRGBButton, 292 | _kCUIImageRecordStart, _kCUIImageRecordStop, _kCUIImageReferenceKey, 293 | _kCUIImageRefresh, _kCUIImageRefreshFreestanding, _kCUIImageReload, 294 | _kCUIImageRemove, _kCUIImageRemoveOnTexture, _kCUIImageRevealFreestanding, 295 | _kCUIImageRewind, _kCUIImageRightFacingTriangle, _kCUIImageRulerIndentFirstLine, 296 | _kCUIImageRulerIndentLine, _kCUIImageRulerTabCenter, _kCUIImageRulerTabDecimal, 297 | _kCUIImageRulerTabLeft, _kCUIImageRulerTabRight, _kCUIImageScript, 298 | _kCUIImageSearchMagGlass, _kCUIImageSearchMagGlassWithArrow, 299 | _kCUIImageSecurity, _kCUIImageSecurityLockLocked, _kCUIImageSecurityLockUnlocked, 300 | _kCUIImageShare, _kCUIImageShowsValueKey, _kCUIImageSidebar, 301 | _kCUIImageSidebarBurning, _kCUIImageSidebarPreferences, _kCUIImageSkipAhead, 302 | _kCUIImageSkipAhead15Seconds, _kCUIImageSkipAhead30Seconds, 303 | _kCUIImageSkipBack, _kCUIImageSkipBack15Seconds, _kCUIImageSkipBack30Seconds, 304 | _kCUIImageSkipToEnd, _kCUIImageSkipToStart, _kCUIImageSlideshow, 305 | _kCUIImageSmallMagnifyingGlass, _kCUIImageSmartBadge, _kCUIImageSnapback, 306 | _kCUIImageSpellingDot, _kCUIImageStatusAvailable, _kCUIImageStatusAvailableFlat, 307 | _kCUIImageStatusAway, _kCUIImageStatusAwayFlat, _kCUIImageStatusIdle, 308 | _kCUIImageStatusIdleFlat, _kCUIImageStatusInvisible, _kCUIImageStatusMobile, 309 | _kCUIImageStatusNone, _kCUIImageStatusNoneFlat, _kCUIImageStatusOffline, 310 | _kCUIImageStatusOfflineFlat, _kCUIImageStatusPartiallyAvailable, 311 | _kCUIImageStatusPartiallyAvailableFlat, _kCUIImageStatusUnavailable, 312 | _kCUIImageStatusUnavailableFlat, _kCUIImageStatusUnknown, 313 | _kCUIImageStatusUnknownFlat, _kCUIImageStepNext, _kCUIImageStepPrevious, 314 | _kCUIImageStillCamera, _kCUIImageStop, _kCUIImageStopProgress, 315 | _kCUIImageStopProgressFreestanding, _kCUIImageSynchronize, 316 | _kCUIImageSynchronizeConflict, _kCUIImageSynchronizeStart, 317 | _kCUIImageTextBigger, _kCUIImageTextCenterAlign, _kCUIImageTextCenterAlignMini, 318 | _kCUIImageTextCenterAlignSmall, _kCUIImageTextEmojiPicker, 319 | _kCUIImageTextJustifiedAlign, _kCUIImageTextJustifiedAlignMini, 320 | _kCUIImageTextJustifiedAlignSmall, _kCUIImageTextLeftAlign, 321 | _kCUIImageTextLeftAlignMini, _kCUIImageTextLeftAlignSmall, 322 | _kCUIImageTextList, _kCUIImageTextListMini, _kCUIImageTextListSmall, 323 | _kCUIImageTextRightAlign, _kCUIImageTextRightAlignMini, _kCUIImageTextRightAlignSmall, 324 | _kCUIImageTextRulerCenterTab, _kCUIImageTextRulerDecimalTab, 325 | _kCUIImageTextRulerFirstLineIndent, _kCUIImageTextRulerIndent, 326 | _kCUIImageTextRulerLeftTab, _kCUIImageTextRulerRightTab, _kCUIImageTextSmaller, 327 | _kCUIImageTexturedFullScreenBackgroundColor, _kCUIImageTheaterStart, 328 | _kCUIImageTintKey, _kCUIImageTitlebarEnterFullScreen, _kCUIImageTitlebarExitFullScreen, 329 | _kCUIImageTokenPopDownArrow, _kCUIImageToolbarArrangeBy, _kCUIImageToolbarAudioInput, 330 | _kCUIImageToolbarBookmarks, _kCUIImageToolbarClipIndicator, 331 | _kCUIImageToolbarCompose, _kCUIImageToolbarCustomize, _kCUIImageToolbarCustomizeToolbarItemImage, 332 | _kCUIImageToolbarDelete, _kCUIImageToolbarEjectMedia, _kCUIImageToolbarFlexibleSpace, 333 | _kCUIImageToolbarFlexibleSpaceItemPaletteRep, _kCUIImageToolbarFolder, 334 | _kCUIImageToolbarFolderCopyTo, _kCUIImageToolbarFolderMoveTo, 335 | _kCUIImageToolbarGetInfo, _kCUIImageToolbarHistory, _kCUIImageToolbarMail, 336 | _kCUIImageToolbarMore, _kCUIImageToolbarNewFolder, _kCUIImageToolbarPrint, 337 | _kCUIImageToolbarPrintItemImage, _kCUIImageToolbarReply, _kCUIImageToolbarReplyAll, 338 | _kCUIImageToolbarRotateLeft, _kCUIImageToolbarRotateRight, 339 | _kCUIImageToolbarSafari, _kCUIImageToolbarShowColors, _kCUIImageToolbarShowColorsItemImage, 340 | _kCUIImageToolbarShowFonts, _kCUIImageToolbarShowFontsItemImage, 341 | _kCUIImageToolbarSpace, _kCUIImageToolbarSpaceItemPaletteRep, 342 | _kCUIImageToolbarSpaceSmall, _kCUIImageToolbarStop, _kCUIImageToolbarTagIcon, 343 | _kCUIImageToolbarTextBox, _kCUIImageToolbarUser, _kCUIImageToolbarUserAdd, 344 | _kCUIImageToolbarUserGroup, _kCUIImageTransferDownload, _kCUIImageTransferShow, 345 | _kCUIImageTransferShowInfo, _kCUIImageTrashEmpty, _kCUIImageTrashFull, 346 | _kCUIImageUnknownObject, _kCUIImageUnreadIndicator, _kCUIImageUnreadIndicatorSelected, 347 | _kCUIImageUser, _kCUIImageUserAccounts, _kCUIImageUserGroup, 348 | _kCUIImageUserGuest, _kCUIImageVideoCamera, _kCUIImageVideoCameraLarge, 349 | _kCUIImageVideoCameraSmall, _kCUIImageViewColumns, _kCUIImageViewCoverFlow, 350 | _kCUIImageViewGroups, _kCUIImageViewIcons, _kCUIImageViewList, 351 | _kCUIIndicatorOnlyKey, _kCUIIsDarkKey, _kCUIIsDropTargetKey, 352 | _kCUIIsFlippedKey, _kCUIIsFocusedKey, _kCUILabelBaseline, 353 | _kCUILabelRect, _kCUIMaskOnlyKey, _kCUIMaximumValueKey, _kCUIMeasureAlignmentRect, 354 | _kCUIMeasureAllowsTinting, _kCUIMeasureAuthoringProperties, 355 | _kCUIMeasureAuxiliary1Bounds, _kCUIMeasureAuxiliary1InsetBottomLeft, 356 | _kCUIMeasureAuxiliary1InsetTopRight, _kCUIMeasureAuxiliary2Bounds, 357 | _kCUIMeasureAuxiliary2InsetBottomLeft, _kCUIMeasureAuxiliary2InsetTopRight, 358 | _kCUIMeasureBaseline, _kCUIMeasureBlendMode, _kCUIMeasureCarbonBounds, 359 | _kCUIMeasureColor, _kCUIMeasureCompositingFilter, _kCUIMeasureContentBounds, 360 | _kCUIMeasureContentInsetBottomLeft, _kCUIMeasureContentInsetTopRight, 361 | _kCUIMeasureDefaultHeight, _kCUIMeasureDefaultWidth, _kCUIMeasureEdgeInsetBottomLeft, 362 | _kCUIMeasureEdgeInsetTopRight, _kCUIMeasureFrameRate, _kCUIMeasureHasOpaqueContentBounds, 363 | _kCUIMeasureHeight, _kCUIMeasureImageEffects, _kCUIMeasureIsGrayscale, 364 | _kCUIMeasureMinimumAlpha, _kCUIMeasurePart, _kCUIMeasureScalesHorizontally, 365 | _kCUIMeasureScalesVertically, _kCUIMeasureSeparatorSize, _kCUIMeasureToolbarSpaceSmallWidth, 366 | _kCUIMeasureWidth, _kCUIMeasureWindowFrameRimDensity, _kCUIMeasureWindowFrameRimStyleHard, 367 | _kCUIMenuPartBackground, _kCUIMenuPartItem, _kCUIMenuPartSeparator, 368 | _kCUIMenuPartTitle, _kCUIMinimumValueKey, _kCUINoArrowsKey, 369 | _kCUINoFrameKey, _kCUINoIndicatorKey, _kCUINothingToScrollKey, 370 | _kCUINotificationAquaColorVariantChanged, _kCUINotificationReduceDesktopTintingChanged, 371 | _kCUIOffsetXKey, _kCUIOffsetYKey, _kCUIOrientHorizontal, _kCUIOrientVertical, 372 | _kCUIOrientationKey, _kCUIPartMaskKey, _kCUIPenKey, _kCUIPopoverAnchorLengthKey, 373 | _kCUIPopoverAnchorOffsetKey, _kCUIPopoverAnchorPositionKey, 374 | _kCUIPopoverAnchorWidthKey, _kCUIPopoverShouldInsetForAnchorKey, 375 | _kCUIPopoverVerticalRangesForAreasOfInterestKey, _kCUIPositionKey, 376 | _kCUIPresentationStateActiveKey, _kCUIPresentationStateActiveMain, 377 | _kCUIPresentationStateInactive, _kCUIPresentationStateKey, 378 | _kCUIPressedPartKey, _kCUIPreviousStateKey, _kCUIPreviousValueKey, 379 | _kCUIQuartzPen, _kCUIRangeSelectorKindDualHandle, _kCUIRangeSelectorKindKey, 380 | _kCUIRangeSelectorKindMonoHandle, _kCUIRangeSelectorKindNoHandle, 381 | _kCUIRangeSelectorKindSingleHandle, _kCUIRectanglesKey, _kCUIRendererAllowsCustomTintColors, 382 | _kCUIRendererAllowsSystemTintColors, _kCUIRendererAllowsVibrancyKey, 383 | _kCUIRendererAlternateSystemThemeKey, _kCUIRendererAlternateSystemThemeWhiteControls, 384 | _kCUIRendererBundleResourceName, _kCUIRendererDefaultBlendModeKey, 385 | _kCUIRendererSupportsBrightnessAdjustmentsKey, _kCUIRendererSupportsWhitePointAdjustmentsKey, 386 | _kCUIRendererThemeFileBundleIdentifierKey, _kCUIRendererThemeFileNameKey, 387 | _kCUIRendererThemeFileURLKey, _kCUIRequestedAppearanceNamesKey, 388 | _kCUIScaleKey, _kCUIScrollArrowDown, _kCUIScrollArrowInsideDown, 389 | _kCUIScrollArrowInsideLeft, _kCUIScrollArrowInsideRight, _kCUIScrollArrowInsideUp, 390 | _kCUIScrollArrowLeft, _kCUIScrollArrowRight, _kCUIScrollArrowUp, 391 | _kCUIScrollThumb, _kCUIScrollTrack, _kCUIScrollTrackDown, 392 | _kCUIScrollTrackLeft, _kCUIScrollTrackRight, _kCUIScrollTrackUp, 393 | _kCUISegmentLeadingSeparatorKey, _kCUISegmentLeadingSeparatorTypeKey, 394 | _kCUISegmentPositionFirst, _kCUISegmentPositionLast, _kCUISegmentPositionMiddle, 395 | _kCUISegmentPositionOnly, _kCUISegmentSeparatorTypeBothSelected, 396 | _kCUISegmentSeparatorTypeLeftPressed, _kCUISegmentSeparatorTypeLeftPressedSelected, 397 | _kCUISegmentSeparatorTypeLeftRollover, _kCUISegmentSeparatorTypeLeftSelected, 398 | _kCUISegmentSeparatorTypeNoneSelected, _kCUISegmentSeparatorTypeRightPressed, 399 | _kCUISegmentSeparatorTypeRightPressedSelected, _kCUISegmentSeparatorTypeRightRollover, 400 | _kCUISegmentSeparatorTypeRightSelected, _kCUISegmentTrailingSeparatorKey, 401 | _kCUISegmentTrailingSeparatorTypeKey, _kCUISeparatorStyleBottom, 402 | _kCUISeparatorStyleInner, _kCUISeparatorStyleKey, _kCUISeparatorStyleTitle, 403 | _kCUISizeKey, _kCUISizeLarge, _kCUISizeMini, _kCUISizeRegular, 404 | _kCUISizeSmall, _kCUISliderHasIconMax, _kCUISliderHasIconMin, 405 | _kCUISliderTrackDrawTintedKey, _kCUIStateActive, _kCUIStateDeeplyPressed, 406 | _kCUIStateDisabled, _kCUIStateDrag, _kCUIStateHighlighted, 407 | _kCUIStateInactive, _kCUIStateKey, _kCUIStatePressed, _kCUIStatePulsed, 408 | _kCUIStateRollover, _kCUITextGlyphBrightnessMultiplier, _kCUIThumbIsGhostKey, 409 | _kCUIThumbProportionKey, _kCUIThumbWidthKey, _kCUITickMarkCountKey, 410 | _kCUITickMarkSetKey, _kCUITintBlueKey, _kCUITintClearKey, 411 | _kCUITintGraphiteKey, _kCUITintKey, _kCUIUserInterfaceLayoutDirectionKey, 412 | _kCUIUserInterfaceLayoutDirectionLeftToRight, _kCUIUserInterfaceLayoutDirectionRightToLeft, 413 | _kCUIValueKey, _kCUIVariantAlertMaterial, _kCUIVariantAlertSheetMaterial, 414 | _kCUIVariantBlack, _kCUIVariantComboButton, _kCUIVariantContentBackgroundMaterial, 415 | _kCUIVariantContextMenuSelectionMaterial, _kCUIVariantDesktopStackMaterial, 416 | _kCUIVariantDividerSplitterDimple, _kCUIVariantDividerSplitterDimpleInset, 417 | _kCUIVariantDividerSplitterRod, _kCUIVariantDividerSplitterRodMail, 418 | _kCUIVariantFill, _kCUIVariantForm, _kCUIVariantFullScreenUIMaterial, 419 | _kCUIVariantGradientFindBar, _kCUIVariantGradientFinderInfo, 420 | _kCUIVariantGradientFinderSideBar, _kCUIVariantGradientFreeform, 421 | _kCUIVariantGradientListBackgroundEven, _kCUIVariantGradientListBackgroundOdd, 422 | _kCUIVariantGradientScopeBackgroundBar, _kCUIVariantGradientScopeBackgroundEven, 423 | _kCUIVariantGradientScopeBackgroundOdd, _kCUIVariantGradientSideBar, 424 | _kCUIVariantGradientSideBarSelection, _kCUIVariantGradientSideBarSelectionMultiple, 425 | _kCUIVariantGrowBoxEmpty, _kCUIVariantHUDControlsBackgroundMaterial, 426 | _kCUIVariantHUDWindowMaterial, _kCUIVariantHeaderList, _kCUIVariantHeaderMaterial, 427 | _kCUIVariantHeaderWindow, _kCUIVariantInlineSidebarMaterial, 428 | _kCUIVariantInlineTitlebarMaterial, _kCUIVariantInverted, 429 | _kCUIVariantKey, _kCUIVariantLightMaterial, _kCUIVariantLoginWindowControlMaterial, 430 | _kCUIVariantMacDarkMaterial, _kCUIVariantMacLightMaterial, 431 | _kCUIVariantMacMediumDarkMaterial, _kCUIVariantMacMediumLightMaterial, 432 | _kCUIVariantMacUltradarkMaterial, _kCUIVariantMacUltralightMaterial, 433 | _kCUIVariantMenuBarDarkGlossy, _kCUIVariantMenuBarDarkMatte, 434 | _kCUIVariantMenuBarMaterial, _kCUIVariantMenuBarMenuMaterial, 435 | _kCUIVariantMenuBarOpaque, _kCUIVariantMenuBarSelectionMaterial, 436 | _kCUIVariantMenuDock, _kCUIVariantMenuHelpResults, _kCUIVariantMenuHierarchical, 437 | _kCUIVariantMenuItemHelpResults, _kCUIVariantMenuItemSearch, 438 | _kCUIVariantMenuItemSearchResults, _kCUIVariantMenuMaterial, 439 | _kCUIVariantMenuPopup, _kCUIVariantMenuPulldown, _kCUIVariantMenuSearchResults, 440 | _kCUIVariantMenuSelectionMaterial, _kCUIVariantMenuTitleApple, 441 | _kCUIVariantMenuTitleHelp, _kCUIVariantMetal, _kCUIVariantNotificationCenterBackgroundMaterial, 442 | _kCUIVariantOpaque, _kCUIVariantOverlayBackingMaterial, _kCUIVariantPopoverLabelMaterial, 443 | _kCUIVariantPopoverMaterial, _kCUIVariantPulldownButton, _kCUIVariantScrollBarArrowsDoubleBoth, 444 | _kCUIVariantScrollBarArrowsDoubleMax, _kCUIVariantScrollBarArrowsDoubleMin, 445 | _kCUIVariantScrollBarArrowsNone, _kCUIVariantScrollBarArrowsSingle, 446 | _kCUIVariantSeamlessTitlebarMaterial, _kCUIVariantSeamlessWindowTitlebarMaterial, 447 | _kCUIVariantSelectionMaterial, _kCUIVariantSheetMaterial, 448 | _kCUIVariantSheetUnderlayMaterial, _kCUIVariantSidebarMaterial, 449 | _kCUIVariantSpotlightBackgroundMaterial, _kCUIVariantStroke, 450 | _kCUIVariantStyledRectsLabel, _kCUIVariantStyledRectsLabelWithShadow, 451 | _kCUIVariantSystemBezelMaterial, _kCUIVariantTabPaneOpaque, 452 | _kCUIVariantTextContent, _kCUIVariantTextFieldRoundToolbar, 453 | _kCUIVariantTextFieldToolbar, _kCUIVariantTintable, _kCUIVariantTintableDefault, 454 | _kCUIVariantTitlebarMaterial, _kCUIVariantToolTipMaterial, 455 | _kCUIVariantToolbarConfiguration, _kCUIVariantTranslucent, 456 | _kCUIVariantUltraDark, _kCUIVariantUltralightMaterial, _kCUIVariantUnderPageBackgroundMaterial, 457 | _kCUIVariantUnderWindowBackgroundMaterial, _kCUIVariantWhite, 458 | _kCUIVariantWindowBackgroundMaterial, _kCUIVariantWindowNonKey, 459 | _kCUIVariantWithMenuGlyph, _kCUIVerticalAlignmentKey, _kCUIViewSizeKey, 460 | _kCUIWidgetBackground, _kCUIWidgetBanner, _kCUIWidgetButtonBevel, 461 | _kCUIWidgetButtonBevelInset, _kCUIWidgetButtonBevelPopupArrow, 462 | _kCUIWidgetButtonBevelRound, _kCUIWidgetButtonCheckBox, _kCUIWidgetButtonComboBox, 463 | _kCUIWidgetButtonComboBoxForm, _kCUIWidgetButtonComboBoxInset, 464 | _kCUIWidgetButtonComboBoxTextured, _kCUIWidgetButtonComboBoxToolbar, 465 | _kCUIWidgetButtonDisclosure, _kCUIWidgetButtonListHeader, 466 | _kCUIWidgetButtonLittleArrows, _kCUIWidgetButtonNavBanner, 467 | _kCUIWidgetButtonPopDown, _kCUIWidgetButtonPopDownForm, _kCUIWidgetButtonPopDownInset, 468 | _kCUIWidgetButtonPopDownSlideshow, _kCUIWidgetButtonPopDownSquare, 469 | _kCUIWidgetButtonPopDownTextured, _kCUIWidgetButtonPopDownToolbar, 470 | _kCUIWidgetButtonPopUp, _kCUIWidgetButtonPopUpArrowsSubpart, 471 | _kCUIWidgetButtonPopUpEndcapSubpart, _kCUIWidgetButtonPopUpForm, 472 | _kCUIWidgetButtonPopUpInset, _kCUIWidgetButtonPopUpSquare, 473 | _kCUIWidgetButtonPopUpTextured, _kCUIWidgetButtonPopUpToolbar, 474 | _kCUIWidgetButtonPush, _kCUIWidgetButtonPushInset, _kCUIWidgetButtonPushInset2, 475 | _kCUIWidgetButtonPushProgressSpinner, _kCUIWidgetButtonPushRecessedTitlebar, 476 | _kCUIWidgetButtonPushScope, _kCUIWidgetButtonPushScope2, _kCUIWidgetButtonPushSlideshow, 477 | _kCUIWidgetButtonPushTextured, _kCUIWidgetButtonPushToolbar, 478 | _kCUIWidgetButtonRadio, _kCUIWidgetButtonRecessedPullDown, 479 | _kCUIWidgetButtonRound, _kCUIWidgetButtonRoundHelp, _kCUIWidgetButtonRoundInset, 480 | _kCUIWidgetButtonRoundInset2, _kCUIWidgetButtonRoundTextured, 481 | _kCUIWidgetButtonRoundToolbar, _kCUIWidgetButtonSearchFieldCancel, 482 | _kCUIWidgetButtonSearchFieldFind, _kCUIWidgetButtonSegmented, 483 | _kCUIWidgetButtonSegmentedInset, _kCUIWidgetButtonSegmentedInset2, 484 | _kCUIWidgetButtonSegmentedSCurve, _kCUIWidgetButtonSegmentedSeparated, 485 | _kCUIWidgetButtonSegmentedSeparatedTextured, _kCUIWidgetButtonSegmentedSeparatedToolbar, 486 | _kCUIWidgetButtonSegmentedSeparatedToolbarText, _kCUIWidgetButtonSegmentedSlider, 487 | _kCUIWidgetButtonSegmentedSliderToolbar, _kCUIWidgetButtonSegmentedSliderToolbarText, 488 | _kCUIWidgetButtonSegmentedSlideshow, _kCUIWidgetButtonSegmentedSmallSquare, 489 | _kCUIWidgetButtonSegmentedTextured, _kCUIWidgetButtonSegmentedToolbar, 490 | _kCUIWidgetButtonSegmentedToolbarText, _kCUIWidgetColorWellComboButtonEndcap, 491 | _kCUIWidgetColorWellRolloverArrow, _kCUIWidgetColorWellSwatch, 492 | _kCUIWidgetDial, _kCUIWidgetDisappearingItem, _kCUIWidgetDisclosureTriangle, 493 | _kCUIWidgetDisclosureTriangleSourceList, _kCUIWidgetDividerGrabber, 494 | _kCUIWidgetDividerSeparatorBar, _kCUIWidgetDividerSidebar, 495 | _kCUIWidgetDividerSplitter, _kCUIWidgetDividerSplitterInset, 496 | _kCUIWidgetDockBadge, _kCUIWidgetFrameColorWell, _kCUIWidgetFrameGroupBox, 497 | _kCUIWidgetFrameGroupBoxForm, _kCUIWidgetFrameGroupBoxSecondary, 498 | _kCUIWidgetFrameGroupBoxSquare, _kCUIWidgetFrameListBox, _kCUIWidgetFramePlacard, 499 | _kCUIWidgetFrameSearchField, _kCUIWidgetFrameTextField, _kCUIWidgetFrameTextFieldRound, 500 | _kCUIWidgetFrameWell, _kCUIWidgetGradient, _kCUIWidgetGrowBox, 501 | _kCUIWidgetGrowBoxTextured, _kCUIWidgetHeader, _kCUIWidgetImage, 502 | _kCUIWidgetKey, _kCUIWidgetLevelIndicatorFill, _kCUIWidgetLevelIndicatorMask, 503 | _kCUIWidgetLevelIndicatorOutline, _kCUIWidgetLevelIndicatorTickMarkMajor, 504 | _kCUIWidgetLevelIndicatorTickMarkMinor, _kCUIWidgetMenu, _kCUIWidgetMenuBar, 505 | _kCUIWidgetMenuItem, _kCUIWidgetMenuItemSeparator, _kCUIWidgetMenuTitle, 506 | _kCUIWidgetMenuTitleApple, _kCUIWidgetOverlayScrollBar, _kCUIWidgetPopover, 507 | _kCUIWidgetProgressBar, _kCUIWidgetProgressIndeterminateBar, 508 | _kCUIWidgetProgressRelevance, _kCUIWidgetProgressSpinner, 509 | _kCUIWidgetProgressSpinnerDeterminate, _kCUIWidgetRangeSelectorFill, 510 | _kCUIWidgetRangeSelectorFrame, _kCUIWidgetScrollBar, _kCUIWidgetScrollBarTrackCorner, 511 | _kCUIWidgetScrollColumnSizer, _kCUIWidgetScrollViewFrame, 512 | _kCUIWidgetScrollViewMoreIndicator, _kCUIWidgetSelectionOverlay, 513 | _kCUIWidgetSelectionOverlayFill, _kCUIWidgetSlider, _kCUIWidgetSliderBackground, 514 | _kCUIWidgetSliderModern, _kCUIWidgetSliderModernToolbar, _kCUIWidgetSliderThumb, 515 | _kCUIWidgetSliderThumbModern, _kCUIWidgetSliderThumbModernToolbar, 516 | _kCUIWidgetSourceListBackground, _kCUIWidgetSourceListBackgroundGradientEnd, 517 | _kCUIWidgetSourceListBackgroundGradientStart, _kCUIWidgetSourceListSelection, 518 | _kCUIWidgetStyledRects, _kCUIWidgetStyledText, _kCUIWidgetSwitchBorder, 519 | _kCUIWidgetSwitchFill, _kCUIWidgetSwitchFillMask, _kCUIWidgetSwitchKnob, 520 | _kCUIWidgetSwitchOnOffLabel, _kCUIWidgetSynchronization, _kCUIWidgetTab, 521 | _kCUIWidgetTabBezel, _kCUIWidgetTabPane, _kCUIWidgetTextToken, 522 | _kCUIWidgetTickMark, _kCUIWidgetTickMarkModern, _kCUIWidgetTickMarkModernToolbar, 523 | _kCUIWidgetTitleBarCloseBox, _kCUIWidgetTitleBarCollapseBox, 524 | _kCUIWidgetTitleBarFullScreenEnter, _kCUIWidgetTitleBarFullScreenExit, 525 | _kCUIWidgetTitleBarToolbarButton, _kCUIWidgetTitleBarZoomBox, 526 | _kCUIWidgetToolbarBaselineSeparator, _kCUIWidgetToolbarDefaultItemsWell, 527 | _kCUIWidgetToolbarItemWell, _kCUIWidgetToolbarSeparator, _kCUIWidgetToolbarSeparatorInset, 528 | _kCUIWidgetToolbarSpace, _kCUIWidgetToolbarSpaceInset, _kCUIWidgetUnderDesktopView, 529 | _kCUIWidgetUnspecified, _kCUIWidgetVisualEffectView, _kCUIWidgetWindowBottomBar, 530 | _kCUIWidgetWindowFrame, _kCUIWidgetWindowSeparatorShadow, 531 | _kCUIWidgetWindowShapeMask, _kCUIWidgetWindowSharingSessionHostButton, 532 | _kCUIWidgetWindowSharingSessionRecipientIndicator, _kCUIWidgetWindowTitleBar, 533 | _kCUIWidgetWindowTitleBarSeparator, _kCUIWindowFrameBottomBarHeightKey, 534 | _kCUIWindowFrameDrawBottomBarSeparatorKey, _kCUIWindowFrameDrawClippedKey, 535 | _kCUIWindowFrameDrawTitleSeparatorKey, _kCUIWindowFrameIncludeBorder, 536 | _kCUIWindowFrameRoundedBottomCornersKey, _kCUIWindowFrameRoundedTopCornersKey, 537 | _kCUIWindowFrameShapeCornerRadius, _kCUIWindowFrameTexturedBottomBarMatchesTitleBarKey, 538 | _kCUIWindowFrameTopBarOnlyKey, _kCUIWindowFrameUnifiedTitleBarHeightKey, 539 | _kCUIWindowTypeDocument, _kCUIWindowTypeDrawer, _kCUIWindowTypeFullScreen, 540 | _kCUIWindowTypeHUD, _kCUIWindowTypeKey, _kCUIWindowTypeOnlyBackground, 541 | _kCUIWindowTypeOnlyCornerMaskImage, _kCUIWindowTypeOnlyTexturedBackground, 542 | _kCUIWindowTypeSheet, _kCUIWindowTypeTextured, _kCUIWindowTypeTexturedUtility, 543 | _kCUIWindowTypeTitlelessUtility, _kCUIWindowTypeUtility ] 544 | objc-classes: [ CSIBitmapWrapper, CSIGenerator, CUIBackgroundStyleEffectConfiguration, 545 | CUICatalog, CUIColor, CUICommonAssetStorage, CUIDesignColor, 546 | CUIDesignLibrary, CUIDesignLibraryCatalog, CUIDesignLibraryCompositeCatalog, 547 | CUIImage, CUILayoutInformation, CUIMutableCatalog, CUIMutableCommonAssetStorage, 548 | CUIMutablePSDImageRef, CUINamedColor, CUINamedData, CUINamedExternalLink, 549 | CUINamedImage, CUINamedImageAtlas, CUINamedImageDescription, 550 | CUINamedLayerImage, CUINamedLayerStack, CUINamedLookup, CUINamedModel, 551 | CUINamedMultisizeImage, CUINamedMultisizeImageSet, CUINamedRecognitionGroup, 552 | CUINamedRecognitionImage, CUINamedRecognitionObject, CUINamedRenditionInfo, 553 | CUINamedSolidLayerImage, CUINamedSolidLayerStack, CUINamedTexture, 554 | CUINamedVectorGlyph, CUINamedVectorImage, CUINamedVectorPDFImage, 555 | CUINamedVectorSVGImage, CUIPSDGradient, CUIPSDGradientColorStop, 556 | CUIPSDGradientDoubleColorStop, CUIPSDGradientDoubleOpacityStop, 557 | CUIPSDGradientEvaluator, CUIPSDGradientLayer, CUIPSDGradientOpacityStop, 558 | CUIPSDGradientStop, CUIPSDImageLayer, CUIPSDImageRef, CUIPSDLayer, 559 | CUIPSDLayerBaseRef, CUIPSDLayerEffectBevelEmboss, CUIPSDLayerEffectColorOverlay, 560 | CUIPSDLayerEffectComponent, CUIPSDLayerEffectDropShadow, CUIPSDLayerEffectGradientOverlay, 561 | CUIPSDLayerEffectInnerGlow, CUIPSDLayerEffectInnerShadow, 562 | CUIPSDLayerEffectOuterGlow, CUIPSDLayerEffects, CUIPSDLayerEnumerator, 563 | CUIPSDLayerGroupEnd, CUIPSDLayerGroupRef, CUIPSDLayerGroupStart, 564 | CUIPSDLayerMaskRef, CUIPSDLayerRef, CUIPSDLayoutMetricsChannel, 565 | CUIPSLayerEffectsPreset, CUIRenditionKey, CUIRenditionLayerReference, 566 | CUIRenditionMetrics, CUIRenditionSliceInformation, CUIRuntimeStatistics, 567 | CUIShapeEffectPreset, CUIShapeEffectStack, CUIStructuredThemeStore, 568 | CUIStyleEffectConfiguration, CUISystemStore, CUITextEffectStack, 569 | CUITextStyle, CUIThemeDataEffectPreset, CUIThemeFacet, CUIThemeGradient, 570 | CUIThemeRendition, CUIThemeSchema, CUIThemeSchemaEffectRendition, 571 | CUIThemeSchemaLayer, CUIThemeSchemaPSDLayer, CUIThemeSchemaPSDLayerGroup, 572 | CUIThemeSchemaPSDRenditionLayer, CUIThemeSchemaRendition, 573 | CUIThemeSchemaRenditionGroup, CUIVectorGlyphGraphicVariantOptions, 574 | CUIVectorGlyphHierarchicalLayer, CUIVectorGlyphLayer, CUIVectorGlyphMulticolorLayer, 575 | CUIVectorGlyphMutator, CoreUI ] 576 | ... 577 | --------------------------------------------------------------------------------