steventroughtonsmith / cartool

Export images from OS X / iOS .car CoreUI archives
1.8k stars 443 forks source link

AppIcon doesn't work #23

Open getaaron opened 6 years ago

getaaron commented 6 years ago

This tool can't extract AppIcon.

Instead of:

for (NSNumber *scaleFactor in @[@1, @2, @3])
{
    CUINamedImage *image = [catalog imageWithName:key scaleFactor:scaleFactor.doubleValue];

    if (image && image.scale == scaleFactor.floatValue) [images addObject:image];
}

I tried simply:

[images addObjectsFromArray:[catalog imagesWithName:key]];

In my one test, this added 23 images to the array, which are of type CUINamedMultisizeImageSet.h, which doesn't respond to -size, and therefore crashes on CGSizeEqualToSize(image.size, CGSizeZero). Looks like this type is new in iOS 11 (it's not present in the iOS 10 runtime headers).

So if we want to make this work we'll have to add support for this type.