mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Reduce code duplication by using SUAdHocCodeSigning
This commit is contained in:
1 parent
98eef51931
commit
5e5aebffd3
1 file changed
+2
-15
@@ -9,6 +9,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <XCTest/XCTest.h>
|
||||
#import "SUCodeSigningVerifier.h"
|
||||
#import "SUAdHocCodeSigning.h"
|
||||
#import "SUFileManager.h"
|
||||
|
||||
#if defined(__MAC_10_15)
|
||||
@@ -182,21 +183,7 @@
|
||||
|
||||
- (BOOL)codesignAppURL:(NSURL *)appURL
|
||||
{
|
||||
BOOL success = NO;
|
||||
@try
|
||||
{
|
||||
// ad-hoc signing with the dash
|
||||
NSString *appPath = [appURL path];
|
||||
NSArray<NSString *> *arguments = @[ @"--force", @"--deep", @"--sign", @"-", appPath ];
|
||||
NSTask *task = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/codesign" arguments:arguments];
|
||||
[task waitUntilExit];
|
||||
success = (task.terminationStatus == 0);
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
NSLog(@"exception: %@", exception);
|
||||
}
|
||||
return success;
|
||||
return [SUAdHocCodeSigning codeSignApplicationAtPath:appURL.path];
|
||||
}
|
||||
|
||||
- (void)testUnsignedApp
|
||||
|
||||
Reference in new issue
Block a user