Skip to content

Commit

Permalink
Update Tweak.x
Browse files Browse the repository at this point in the history
Support Long press status bar
  • Loading branch information
pwnless authored Oct 9, 2024
1 parent bc59e31 commit a9c2875
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Tweak.x
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <objc/message.h>
#import "FLEXManager.h"

@interface UIStatusBarWindow : UIWindow @end

__attribute__((visibility("hidden")))
@interface AutoFLEX : NSObject {
@private
Expand Down Expand Up @@ -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];
}
}

0 comments on commit a9c2875

Please sign in to comment.