Skip to content

Commit

Permalink
Feat: Add workaround to access BHInsta settings through Instagram logo
Browse files Browse the repository at this point in the history
  • Loading branch information
SoCuul committed Mar 14, 2024
1 parent bd6b897 commit 60026b0
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/Features/General/BHSettingsMenuEntry.x
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@
#import "../../Manager.h"
#import "../../Controllers/SettingsViewController.h"

// Workaround to display dropdown settings menu, to still show BHInsta settings
%hook IGProfileViewController
- (BOOL)_shouldOpenSettingsDirectly {
return false;
// Workaround to show BHInsta settings by clicking on Instagram logo
%hook IGMainAppHeaderView
- (void)_logoButtonTapped {
NSLog(@"[BHInsta] Displaying BHInsta settings modal");

UIViewController *rootController = [[UIApplication sharedApplication] delegate].window.rootViewController;
SettingsViewController *settingsViewController = [SettingsViewController new];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:settingsViewController];

[rootController presentViewController:navigationController animated:YES completion:nil];

return;
}
%end

// Being phased out by insta (as of March 8th 2023)
// Legacy (as of March 13th 2023)
%hook IGProfileMenuSheetViewController
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 9;
Expand Down Expand Up @@ -84,17 +92,16 @@
// Add button to children array
//UIBarButtonItem *bhSettingsButton = [[UIBarButtonItem alloc] initWithImage:[UIImage systemImageNamed:@"gear.circle"] style:UIBarButtonItemStylePlain target:self action:@selector(displaySettingsModal)];
/* IGBadgedNavigationButton *badgedNavButton = [IGBadgedNavigationButton new]; */
// IGBadgedNavigationButton *badgedNavButton = [IGBadgedNavigationButton new];
//UIButton *newButton = [UIButton buttonWithType:UIButtonTypeSystem];
//[badgedNavButton ]
//[newChildren addObject:badgedNavButton];
// Make children array immutable
//NSArray *immutableNewChildren = [newChildren copy];

NSLog(@"[BHInsta] Old Children: %@", children);
//NSArray *immutableNewChildren = [newChildren copy];
NSLog(@"[BHInsta] Old Children: %@", children);
NSLog(@"[BHInsta] New Children: %@", newChildren);
Expand Down

0 comments on commit 60026b0

Please sign in to comment.