├── .gitignore ├── .gitattributes ├── Example ├── CTTabBarController.h ├── CTRootViewController.h ├── Resources │ ├── Assets.car │ ├── AppIcon20x20@2x.png │ ├── AppIcon20x20@3x.png │ ├── AppIcon29x29@2x.png │ ├── AppIcon29x29@3x.png │ ├── AppIcon40x40@2x.png │ ├── AppIcon40x40@3x.png │ ├── AppIcon60x60@2x.png │ ├── AppIcon60x60@3x.png │ ├── AppIcon20x20~ipad.png │ ├── AppIcon29x29~ipad.png │ ├── AppIcon40x40~ipad.png │ ├── AppIcon76x76~ipad.png │ ├── AppIcon20x20@2x~ipad.png │ ├── AppIcon29x29@2x~ipad.png │ ├── AppIcon40x40@2x~ipad.png │ ├── AppIcon76x76@2x~ipad.png │ ├── LaunchImage-568h@2x.png │ ├── LaunchImage-700-568h@2x.png │ ├── LaunchImage-800-667h@2x.png │ ├── AppIcon83.5x83.5@2x~ipad.png │ ├── LaunchImage-Portrait@2x~ipad.png │ ├── LaunchImage-Landscape@2x~ipad.png │ ├── LaunchImage-700-Landscape@2x~ipad.png │ ├── LaunchImage-700-Portrait@2x~ipad.png │ ├── LaunchImage-800-Portrait-736h@3x.png │ ├── LaunchImage-1100-Portrait-2436h@3x.png │ ├── LaunchImage-1200-Portrait-1792h@2x.png │ ├── LaunchImage-1200-Portrait-2688h@3x.png │ └── Info.plist ├── Assets │ ├── First │ │ ├── First.png │ │ ├── First@2x.png │ │ └── First@3x.png │ ├── Second │ │ ├── Second.png │ │ ├── Second@2x.png │ │ └── Second@3x.png │ ├── AppIcon │ │ ├── Example-20.png │ │ ├── Example-29.png │ │ ├── Example-40.png │ │ ├── Example-76.png │ │ ├── Example-1024.png │ │ ├── Example-20@2x.png │ │ ├── Example-20@3x.png │ │ ├── Example-29@2x.png │ │ ├── Example-29@3x.png │ │ ├── Example-40@2x.png │ │ ├── Example-40@3x.png │ │ ├── Example-60@2x.png │ │ ├── Example-60@3x.png │ │ ├── Example-76@2x.png │ │ └── Example-83.5@2x.png │ └── LaunchImage │ │ ├── 9.7- iPad.png │ │ ├── iPhone 6s.png │ │ ├── iPhone 7.png │ │ ├── iPhone 8.png │ │ ├── iPhone SE.png │ │ ├── iPhone X.png │ │ ├── iPhone XR.png │ │ ├── iPhone XS.png │ │ ├── 10.5- iPad Pro.png │ │ ├── 12.9- iPad Pro.png │ │ ├── iPhone 6s Plus.png │ │ ├── iPhone 7 Plus.png │ │ ├── iPhone 8 Plus.png │ │ ├── iPhone XS Max.png │ │ ├── 7.9- iPad mini 4.png │ │ ├── 9.7- iPad (Landscape).png │ │ ├── 10.5- iPad Pro (Landscape).png │ │ ├── 12.9- iPad Pro (Landscape).png │ │ └── 7.9- iPad mini 4 (Landscape).png ├── main.m ├── CTAppDelegate.h ├── control ├── Makefile ├── CTAppDelegate.m ├── CTTabBarController.m └── CTRootViewController.m ├── Base ├── Contents.json ├── Universal.json ├── AppIcon.json └── LaunchImage.json ├── README.md └── carify.py /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | Example/obj 3 | Example/.theos 4 | Example/packages 5 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Example/CTTabBarController.h: -------------------------------------------------------------------------------- 1 | @interface CTTabBarController : UITabBarController 2 | 3 | @end 4 | -------------------------------------------------------------------------------- /Example/CTRootViewController.h: -------------------------------------------------------------------------------- 1 | @interface CTRootViewController : UITableViewController 2 | 3 | @end 4 | -------------------------------------------------------------------------------- /Example/Resources/Assets.car: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/Assets.car -------------------------------------------------------------------------------- /Base/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Assets/First/First.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/First/First.png -------------------------------------------------------------------------------- /Example/Assets/First/First@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/First/First@2x.png -------------------------------------------------------------------------------- /Example/Assets/First/First@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/First/First@3x.png -------------------------------------------------------------------------------- /Example/Assets/Second/Second.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/Second/Second.png -------------------------------------------------------------------------------- /Example/Assets/Second/Second@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/Second/Second@2x.png -------------------------------------------------------------------------------- /Example/Assets/Second/Second@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/Second/Second@3x.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-20.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-29.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-40.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-76.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon20x20@2x.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon20x20@3x.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon29x29@2x.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon29x29@3x.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon40x40@2x.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon40x40@3x.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon60x60@2x.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon60x60@3x.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-1024.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-20@2x.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-20@3x.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-29@2x.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-29@3x.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-40@2x.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-40@3x.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-60@2x.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-60@3x.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-76@2x.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/9.7- iPad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/9.7- iPad.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/iPhone 6s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/iPhone 6s.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/iPhone 7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/iPhone 7.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/iPhone 8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/iPhone 8.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/iPhone SE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/iPhone SE.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/iPhone X.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/iPhone X.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/iPhone XR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/iPhone XR.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/iPhone XS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/iPhone XS.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon20x20~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon20x20~ipad.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon29x29~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon29x29~ipad.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon40x40~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon40x40~ipad.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon76x76~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon76x76~ipad.png -------------------------------------------------------------------------------- /Example/Assets/AppIcon/Example-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/AppIcon/Example-83.5@2x.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon20x20@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon20x20@2x~ipad.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon29x29@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon29x29@2x~ipad.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon40x40@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon40x40@2x~ipad.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon76x76@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon76x76@2x~ipad.png -------------------------------------------------------------------------------- /Example/Resources/LaunchImage-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/LaunchImage-568h@2x.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # carify-python 2 | 3 | ala https://github.com/wstyres/carify 4 | 5 | `python3 carify.py ` 6 | -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/10.5- iPad Pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/10.5- iPad Pro.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/12.9- iPad Pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/12.9- iPad Pro.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/iPhone 6s Plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/iPhone 6s Plus.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/iPhone 7 Plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/iPhone 7 Plus.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/iPhone 8 Plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/iPhone 8 Plus.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/iPhone XS Max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/iPhone XS Max.png -------------------------------------------------------------------------------- /Example/Resources/LaunchImage-700-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/LaunchImage-700-568h@2x.png -------------------------------------------------------------------------------- /Example/Resources/LaunchImage-800-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/LaunchImage-800-667h@2x.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/7.9- iPad mini 4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/7.9- iPad mini 4.png -------------------------------------------------------------------------------- /Example/Resources/AppIcon83.5x83.5@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/AppIcon83.5x83.5@2x~ipad.png -------------------------------------------------------------------------------- /Example/Resources/LaunchImage-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/LaunchImage-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/9.7- iPad (Landscape).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/9.7- iPad (Landscape).png -------------------------------------------------------------------------------- /Example/Resources/LaunchImage-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/LaunchImage-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /Example/Resources/LaunchImage-700-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/LaunchImage-700-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /Example/Resources/LaunchImage-700-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/LaunchImage-700-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /Example/Resources/LaunchImage-800-Portrait-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/LaunchImage-800-Portrait-736h@3x.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/10.5- iPad Pro (Landscape).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/10.5- iPad Pro (Landscape).png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/12.9- iPad Pro (Landscape).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/12.9- iPad Pro (Landscape).png -------------------------------------------------------------------------------- /Example/Resources/LaunchImage-1100-Portrait-2436h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/LaunchImage-1100-Portrait-2436h@3x.png -------------------------------------------------------------------------------- /Example/Resources/LaunchImage-1200-Portrait-1792h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/LaunchImage-1200-Portrait-1792h@2x.png -------------------------------------------------------------------------------- /Example/Resources/LaunchImage-1200-Portrait-2688h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Resources/LaunchImage-1200-Portrait-2688h@3x.png -------------------------------------------------------------------------------- /Example/Assets/LaunchImage/7.9- iPad mini 4 (Landscape).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wstyres/carify-python/HEAD/Example/Assets/LaunchImage/7.9- iPad mini 4 (Landscape).png -------------------------------------------------------------------------------- /Example/main.m: -------------------------------------------------------------------------------- 1 | #import "CTAppDelegate.h" 2 | 3 | int main(int argc, char *argv[]) { 4 | @autoreleasepool { 5 | return UIApplicationMain(argc, argv, nil, NSStringFromClass(CTAppDelegate.class)); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Example/CTAppDelegate.h: -------------------------------------------------------------------------------- 1 | @interface CTAppDelegate : UIResponder 2 | 3 | @property (nonatomic, retain) UIWindow *window; 4 | @property (nonatomic, retain) UITabBarController *rootViewController; 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /Example/control: -------------------------------------------------------------------------------- 1 | Package: xyz.willy.carifytest 2 | Name: CarifyTest 3 | Version: 0.0.1 4 | Architecture: iphoneos-arm 5 | Description: An awesome application! 6 | Maintainer: Wilson Styres 7 | Author: Wilson Styres 8 | Section: Utilities 9 | -------------------------------------------------------------------------------- /Base/Universal.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "idiom" : "universal", 13 | "scale" : "3x" 14 | } 15 | ], 16 | "info" : { 17 | "version" : 1, 18 | "author" : "xcode" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Example/Makefile: -------------------------------------------------------------------------------- 1 | do:: 2 | python3 ../carify.py ./Assets ./Resources 3 | 4 | TARGET = iphone::10.3:8.0 5 | 6 | include $(THEOS)/makefiles/common.mk 7 | 8 | APPLICATION_NAME = CarifyTest 9 | CarifyTest_FILES = main.m CTAppDelegate.m CTRootViewController.m CTTabBarController.m 10 | CarifyTest_FRAMEWORKS = UIKit CoreGraphics 11 | 12 | include $(THEOS_MAKE_PATH)/application.mk 13 | 14 | after-install:: 15 | install.exec "killall \"CarifyTest\"" || true 16 | -------------------------------------------------------------------------------- /Example/CTAppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "CTAppDelegate.h" 2 | #import "CTTabBarController.h" 3 | 4 | @implementation CTAppDelegate 5 | 6 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 7 | _window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 8 | _rootViewController = [[CTTabBarController alloc] init]; 9 | _window.rootViewController = _rootViewController; 10 | [_window makeKeyAndVisible]; 11 | } 12 | 13 | - (void)dealloc { 14 | [_window release]; 15 | [_rootViewController release]; 16 | [super dealloc]; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Example/CTTabBarController.m: -------------------------------------------------------------------------------- 1 | #import "CTTabBarController.h" 2 | #import "CTRootViewController.h" 3 | 4 | @implementation CTTabBarController 5 | 6 | - (void)loadView { 7 | [super loadView]; 8 | 9 | UINavigationController *firstController = [[UINavigationController alloc] initWithRootViewController:[[CTRootViewController alloc] init]]; 10 | UITabBarItem *firstIcon = [[UITabBarItem alloc] initWithTitle:@"First" image:[UIImage imageNamed:@"First.png"] selectedImage:[UIImage imageNamed:@"First.png"]]; 11 | [firstController setTabBarItem:firstIcon]; 12 | 13 | UINavigationController *secondController = [[UINavigationController alloc] initWithRootViewController:[[CTRootViewController alloc] init]]; 14 | UITabBarItem *secondIcon = [[UITabBarItem alloc] initWithTitle:@"Second" image:[UIImage imageNamed:@"Second.png"] selectedImage:[UIImage imageNamed:@"Second.png"]]; 15 | [secondController setTabBarItem:secondIcon]; 16 | 17 | self.viewControllers = [NSArray arrayWithObjects:firstController, secondController, nil]; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Example/CTRootViewController.m: -------------------------------------------------------------------------------- 1 | #import "CTRootViewController.h" 2 | 3 | @implementation CTRootViewController { 4 | NSMutableArray *_objects; 5 | } 6 | 7 | - (void)loadView { 8 | [super loadView]; 9 | 10 | _objects = [[NSMutableArray alloc] init]; 11 | 12 | self.navigationItem.title = @"Root View Controller"; 13 | self.navigationItem.leftBarButtonItem = self.editButtonItem; 14 | self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addButtonTapped:)] autorelease]; 15 | } 16 | 17 | - (void)addButtonTapped:(id)sender { 18 | [_objects insertObject:[NSDate date] atIndex:0]; 19 | [self.tableView insertRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:0 inSection:0] ] withRowAnimation:UITableViewRowAnimationAutomatic]; 20 | } 21 | 22 | #pragma mark - Table View Data Source 23 | 24 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 25 | return 1; 26 | } 27 | 28 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 29 | return _objects.count; 30 | } 31 | 32 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 33 | static NSString *CellIdentifier = @"Cell"; 34 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 35 | 36 | if (!cell) { 37 | cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 38 | } 39 | 40 | NSDate *date = _objects[indexPath.row]; 41 | cell.textLabel.text = date.description; 42 | return cell; 43 | } 44 | 45 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { 46 | [_objects removeObjectAtIndex:indexPath.row]; 47 | [tableView deleteRowsAtIndexPaths:@[ indexPath ] withRowAnimation:UITableViewRowAnimationAutomatic]; 48 | } 49 | 50 | #pragma mark - Table View Delegate 51 | 52 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 53 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Base/AppIcon.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "size" : "20x20", 10 | "idiom" : "iphone", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "size" : "29x29", 15 | "idiom" : "iphone", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "size" : "29x29", 20 | "idiom" : "iphone", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "size" : "40x40", 25 | "idiom" : "iphone", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "size" : "40x40", 30 | "idiom" : "iphone", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "size" : "60x60", 40 | "idiom" : "iphone", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "size" : "20x20", 50 | "idiom" : "ipad", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "size" : "29x29", 60 | "idiom" : "ipad", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "size" : "40x40", 70 | "idiom" : "ipad", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "size" : "76x76", 75 | "idiom" : "ipad", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "size" : "76x76", 80 | "idiom" : "ipad", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "size" : "83.5x83.5", 85 | "idiom" : "ipad", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Example/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleExecutable 6 | CarifyTest 7 | CFBundleIcons 8 | 9 | CFBundlePrimaryIcon 10 | 11 | CFBundleIconFiles 12 | 13 | AppIcon20x20 14 | AppIcon29x29 15 | AppIcon40x40 16 | AppIcon60x60 17 | 18 | CFBundleIconName 19 | AppIcon 20 | 21 | 22 | CFBundleIcons~ipad 23 | 24 | CFBundlePrimaryIcon 25 | 26 | CFBundleIconFiles 27 | 28 | AppIcon20x20 29 | AppIcon29x29 30 | AppIcon40x40 31 | AppIcon60x60 32 | AppIcon76x76 33 | AppIcon83.5x83.5 34 | 35 | CFBundleIconName 36 | AppIcon 37 | 38 | 39 | CFBundleIdentifier 40 | xyz.willy.carifytest 41 | CFBundleInfoDictionaryVersion 42 | 6.0 43 | CFBundlePackageType 44 | APPL 45 | CFBundleSignature 46 | ???? 47 | CFBundleSupportedPlatforms 48 | 49 | iPhoneOS 50 | 51 | CFBundleVersion 52 | 1.0 53 | LSRequiresIPhoneOS 54 | 55 | UIDeviceFamily 56 | 57 | 1 58 | 2 59 | 60 | UILaunchImageFile 61 | LaunchImage 62 | UILaunchImages 63 | 64 | 65 | UILaunchImageMinimumOSVersion 66 | 7.0 67 | UILaunchImageName 68 | LaunchImage 69 | UILaunchImageOrientation 70 | Portrait 71 | UILaunchImageSize 72 | {320, 480} 73 | 74 | 75 | UILaunchImageMinimumOSVersion 76 | 7.0 77 | UILaunchImageName 78 | LaunchImage-700-568h 79 | UILaunchImageOrientation 80 | Portrait 81 | UILaunchImageSize 82 | {320, 568} 83 | 84 | 85 | UILaunchImageMinimumOSVersion 86 | 7.0 87 | UILaunchImageName 88 | LaunchImage-Portrait 89 | UILaunchImageOrientation 90 | Portrait 91 | UILaunchImageSize 92 | {768, 1024} 93 | 94 | 95 | UILaunchImageMinimumOSVersion 96 | 7.0 97 | UILaunchImageName 98 | LaunchImage-Landscape 99 | UILaunchImageOrientation 100 | Landscape 101 | UILaunchImageSize 102 | {768, 1024} 103 | 104 | 105 | UILaunchImageMinimumOSVersion 106 | 8.0 107 | UILaunchImageName 108 | LaunchImage-800-667h 109 | UILaunchImageOrientation 110 | Portrait 111 | UILaunchImageSize 112 | {375, 667} 113 | 114 | 115 | UILaunchImageMinimumOSVersion 116 | 8.0 117 | UILaunchImageName 118 | LaunchImage-800-Portrait-736h 119 | UILaunchImageOrientation 120 | Portrait 121 | UILaunchImageSize 122 | {414, 736} 123 | 124 | 125 | UILaunchImageMinimumOSVersion 126 | 8.0 127 | UILaunchImageName 128 | LaunchImage-800-Landscape-736h 129 | UILaunchImageOrientation 130 | Landscape 131 | UILaunchImageSize 132 | {414, 736} 133 | 134 | 135 | UIRequiredDeviceCapabilities 136 | 137 | armv7 138 | 139 | UISupportedInterfaceOrientations 140 | 141 | UIInterfaceOrientationPortrait 142 | UIInterfaceOrientationLandscapeLeft 143 | UIInterfaceOrientationLandscapeRight 144 | 145 | UISupportedInterfaceOrientations~ipad 146 | 147 | UIInterfaceOrientationPortrait 148 | UIInterfaceOrientationPortraitUpsideDown 149 | UIInterfaceOrientationLandscapeLeft 150 | UIInterfaceOrientationLandscapeRight 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /Base/LaunchImage.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "12.0", 8 | "subtype" : "2688h", 9 | "scale" : "3x" 10 | }, 11 | { 12 | "orientation" : "landscape", 13 | "idiom" : "iphone", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "12.0", 16 | "subtype" : "2688h", 17 | "scale" : "3x" 18 | }, 19 | { 20 | "orientation" : "portrait", 21 | "idiom" : "iphone", 22 | "extent" : "full-screen", 23 | "minimum-system-version" : "12.0", 24 | "subtype" : "1792h", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "orientation" : "landscape", 29 | "idiom" : "iphone", 30 | "extent" : "full-screen", 31 | "minimum-system-version" : "12.0", 32 | "subtype" : "1792h", 33 | "scale" : "2x" 34 | }, 35 | { 36 | "orientation" : "portrait", 37 | "idiom" : "iphone", 38 | "extent" : "full-screen", 39 | "minimum-system-version" : "11.0", 40 | "subtype" : "2436h", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "orientation" : "landscape", 45 | "idiom" : "iphone", 46 | "extent" : "full-screen", 47 | "minimum-system-version" : "11.0", 48 | "subtype" : "2436h", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "orientation" : "portrait", 53 | "idiom" : "iphone", 54 | "extent" : "full-screen", 55 | "minimum-system-version" : "8.0", 56 | "subtype" : "736h", 57 | "scale" : "3x" 58 | }, 59 | { 60 | "orientation" : "landscape", 61 | "idiom" : "iphone", 62 | "extent" : "full-screen", 63 | "minimum-system-version" : "8.0", 64 | "subtype" : "736h", 65 | "scale" : "3x" 66 | }, 67 | { 68 | "orientation" : "portrait", 69 | "idiom" : "iphone", 70 | "extent" : "full-screen", 71 | "minimum-system-version" : "8.0", 72 | "subtype" : "667h", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "orientation" : "portrait", 77 | "idiom" : "iphone", 78 | "extent" : "full-screen", 79 | "minimum-system-version" : "7.0", 80 | "scale" : "2x" 81 | }, 82 | { 83 | "orientation" : "portrait", 84 | "idiom" : "iphone", 85 | "extent" : "full-screen", 86 | "minimum-system-version" : "7.0", 87 | "subtype" : "retina4", 88 | "scale" : "2x" 89 | }, 90 | { 91 | "orientation" : "portrait", 92 | "idiom" : "ipad", 93 | "extent" : "full-screen", 94 | "minimum-system-version" : "7.0", 95 | "scale" : "1x" 96 | }, 97 | { 98 | "orientation" : "landscape", 99 | "idiom" : "ipad", 100 | "extent" : "full-screen", 101 | "minimum-system-version" : "7.0", 102 | "scale" : "1x" 103 | }, 104 | { 105 | "orientation" : "portrait", 106 | "idiom" : "ipad", 107 | "extent" : "full-screen", 108 | "minimum-system-version" : "7.0", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "orientation" : "landscape", 113 | "idiom" : "ipad", 114 | "extent" : "full-screen", 115 | "minimum-system-version" : "7.0", 116 | "scale" : "2x" 117 | }, 118 | { 119 | "orientation" : "portrait", 120 | "idiom" : "iphone", 121 | "extent" : "full-screen", 122 | "scale" : "1x" 123 | }, 124 | { 125 | "orientation" : "portrait", 126 | "idiom" : "iphone", 127 | "extent" : "full-screen", 128 | "scale" : "2x" 129 | }, 130 | { 131 | "orientation" : "portrait", 132 | "idiom" : "iphone", 133 | "extent" : "full-screen", 134 | "subtype" : "retina4", 135 | "scale" : "2x" 136 | }, 137 | { 138 | "orientation" : "portrait", 139 | "idiom" : "ipad", 140 | "extent" : "to-status-bar", 141 | "scale" : "1x" 142 | }, 143 | { 144 | "orientation" : "portrait", 145 | "idiom" : "ipad", 146 | "extent" : "full-screen", 147 | "scale" : "1x" 148 | }, 149 | { 150 | "orientation" : "landscape", 151 | "idiom" : "ipad", 152 | "extent" : "to-status-bar", 153 | "scale" : "1x" 154 | }, 155 | { 156 | "orientation" : "landscape", 157 | "idiom" : "ipad", 158 | "extent" : "full-screen", 159 | "scale" : "1x" 160 | }, 161 | { 162 | "orientation" : "portrait", 163 | "idiom" : "ipad", 164 | "extent" : "to-status-bar", 165 | "scale" : "2x" 166 | }, 167 | { 168 | "orientation" : "portrait", 169 | "idiom" : "ipad", 170 | "extent" : "full-screen", 171 | "scale" : "2x" 172 | }, 173 | { 174 | "orientation" : "landscape", 175 | "idiom" : "ipad", 176 | "extent" : "to-status-bar", 177 | "scale" : "2x" 178 | }, 179 | { 180 | "orientation" : "landscape", 181 | "idiom" : "ipad", 182 | "extent" : "full-screen", 183 | "scale" : "2x" 184 | } 185 | ], 186 | "info" : { 187 | "version" : 1, 188 | "author" : "xcode" 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /carify.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | import shutil 4 | import json 5 | from PIL import Image 6 | from subprocess import call 7 | import plistlib 8 | from typing import Dict, Tuple 9 | 10 | def main(): 11 | if len(sys.argv) < 3: 12 | print("Usage: ./carify ") 13 | return 14 | 15 | assetsFolderPath = sys.argv[1] 16 | resourcesFolderPath = sys.argv[2] 17 | outputFolderPath = os.path.join(resourcesFolderPath, "Assets.xcassets") 18 | 19 | createOutputDirectory(outputFolderPath); 20 | 21 | dirs = [f.path for f in os.scandir(assetsFolderPath) if f.is_dir() ] 22 | 23 | for directory in dirs: 24 | dir = os.path.basename(os.path.normpath(directory)) 25 | 26 | if dir == ".DS_Store": 27 | continue 28 | 29 | if dir == "AppIcon": 30 | createAppIconSet(directory, assetsFolderPath, outputFolderPath) 31 | elif dir == "LaunchImage": 32 | createLaunchImageSet(directory, assetsFolderPath, outputFolderPath) 33 | else: 34 | createBasicImageSet(directory, assetsFolderPath, outputFolderPath) 35 | 36 | createAssetsCarInDirectory(resourcesFolderPath, outputFolderPath) 37 | 38 | def merge_two_dicts(x: Dict, y: Dict) -> Dict: 39 | z = x.copy() 40 | z.update(y) 41 | return z 42 | 43 | def createAssetsCarInDirectory(resourcesDirectory: str, xcassetsPath: str): 44 | expandedResourcesDirectory = os.path.expanduser(resourcesDirectory) 45 | tmpLocation = os.path.join(expandedResourcesDirectory, "tmp.plist") 46 | infoLocation = os.path.join(expandedResourcesDirectory, "Info.plist") 47 | call(["/Applications/Xcode.app/Contents/Developer/usr/bin/actool", xcassetsPath, "--compile", resourcesDirectory, "--platform", "iphoneos", "--minimum-deployment-target", "8.0", "--app-icon", "AppIcon", "--launch-image", "LaunchImage", "--output-partial-info-plist", tmpLocation]) 48 | shutil.rmtree(xcassetsPath) 49 | 50 | tmpPlistDict = plistlib.load(open(tmpLocation,'rb')) 51 | try: 52 | infoPlistDict = plistlib.load(open(infoLocation,'rb')) 53 | except: 54 | infoPlistDict = {} 55 | merge = merge_two_dicts(tmpPlistDict, infoPlistDict) 56 | 57 | plistlib.dump(merge, open(infoLocation,'wb')) 58 | 59 | os.remove(tmpLocation) 60 | 61 | def createAppIconSet(directory: str, assetsFolderPath: str, outputFolderPath: str): 62 | images = [f for f in os.listdir(directory) if os.path.isfile(os.path.join(directory, f))] 63 | outputPath = os.path.join(outputFolderPath, "AppIcon.appiconset") 64 | 65 | try: 66 | os.mkdir(outputPath) 67 | except OSError as e: 68 | print(f"Creation of the directory {outputPath} failed, {e.strerror}") 69 | 70 | baseJsonPath = os.path.join(os.path.dirname(os.path.realpath(__file__)), "Base", "AppIcon.json") 71 | with open(baseJsonPath) as jsonString: 72 | data = json.load(jsonString) 73 | 74 | for image in images: 75 | if image == ".DS_Store": 76 | continue 77 | 78 | imagePath = os.path.join(directory, image) 79 | with Image.open(imagePath) as img: 80 | width, height = img.size 81 | 82 | iconSizeDictionary = { 83 | "20": [( "20x20", "ipad", "1x" )], 84 | "29": [( "29x29", "ipad", "1x" )], 85 | "40": [( "20x20", "iphone", "2x" ), ( "20x20", "ipad", "2x" ), ( "40x40", "ipad", "1x" )], 86 | "58": [( "29x29", "iphone", "2x" ), ( "29x29", "ipad", "2x" )], 87 | "60": [( "20x20", "iphone", "3x" )], 88 | "76": [( "76x76", "ipad", "1x" )], 89 | "80": [( "40x40", "iphone", "2x" ), ( "40x40", "ipad", "2x" )], 90 | "87": [( "29x29", "iphone", "3x" )], 91 | "120": [( "40x40", "iphone", "3x" ), ( "60x60", "iphone", "2x" )], 92 | "152": [( "76x76", "ipad", "2x" )], 93 | "167": [( "83.5x83.5", "ipad", "2x" )], 94 | "180": [( "60x60", "iphone", "3x" )], 95 | "1024": [( "1024x1024", "ios-marketing", "1x" )], 96 | } 97 | 98 | values = iconSizeDictionary.get(f"{width}") 99 | if values != None: 100 | for value in values: 101 | insertImage("appicon", imagePath, outputPath, data, value); 102 | 103 | outputJsonPath = os.path.join(outputPath, "Contents.json") 104 | with open(outputJsonPath, 'w') as outfile: 105 | json.dump(data, outfile) 106 | 107 | def createLaunchImageSet(directory: str, assetsFolderPath: str, outputFolderPath: str): 108 | images = [f for f in os.listdir(directory) if os.path.isfile(os.path.join(directory, f))] 109 | outputPath = os.path.join(outputFolderPath, "LaunchImage.launchimage") 110 | 111 | try: 112 | os.mkdir(outputPath) 113 | except OSError as e: 114 | print(f"Creation of the directory {outputPath} failed, {e.strerror}") 115 | 116 | baseJsonPath = os.path.join(os.path.dirname(os.path.realpath(__file__)), "Base", "LaunchImage.json") 117 | with open(baseJsonPath) as jsonString: 118 | data = json.load(jsonString) 119 | 120 | for image in images: 121 | if image == ".DS_Store": 122 | continue 123 | 124 | imagePath = os.path.join(directory, image) 125 | with Image.open(imagePath) as img: 126 | width, height = img.size 127 | 128 | launchScreenSizeDictionary = { 129 | "1242x2688": [( "full-screen", "iphone", "2688h", "portrait", "3x" )], # iPhone XS Max Portrait 130 | "828x1792": [( "full-screen", "iphone", "1792h", "portrait", "2x" )], # iPhone XR Portrait 131 | "2688x1242": [( "full-screen", "iphone", "2688h", "landscape", "3x" )], # iPhone XS Max Landscape 132 | "1792x828": [( "full-screen", "iphone", "1792h", "landscape", "2x" )], # iPhone XR Landscape 133 | "1125x2436": [( "full-screen", "iphone", "2436h", "portrait", "3x" )], # iPhone X[S] Portrait 134 | "2436x1125": [( "full-screen", "iphone", "2436h", "landscape", "3x" )], # iPhone X[S] Landscape 135 | "1242x2208": [( "full-screen", "iphone", "736h", "portrait", "3x" )], # iPhone Portrait 5.5" 136 | "750x1334": [( "full-screen", "iphone", "667h", "portrait", "2x" )], # iPhone Portrait 4.7" 137 | "2208x1242": [( "full-screen", "iphone", "736h", "landscape", "3x" )], # iPhone Landscape 5.5" 138 | "640x960": [( "full-screen", "iphone", "", "portrait", "2x" )], # iPhone Portrait 2x 139 | "640x1136": [( "full-screen", "iphone", "retina4", "portrait", "2x" )], # iPhone Portait Retina4 140 | "768x1024": [( "full-screen", "ipad", "", "portrait", "1x" )], # iPad Portrait 1x 141 | "1536x2048": [( "full-screen", "ipad", "", "portrait", "2x" )], # iPad Portrait 2x 142 | "1024x768": [( "full-screen", "ipad", "", "landscape", "1x" )], # iPad Landscape 1x 143 | "2048x1536": [( "full-screen", "ipad", "", "landscape", "2x" )], # iPad Landscape 2x 144 | } 145 | 146 | values = launchScreenSizeDictionary.get(f"{width}x{height}") 147 | if values != None: 148 | for value in values: 149 | insertImage("launchimage", imagePath, outputPath, data, value); 150 | 151 | outputJsonPath = os.path.join(outputPath, "Contents.json") 152 | with open(outputJsonPath, 'w') as outfile: 153 | json.dump(data, outfile) 154 | 155 | def createBasicImageSet(directory: str, assetsFolderPath: str, outputFolderPath: str): 156 | images = [f for f in os.listdir(directory) if os.path.isfile(os.path.join(directory, f))] 157 | dir = os.path.basename(os.path.normpath(directory)) 158 | imageSetName = f"{dir}.imageset" 159 | outputPath = os.path.join(outputFolderPath, imageSetName) 160 | 161 | try: 162 | os.mkdir(outputPath) 163 | except OSError as e: 164 | print(f"Creation of the directory {outputPath} failed, {e.strerror}") 165 | 166 | baseJsonPath = os.path.join(os.path.dirname(os.path.realpath(__file__)), "Base", "Universal.json") 167 | with open(baseJsonPath) as jsonString: 168 | data = json.load(jsonString) 169 | 170 | for image in images: 171 | imagePath = os.path.join(directory, image) 172 | 173 | if image == ".DS_Store": 174 | continue 175 | 176 | components = image.split('@') 177 | images = data["images"] 178 | 179 | if len(components) > 1: 180 | scale = components[1] 181 | secondComp = scale.split('.') 182 | scale = secondComp[0] 183 | 184 | if scale == "1x": 185 | images[0]["filename"] = image 186 | elif scale == "2x": 187 | images[1]["filename"] = image 188 | elif scale == "3x": 189 | images[2]["filename"] = image 190 | else: 191 | print(f"Improper scale for file {imageFilename}") 192 | 193 | sourcePath = os.path.join(directory, image) 194 | destinationPath = os.path.join(outputPath, image) 195 | shutil.copy2(sourcePath, destinationPath) 196 | else: #We're assuming this is a 1x image if there is no included scale 197 | images[0]["filename"] = image 198 | 199 | sourcePath = os.path.join(directory, image) 200 | destinationPath = os.path.join(outputPath, image) 201 | shutil.copy2(sourcePath, destinationPath) 202 | 203 | outputJsonPath = os.path.join(outputPath, "Contents.json") 204 | with open(outputJsonPath, 'w') as outfile: 205 | json.dump(data, outfile) 206 | 207 | def insertImage(type: str, imageSourcePath: str, assetsOutputPath: str, dictionary: Dict, searchTerms: Tuple): 208 | images = dictionary["images"] 209 | filename = os.path.basename(os.path.normpath(imageSourcePath)) 210 | 211 | for dict in images: 212 | if type == "appicon": 213 | size, idiom, scale = searchTerms 214 | if dict["size"] == size and dict["idiom"] == idiom and dict["scale"] == scale: 215 | dict["filename"] = filename 216 | elif type == "launchimage": 217 | extent, idiom, subtype, orientation, scale = searchTerms 218 | if dict["extent"] == extent and dict["idiom"] == idiom and dict["orientation"] == orientation and dict["scale"] == scale: 219 | if 'subtype' in dict and dict["subtype"] == subtype: 220 | dict["filename"] = filename 221 | else: 222 | dict["filename"] = filename 223 | else: 224 | print(f"Improper type {type}") 225 | 226 | destinationPath = os.path.join(assetsOutputPath, filename) 227 | shutil.copy2(imageSourcePath, destinationPath) 228 | 229 | def createOutputDirectory(outputDirPath): 230 | try: 231 | os.makedirs(outputDirPath) 232 | except OSError as e: 233 | print(f"Creation of the directory {outputDirPath} failed, {e.strerror}") 234 | 235 | basePath = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Base', 'Contents.json') 236 | outputPath = os.path.join(outputDirPath, 'Contents.json') 237 | shutil.copy2(basePath, outputPath) 238 | 239 | if __name__ == '__main__': 240 | main() 241 | --------------------------------------------------------------------------------