|
@@ -10,6 +10,11 @@
|
|
|
- (void)_addTVOSGestureRecognizer:(UIViewController *)explorer;
|
|
- (void)_addTVOSGestureRecognizer:(UIViewController *)explorer;
|
|
|
@end
|
|
@end
|
|
|
|
|
|
|
|
|
|
+@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
|
|
|
|
|
|
|
|
@interface UIWindow (Additions)
|
|
@interface UIWindow (Additions)
|
|
|
- (UIViewController *)visibleViewController;
|
|
- (UIViewController *)visibleViewController;
|
|
@@ -40,12 +45,32 @@
|
|
|
}
|
|
}
|
|
|
@end
|
|
@end
|
|
|
|
|
|
|
|
|
|
+@interface LSApplicationProxy: NSObject
|
|
|
|
|
++(id)applicationProxyForIdentifier:(id)sender;
|
|
|
|
|
++(id)tv_applicationFlatIcon;
|
|
|
|
|
+@end
|
|
|
|
|
+
|
|
|
@implementation NSObject (Additions)
|
|
@implementation NSObject (Additions)
|
|
|
- (UIViewController *)topViewController {
|
|
- (UIViewController *)topViewController {
|
|
|
return [[[UIApplication sharedApplication] keyWindow] visibleViewController];
|
|
return [[[UIApplication sharedApplication] keyWindow] visibleViewController];
|
|
|
}
|
|
}
|
|
|
@end
|
|
@end
|
|
|
|
|
|
|
|
|
|
+static void sendNotification(NSString *title, NSString *message, UIImage *image) {
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary *dict = [NSMutableDictionary new];
|
|
|
|
|
+ dict[@"message"] = message;
|
|
|
|
|
+ dict[@"title"] = title;
|
|
|
|
|
+ dict[@"timeout"] = [NSNumber numberWithInteger:4];
|
|
|
|
|
+ if (image){
|
|
|
|
|
+ NSData *imageData = UIImagePNGRepresentation(image);
|
|
|
|
|
+ if (imageData){
|
|
|
|
|
+ dict[@"imageData"] = imageData;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ [[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"com.nito.bulletinh4x/displayBulletin" object:nil userInfo:dict];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// The dylib constructor sets decryptedIPAPath, spawns a thread to do the app decryption, then exits.
|
|
// The dylib constructor sets decryptedIPAPath, spawns a thread to do the app decryption, then exits.
|
|
|
__attribute__ ((constructor)) static void FLEXInjected_main() {
|
|
__attribute__ ((constructor)) static void FLEXInjected_main() {
|
|
|
|
|
|
|
@@ -53,8 +78,23 @@ __attribute__ ((constructor)) static void FLEXInjected_main() {
|
|
|
NSString *bundleID = [bundle bundleIdentifier];
|
|
NSString *bundleID = [bundle bundleIdentifier];
|
|
|
NSDictionary *ourDict = [[NSDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.nito.flexinjected.plist"];
|
|
NSDictionary *ourDict = [[NSDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.nito.flexinjected.plist"];
|
|
|
NSNumber *value = [ourDict objectForKey:bundleID];
|
|
NSNumber *value = [ourDict objectForKey:bundleID];
|
|
|
- NSLog(@"[FLEXInjected) bundle ID %@", bundleID);
|
|
|
|
|
if ([value boolValue] == YES) {
|
|
if ([value boolValue] == YES) {
|
|
|
|
|
+
|
|
|
|
|
+ id prox = [%c(LSApplicationProxy) applicationProxyForIdentifier:bundleID];
|
|
|
|
|
+ UIImage *icon = nil;
|
|
|
|
|
+ if (prox){
|
|
|
|
|
+ NSLog(@"[FLEXInjected] found prox: %@", prox);
|
|
|
|
|
+ icon = [prox tv_applicationFlatIcon];
|
|
|
|
|
+ } else {
|
|
|
|
|
+ NSString *mcsPath = @"/System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices";
|
|
|
|
|
+ [[NSBundle bundleWithPath:mcsPath] load];
|
|
|
|
|
+ prox = [%c(LSApplicationProxy) applicationProxyForIdentifier:bundleID];
|
|
|
|
|
+ icon = [prox tv_applicationFlatIcon];
|
|
|
|
|
+ }
|
|
|
|
|
+ NSString *message = [NSString stringWithFormat:@"Injected into bundle: %@", bundleID];
|
|
|
|
|
+ sendNotification(@"FlexInjected", message, icon);
|
|
|
|
|
+ NSLog(@"[FLEXInjected) bundle ID %@", bundleID);
|
|
|
|
|
+
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
NSLog(@"[FLEXInjected] weouchea...");
|
|
NSLog(@"[FLEXInjected] weouchea...");
|
|
|
NSString *p = @"/Library/Frameworks/FLEX.framework";
|
|
NSString *p = @"/Library/Frameworks/FLEX.framework";
|
|
@@ -70,8 +110,6 @@ __attribute__ ((constructor)) static void FLEXInjected_main() {
|
|
|
[flexManager _addTVOSGestureRecognizer:tvc];
|
|
[flexManager _addTVOSGestureRecognizer:tvc];
|
|
|
[flexManager showExplorer];
|
|
[flexManager showExplorer];
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
- NSLog(@"[FLEXInjected] All done, exiting constructor.");
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|