|
@@ -246,18 +246,12 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//FIXME: change to ldid
|
|
|
- (void)codesignRetainingSignature:(NSString *)file {
|
|
|
- NSString *jtp = [HelperClass singleLineReturnForProcess:@"/usr/bin/which jtool"];
|
|
|
- if (jtp){
|
|
|
+ NSString *ldidPath = [self validLDIDPath];
|
|
|
+ if (ldidPath) {
|
|
|
[FM removeItemAtPath:@"/tmp/ent.plist" error:nil];
|
|
|
- [HelperClass singleLineReturnForProcess:[NSString stringWithFormat:@"%@ %@ --ent > /tmp/ent.plist", jtp, file]];
|
|
|
- NSString *ents = [HelperClass singleLineReturnForProcess:@"/bin/cat /tmp/ent.plist"];
|
|
|
- DLog(@"ents: %@", ents);
|
|
|
- NSString *runCommand = [NSString stringWithFormat:@"%@ --sign platform %@ --ent /tmp/ent.plist --inplace", jtp, file];
|
|
|
- DLog(@"running codesign command: %@", runCommand);
|
|
|
- NSString *returnValue = [HelperClass singleLineReturnForProcess:runCommand];
|
|
|
- DLog(@"returnValue: %@", returnValue);
|
|
|
+ [HelperClass singleLineReturnForProcess:[NSString stringWithFormat:@"%@ -e %@ > /tmp/ent.plist", ldidPath, file]];
|
|
|
+ [HelperClass singleLineReturnForProcess:[NSString stringWithFormat:@"%@ -S/tmp/ent.plist %@", ldidPath, file]];
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -271,30 +265,7 @@
|
|
|
|
|
|
- (void)codesignIfNecessary:(NSString *)file {
|
|
|
if ([self shouldCodesignFile:file]){
|
|
|
- NSString *ldidPath = [self validLDIDPath];
|
|
|
- if (ldidPath) {
|
|
|
- NSString *runCommand = [NSString stringWithFormat:@"%@ -M %@", ldidPath, file];
|
|
|
- DLog(@"running codesign command: %@", runCommand);
|
|
|
- NSString *returnValue = [HelperClass singleLineReturnForProcess:runCommand];
|
|
|
- DLog(@"returnValue: %@", returnValue);
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-- (void)oldcodesignIfNecessary:(NSString *)file {
|
|
|
- if (![[[file pathExtension] lowercaseString] isEqualToString:@"dylib"]){
|
|
|
- return;
|
|
|
- }
|
|
|
- NSString *jtp = [HelperClass singleLineReturnForProcess:@"/usr/bin/which jtool"];
|
|
|
- if (jtp){
|
|
|
- NSString *proc = [[HelperClass arrayReturnForTask:jtp withArguments:@[@"--sig", file]] componentsJoinedByString:@"\n"];
|
|
|
- NSLog(@"proc: %@", proc);
|
|
|
- if ([proc containsString:@"No Code Signing blob detected in this file"]){
|
|
|
- NSString *runCommand = [NSString stringWithFormat:@"%@ --sign platform %@ --inplace", jtp, file];
|
|
|
- NSLog(@"running codesign command: %@", runCommand);
|
|
|
- NSString *returnValue = [HelperClass singleLineReturnForProcess:runCommand];
|
|
|
- NSLog(@"returnValue: %@", returnValue);
|
|
|
- }
|
|
|
+ [self codesignRetainingSignature:file];
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -302,7 +273,7 @@
|
|
|
|
|
|
[self.files enumerateObjectsUsingBlock:^(InputPackageFile * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
|
NSString *file = [thePath stringByAppendingPathComponent:obj.path];
|
|
|
- NSLog(@"check sig file: %@", obj.path);
|
|
|
+ DLog(@"check sig file: %@", obj.path);
|
|
|
[self flattenIfNecessary:file];
|
|
|
}];
|
|
|
|
|
@@ -312,7 +283,7 @@
|
|
|
if (self.skipSignatureChecks) { return; }
|
|
|
[self.files enumerateObjectsUsingBlock:^(InputPackageFile * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
|
NSString *file = [thePath stringByAppendingPathComponent:obj.path];
|
|
|
- NSLog(@"check sig file: %@", file);
|
|
|
+ DLog(@"check sig file: %@", file);
|
|
|
[self codesignIfNecessary:file];
|
|
|
}];
|
|
|
|