Skip to content

Commit

Permalink
Fixes framework (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttwj committed Jan 29, 2016
1 parent 2eb1218 commit fa04e6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Clutch/Framework64Dumper.m
Expand Up @@ -160,9 +160,10 @@ - (BOOL)dumpBinary
}

[[NSFileManager defaultManager] createDirectoryAtPath:workingPath withIntermediateDirectories:YES attributes:nil error:nil];


if (![[NSFileManager defaultManager] createSymbolicLinkAtPath:[workingPath stringByAppendingPathComponent:@"clutch"] withDestinationPath:[NSProcessInfo processInfo].arguments[0] error:nil]) {
ERROR(@"Failed to create symbolic link to %@", workingPath);
if (![[NSFileManager defaultManager] copyItemAtPath:[NSProcessInfo processInfo].arguments[0] toPath:[workingPath stringByAppendingPathComponent:@"clutch"] error:nil]) {
ERROR(@"Failed to copy clutch to %@", workingPath);
return NO;
}

Expand All @@ -173,7 +174,7 @@ - (BOOL)dumpBinary

[[NSFileManager defaultManager] createSymbolicLinkAtPath:[workingPath stringByAppendingPathComponent:@"Frameworks"] withDestinationPath:_originalBinary.frameworksPath error:nil];

const char *argv[] = {[[NSProcessInfo processInfo].arguments[0] UTF8String],
const char *argv[] = {[[workingPath stringByAppendingPathComponent:@"clutch"] UTF8String],
"-f",
swappedBinaryPath.UTF8String,
binaryDumpPath.UTF8String,
Expand Down
8 changes: 5 additions & 3 deletions Clutch/FrameworkDumper.m
Expand Up @@ -164,9 +164,11 @@ - (BOOL)dumpBinary
}

[[NSFileManager defaultManager] createDirectoryAtPath:workingPath withIntermediateDirectories:YES attributes:nil error:nil];



if (![[NSFileManager defaultManager] createSymbolicLinkAtPath:[workingPath stringByAppendingPathComponent:@"clutch"] withDestinationPath:[NSProcessInfo processInfo].arguments[0] error:nil]) {
ERROR(@"Failed to create symbolic link to %@", workingPath);
if (![[NSFileManager defaultManager] copyItemAtPath:[NSProcessInfo processInfo].arguments[0] toPath:[workingPath stringByAppendingPathComponent:@"clutch"] error:nil]) {
ERROR(@"Failed to copy clutch to %@", workingPath);
return NO;
}

Expand All @@ -177,7 +179,7 @@ - (BOOL)dumpBinary

[[NSFileManager defaultManager] createSymbolicLinkAtPath:[workingPath stringByAppendingPathComponent:@"Frameworks"] withDestinationPath:_originalBinary.frameworksPath error:nil];

const char *argv[] = {[[NSProcessInfo processInfo].arguments[0] UTF8String],
const char *argv[] = {[[workingPath stringByAppendingPathComponent:@"clutch"] UTF8String],
"-f",
swappedBinaryPath.UTF8String,
binaryDumpPath.UTF8String,
Expand Down

0 comments on commit fa04e6f

Please sign in to comment.