Skip to content

Commit

Permalink
Add more error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhduytran0 committed Sep 2, 2024
1 parent e2aab4c commit d074394
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions LiveContainerUI/LCUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,17 @@ + (NSProgress *)signAppBundle:(NSURL *)path completionHandler:(void (^)(BOOL suc
}

ALTCertificate *cert = [[NSClassFromString(@"ALTCertificate") alloc] initWithP12Data:self.certificateData password:self.certificatePassword];
if (!cert) {
error = [NSError errorWithDomain:NSBundle.mainBundle.bundleIdentifier code:1 userInfo:@{NSLocalizedDescriptionKey: @"Failed to create ALTCertificate"}];
completionHandler(NO, error);
return nil;
}
ALTProvisioningProfile *profile = [[NSClassFromString(@"ALTProvisioningProfile") alloc] initWithURL:profilePath];
if (!profile) {
error = [NSError errorWithDomain:NSBundle.mainBundle.bundleIdentifier code:2 userInfo:@{NSLocalizedDescriptionKey: @"Failed to create ALTProvisioningProfile"}];
completionHandler(NO, error);
return nil;
}

ALTAccount *account = [NSClassFromString(@"ALTAccount") new];
ALTTeam *team = [[NSClassFromString(@"ALTTeam") alloc] initWithName:@"" identifier:@"" /*profile.teamIdentifier*/ type:ALTTeamTypeUnknown account:account];
Expand Down

0 comments on commit d074394

Please sign in to comment.