diff --git a/Tweak.x b/Tweak.x index b1e3b3d..9d42563 100644 --- a/Tweak.x +++ b/Tweak.x @@ -4,6 +4,8 @@ #include #import "FLEXManager.h" +@interface UIStatusBarWindow : UIWindow @end + __attribute__((visibility("hidden"))) @interface AutoFLEX : NSObject { @private @@ -31,12 +33,23 @@ __attribute__((visibility("hidden"))) } -(void)inject { - NSLog(@"Openning explorer: %@", [FLEXManager sharedManager]); [[FLEXManager sharedManager] showExplorer]; } - @end + +%hook UIStatusBarWindow +- (id)initWithFrame:(CGRect)frame { + self = %orig; + [self addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(inject:)]]; + return self; +} + +-(void) inject: (UILongPressGestureRecognizer*)lges { + [[FLEXManager sharedManager] showExplorer]; +} +%end + %ctor { [[NSNotificationCenter defaultCenter] addObserver:[AutoFLEX sharedInstance] selector:@selector(inject) name:UIApplicationDidBecomeActiveNotification object:nil]; -} \ No newline at end of file +}