|
@@ -0,0 +1,45 @@
|
|
|
+#import <dlfcn.h>
|
|
|
+#import <objc/runtime.h>
|
|
|
+#import <Foundation/Foundation.h>
|
|
|
+#include <TargetConditionals.h>
|
|
|
+
|
|
|
+@interface NSDistributedNotificationCenter : NSNotificationCenter
|
|
|
+
|
|
|
++ (id)defaultCenter;
|
|
|
+
|
|
|
+- (void)addObserver:(id)arg1 selector:(SEL)arg2 name:(id)arg3 object:(id)arg4;
|
|
|
+- (void)postNotificationName:(id)arg1 object:(id)arg2 userInfo:(id)arg3;
|
|
|
+
|
|
|
+@end
|
|
|
+
|
|
|
+/* Set platform binary flag */
|
|
|
+#define FLAG_PLATFORMIZE (1 << 1)
|
|
|
+
|
|
|
+void platformizeme() {
|
|
|
+ void* handle = dlopen("/usr/lib/libjailbreak.dylib", RTLD_LAZY);
|
|
|
+ if (!handle) return;
|
|
|
+
|
|
|
+ // Reset errors
|
|
|
+ dlerror();
|
|
|
+ typedef void (*fix_entitle_prt_t)(pid_t pid, uint32_t what);
|
|
|
+ fix_entitle_prt_t ptr = (fix_entitle_prt_t)dlsym(handle, "jb_oneshot_entitle_now");
|
|
|
+
|
|
|
+ const char *dlsym_error = dlerror();
|
|
|
+ if (dlsym_error) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ ptr(getpid(), FLAG_PLATFORMIZE);
|
|
|
+}
|
|
|
+
|
|
|
+int main(){
|
|
|
+ @autoreleasepool {
|
|
|
+ platformizeme();
|
|
|
+
|
|
|
+ Class notecenter = objc_getClass("NSDistributedNotificationCenter");
|
|
|
+ id note = [notecenter defaultCenter];
|
|
|
+ [note postNotificationName:@"com.nitoTV.wakeup" object:nil ];
|
|
|
+ sleep(3);
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|