how to build "fat growl" on 10.9 with new code-signing requirements?

277 views
Skip to first unread message

David M. Cotter

unread,
Oct 18, 2013, 2:27:54 PM10/18/13
to growl-de...@googlegroups.com
believe it or not my app still supports PPC
i've been building FAT apps using xcode 3.2.6 which miraculously still works for me on 10.9

trouble now is code signing

we're required to have all components signed as well as the app itself

see more info here:
http://furbo.org/2013/10/17/code-signing-and-mavericks/

now, this works fine if you're not building fat, as apparently the current growl framework is signed

however the previous one, for PPC, version 1.2.3 is NOT signed?

"okay fine i'll just sign it myself" i said smugly

but the current method of having "fat growl" fails.  the method i'm using is this:


see that?  2 versions of growl, one loaded dynamically at runtime depending on if it's PPC, using this trixy bit of code:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    ScNSAutoReleasePool    sc;
    NSBundle   
    *mainBundle = [NSBundle mainBundle];
    NSString        *path = [[mainBundle privateFrameworksPath] stringByAppendingPathComponent:@"Growl"];
    bool            ppcB = false;
   
    #ifdef __ppc__
        ppcB = true;
    #endif
   
    if (NSAppKitVersionNumber >= 1038 && !ppcB) {
        path = [path stringByAppendingPathComponent:@"1.3"];
    } else {
        path = [path stringByAppendingPathComponent:@"1.2.3"];
    }
   
    path = [path stringByAppendingPathComponent:@"Growl.framework"];
   
    LogCFStr("path", path);
   
    NSBundle    *growlFramework = [NSBundle bundleWithPath:path];
   
    if ([growlFramework load]){
        NSDictionary     *infoDictionary = [growlFramework infoDictionary];
       
        LogCFStr("Using Growl.framework");
        LogCFStr("CFBundleShortVersionString", [infoDictionary objectForKey:@"CFBundleShortVersionString"]);
        LogCFStr("kCFBundleVersionKey", [infoDictionary objectForKey:(NSString *)kCFBundleVersionKey]);
           
        Class        growlBridge = NSClassFromString(@"GrowlApplicationBridge");
       
        if ([growlBridge respondsToSelector:@selector(setGrowlDelegate:)]) {
            LogCFStr("Growl FULL JOY!");
            [growlBridge performSelector:@selector(setGrowlDelegate:) withObject:self];
        } else {
            LogCFStr("Growl does not respond to selector");
        }
    } else {
        LogCFStr("Growl did not load");
    }
}


and i am able to codesign that framework
trouble happens when i go to sign my app:

export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate"
codesign -f -s "Developer ID Application: David M. Cotter" "build/kJams Pro.app"
build/kJams Pro.app: replacing existing signature
build/kJams Pro.app: bundle format unrecognized, invalid, or unsuitable
In subcomponent: /Users/davec/Developer/depot/kJams/Development/build/kJams Pro.app/Contents/Frameworks/Growl/1.2.3



it seems to choke on the fact that there are folders in the frameworks folder?
so even tho "Frameworks/Growl/1.2.3/Growl.framework" is signed, it fails on "Frameworks/Growl/1.2.3/"

so, do you have a solution to this?

Rudy

unread,
Oct 18, 2013, 6:26:12 PM10/18/13
to growl-de...@googlegroups.com
I took a look at this and the best solution i've been able to come up with (which will be part of the next SDK release) was to get rid of the nested directory structure and re-label the 1.2.3 framework to be Growl-1.2.3.framework and to adjust the dynamic loading code to reference this new path. it sucks that apple's codesign logic doesn't take folders into account. kind of lame actually.

both DeveloperTools/MultiGrowl and our signing script (http://code.google.com/p/growl/source/browse/scripts/resign-binaries.rb) got me something that codesign was ok with signing.

-rudy
Message has been deleted

David M. Cotter

unread,
Oct 18, 2013, 9:02:44 PM10/18/13
to growl-de...@googlegroups.com
okay i think i got it working now, thanks!
Reply all
Reply to author
Forward
0 new messages