forked from heardrwt/RevealLoader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RHRevealLoader.l.mm
24 lines (21 loc) · 939 Bytes
/
RHRevealLoader.l.mm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//
// RHRevealLoader.xm
// RHRevealLoader
//
// Created by Richard Heard on 21/03/2014.
// Copyright (c) 2014 Richard Heard. All rights reserved.
//
#include <dlfcn.h>
%ctor {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDictionary *prefs = [[NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.rheard.RHRevealLoader.plist"] retain];
NSString *libraryPath = @"/Library/RHRevealLoader/libReveal.dylib";
if([[prefs objectForKey:[NSString stringWithFormat:@"RHRevealEnabled-%@", [[NSBundle mainBundle] bundleIdentifier]]] boolValue]) {
if ([[NSFileManager defaultManager] fileExistsAtPath:libraryPath]){
dlopen([libraryPath UTF8String], RTLD_NOW);
[[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil];
NSLog(@"RHRevealLoader loaded %@", libraryPath);
}
}
[pool drain];
}