forked from XueshiQiao/FLEXLoader
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SSFLEXLoaderLoader.l.mm
32 lines (26 loc) · 1.1 KB
/
SSFLEXLoaderLoader.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
25
26
27
28
29
30
31
32
//
// 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.joeyio.FLEXLoader.plist"] retain];
NSString *libraryPath = @"/Library/Application Support/FLEXLoader/FLEXDylib.dylib";
NSLog(@"SSFLEXLoader before loaded %@", libraryPath);
if([[prefs objectForKey:[NSString stringWithFormat:@"FLEXLoaderEnabled-%@", [[NSBundle mainBundle] bundleIdentifier]]] boolValue]) {
if ([[NSFileManager defaultManager] fileExistsAtPath:libraryPath]){
dlopen([libraryPath UTF8String], RTLD_NOW);
NSLog(@"SSFLEXLoader loaded %@", libraryPath);
} else {
NSLog(@"SSFLEXLoader file not exists %@", libraryPath);
}
} else {
NSLog(@"SSFLEXLoader not enabled %@", libraryPath);
}
NSLog(@"SSFLEXLoader after loaded %@", libraryPath);
[pool drain];
}