Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Frameworks folder #1

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions AltSign/Signing/ALTSigner.mm
Expand Up @@ -232,7 +232,6 @@ - (NSProgress *)signAppAtURL:(NSURL *)appURL provisioningProfiles:(NSArray<ALTPr
}

NSURL *pluginsURL = [appBundle builtInPlugInsURL];

NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtURL:pluginsURL
includingPropertiesForKeys:nil options:NSDirectoryEnumerationSkipsSubdirectoryDescendants errorHandler:nil];

Expand Down Expand Up @@ -264,10 +263,8 @@ - (NSProgress *)signAppAtURL:(NSURL *)appURL provisioningProfiles:(NSArray<ALTPr
ldid::DiskFolder appBundle(application.fileURL.fileSystemRepresentation);
std::string key = CertificatesContent(self.certificate);

ldid::Sign("", appBundle, key, "",
ldid::fun([&](const std::string &path, const std::string &binaryEntitlements) -> std::string {
ldid::Sign("", appBundle, key, "",ldid::fun([&](const std::string &path, const std::string &binaryEntitlements) -> std::string {
NSString *filename = [NSString stringWithCString:path.c_str() encoding:NSUTF8StringEncoding];

NSURL *fileURL = nil;

if (filename.length == 0)
Expand All @@ -280,6 +277,12 @@ - (NSProgress *)signAppAtURL:(NSURL *)appURL provisioningProfiles:(NSArray<ALTPr
}

NSString *entitlements = entitlementsByFileURL[fileURL];

/* Frameworks should have same entitlements as main app */
if (entitlements == nil && [filename hasPrefix:@"Frameworks/"]) {
entitlements = entitlementsByFileURL[application.fileURL];
}

return entitlements.UTF8String;
}),
ldid::fun([&](const std::string &string) {
Expand All @@ -288,7 +291,6 @@ - (NSProgress *)signAppAtURL:(NSURL *)appURL provisioningProfiles:(NSArray<ALTPr
ldid::fun([&](const double signingProgress) {
}));


// Dispatch after to allow time to finish signing binary.
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
if (ipaURL != nil)
Expand Down
2 changes: 1 addition & 1 deletion Dependencies/ldid
Submodule ldid updated 2 files
+2 −2 ldid.cpp
+1 −1 libplist