Reduce code duplication by using SUAdHocCodeSigning

This commit is contained in:
Zorg committed 2020-12-28 15:35:45 -08:00
1 parent 98eef51931
commit 5e5aebffd3
1 file changed
+2 -15
+2 -15
View File
@@ -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