mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-28 05:14:34 +00:00
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:
1 parent
db4e8a9946
commit
ed72d25eaa
9 files changed
+181
-120
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user