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
This commit is contained in:
Zorg committed 2016-03-04 20:05:33 -05:00
1 parent db4e8a9946
commit ed72d25eaa
9 files changed
+181 -120

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
//
// 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