Skip to content

Commit

Permalink
Disable alternative dyld cache on apps launched from SpringBoard
Browse files Browse the repository at this point in the history
  • Loading branch information
rpetrich committed Feb 24, 2012
1 parent 520636f commit 981767e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Hooks/Hooks.x
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@

- (void)launch
{
NSMutableDictionary *dict = [[self seatbeltEnvironmentVariables] mutableCopy] ?: [[NSMutableDictionary alloc] init];
NSDictionary *LSEnvironment = [[[self bundle] infoDictionary] objectForKey:@"LSEnvironment"];
if (LSEnvironment) {
NSMutableDictionary *dict = [[self seatbeltEnvironmentVariables] mutableCopy];
if (dict) {
[dict addEntriesFromDictionary:LSEnvironment];
[self setSeatbeltEnvironmentVariables:dict];
[dict release];
} else {
[self setSeatbeltEnvironmentVariables:LSEnvironment];
}
if ([[[NSProcessInfo processInfo].environment objectForKey:@"DYLD_SHARED_CACHE_DIR"] isEqualToString:@"/var/belfry"]) {
[dict setObject:@"/System/Library/Caches/com.apple.dyld" forKey:@"DYLD_SHARED_CACHE_DIR"];
[dict setObject:@"public" forKey:@"DYLD_SHARED_REGION"];
[dict setObject:@"0" forKey:@"DYLD_SHARED_CACHE_DONT_VALIDATE"];
}
if (LSEnvironment)
[dict addEntriesFromDictionary:LSEnvironment];
[self setSeatbeltEnvironmentVariables:dict];
[dict release];
%orig;
}

Expand Down

0 comments on commit 981767e

Please sign in to comment.