Files
Sparkle/TestApplication/SUAdHocCodeSigning.m
T
Zorg ed72d25eaa Re-sign the altered/new test app
For sandbox testing, we really have to use ad-hoc signing.
Which means we have to sign the "new" app after we alter its info.plist file,
so that our code signing verifier doesn't (rightfully) complain
2016-03-04 20:05:33 -05:00

33 lines
828 B
Objective-C

//
// SUAdHocCodeSigning.m
// Sparkle
//
// Created by Mayur Pawashe on 3/4/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import "SUAdHocCodeSigning.h"
@implementation SUAdHocCodeSigning
+ (BOOL)codeSignApplicationAtPath:(NSString *)applicationPath
{
BOOL success = NO;
@try
{
// ad-hoc signing with the dash
NSArray *arguments = @[ @"--force", @"--deep", @"--sign", @"-", applicationPath ];
NSTask *task = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/codesign" arguments:arguments];
[task waitUntilExit];
success = (task.terminationStatus == 0);
}
@catch (NSException *exception)
{
NSLog(@"Failed to code sign application at %@", applicationPath);
NSLog(@"Exception: %@", exception);
}
return success;
}
@end