Skip to content

Commit

Permalink
macOS Sierra /usr/bin/security appends a junk line on the entitlement…
Browse files Browse the repository at this point in the history
…s xml/plist file that breaks signing.
  • Loading branch information
Keith Smith committed Sep 8, 2016
1 parent df764ae commit 674731d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions iReSign/iReSign/iReSignAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,16 @@ - (void)checkEntitlementsFix:(NSTimer *)timer {

- (void)doEntitlementsEdit
{
//macOS 10.12 bug: /usr/bin/security appends a junk line at the top of the XML file.
if ([entitlementsResult containsString:@"SecPolicySetValue"])
{
NSRange newlineRange = [entitlementsResult rangeOfString:@"\n"];
if(newlineRange.location != NSNotFound) {
entitlementsResult = [entitlementsResult substringFromIndex:newlineRange.location];
}
}
//end macOS 10.12 bug fix.

NSDictionary* entitlements = entitlementsResult.propertyList;
entitlements = entitlements[@"Entitlements"];
NSString* filePath = [workingPath stringByAppendingPathComponent:@"entitlements.plist"];
Expand Down

1 comment on commit 674731d

@maosir10
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[tid=2619980]sigh脚本教程[/tid]

Please sign in to comment.